{"action":"created","issue":{"url":"https://api.github.com/repos/thrust/thrust/issues/645","labels_url":"https://api.github.com/repos/thrust/thrust/issues/645/labels{/name}","comments_url":"https://api.github.com/repos/thrust/thrust/issues/645/comments","events_url":"https://api.github.com/repos/thrust/thrust/issues/645/events","html_url":"https://github.com/thrust/thrust/pull/645","id":60608593,"number":645,"title":"Used UINT_MAX instead of std::numeric_limits to avoid __host__ __device_...","user":{"login":"sdalton1","id":1518027,"avatar_url":"https://avatars.githubusercontent.com/u/1518027?v=3","gravatar_id":"","url":"https://api.github.com/users/sdalton1","html_url":"https://github.com/sdalton1","followers_url":"https://api.github.com/users/sdalton1/followers","following_url":"https://api.github.com/users/sdalton1/following{/other_user}","gists_url":"https://api.github.com/users/sdalton1/gists{/gist_id}","starred_url":"https://api.github.com/users/sdalton1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdalton1/subscriptions","organizations_url":"https://api.github.com/users/sdalton1/orgs","repos_url":"https://api.github.com/users/sdalton1/repos","events_url":"https://api.github.com/users/sdalton1/events{/privacy}","received_events_url":"https://api.github.com/users/sdalton1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-11T04:20:18Z","updated_at":"2015-03-11T04:25:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thrust/thrust/pulls/645","html_url":"https://github.com/thrust/thrust/pull/645","diff_url":"https://github.com/thrust/thrust/pull/645.diff","patch_url":"https://github.com/thrust/thrust/pull/645.patch"},"body":"..._ warning\r\n\r\nThe following code issues a warning when the device backend is set to OMP.\r\n\r\n```shell\r\n/usr/local/cuda/include/thrust/system/detail/generic/copy_if.inl(143): warning: calling a __host__ function from a __host__ __device__ function is not allowed\r\n```\r\n\r\nThis update replaces std::numeric_limits<unsigned int>::max with UINT_MAX to silence the warning.\r\n\r\n```c++\r\n#include <thrust/device_vector.h>\r\n#include <thrust/copy.h>\r\n\r\nint main(void)\r\n{\r\n    thrust::device_vector<int> A;\r\n    thrust::device_vector<bool> stencil;\r\n\r\n    thrust::copy_if(A.begin(), A.end(), A.begin(), thrust::identity<bool>());\r\n\r\n    return 0;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/thrust/thrust/issues/comments/78203159","html_url":"https://github.com/thrust/thrust/pull/645#issuecomment-78203159","issue_url":"https://api.github.com/repos/thrust/thrust/issues/645","id":78203159,"user":{"login":"jaredhoberock","id":1253007,"avatar_url":"https://avatars.githubusercontent.com/u/1253007?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredhoberock","html_url":"https://github.com/jaredhoberock","followers_url":"https://api.github.com/users/jaredhoberock/followers","following_url":"https://api.github.com/users/jaredhoberock/following{/other_user}","gists_url":"https://api.github.com/users/jaredhoberock/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredhoberock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredhoberock/subscriptions","organizations_url":"https://api.github.com/users/jaredhoberock/orgs","repos_url":"https://api.github.com/users/jaredhoberock/repos","events_url":"https://api.github.com/users/jaredhoberock/events{/privacy}","received_events_url":"https://api.github.com/users/jaredhoberock/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T04:25:01Z","updated_at":"2015-03-11T04:25:01Z","body":"Thanks Steven. We don't use `UINT_MAX` directly. I think it needs to be `thrust::detail::integer_traits<unsigned int>::const_max`. You need to `#include <thrust/detail/integer_traits.h>` to use that class."}}