{"action":"created","issue":{"url":"https://api.github.com/repos/thrust/thrust/issues/658","labels_url":"https://api.github.com/repos/thrust/thrust/issues/658/labels{/name}","comments_url":"https://api.github.com/repos/thrust/thrust/issues/658/comments","events_url":"https://api.github.com/repos/thrust/thrust/issues/658/events","html_url":"https://github.com/thrust/thrust/issues/658","id":67328510,"number":658,"title":"Merge compile error with long long","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":[{"url":"https://api.github.com/repos/thrust/thrust/labels/bug","name":"bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/thrust/thrust/milestones/5","html_url":"https://github.com/thrust/thrust/milestones/Release1.9","labels_url":"https://api.github.com/repos/thrust/thrust/milestones/5/labels","id":876424,"number":5,"title":"Release1.9","description":null,"creator":{"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},"open_issues":7,"closed_issues":10,"state":"open","created_at":"2014-11-21T22:32:25Z","updated_at":"2015-07-10T21:31:17Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-04-09T10:16:59Z","updated_at":"2015-07-11T10:26:42Z","closed_at":null,"body":"Code below doesn't compile using long long and cuda device vectors.\r\nSetting index_type to int or using constant_iterators instead of counting_iterators fixes the issue.\r\n\r\n```c++\r\n#include <thrust/device_vector.h>\r\n#include <thrust/host_vector.h>\r\n#include <thrust/merge.h>\r\n#include <thrust/iterator/constant_iterator.h>\r\n#include <thrust/iterator/counting_iterator.h>\r\n#include <thrust/iterator/discard_iterator.h>\r\n\r\nint main()\r\n{\r\n    typedef long long index_type;\r\n\r\n    thrust::device_vector<index_type> vec(10);\r\n\r\n    thrust::merge_by_key(thrust::counting_iterator<index_type>(0), thrust::counting_iterator<index_type>(0),\r\n                         vec.begin(), vec.begin(),\r\n                         thrust::counting_iterator<index_type>(0), thrust::counting_iterator<index_type>(0),\r\n                         thrust::make_discard_iterator(),\r\n                         thrust::make_discard_iterator());\r\n\r\n    return 0;\r\n}\r\n```\r\n\r\n```shell\r\n/usr/local/cuda/include/thrust/system/cuda/detail/bulk/detail/apply_from_tuple.hpp(118): error: no instance of function template \"thrust::system::cuda::detail::merge_detail::merge_kernel::operator()\" matches the argument list\r\n            argument types are: (thrust::system::cuda::detail::bulk_::concurrent_group<thrust::system::cuda::detail::bulk_::agent<5UL>, 288UL>, const thrust::zip_iterator<thrust::tuple<thrust::counting_iterator<long long, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::counting_iterator<long long, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>>, const thrust::detail::intmax_t, const thrust::zip_iterator<thrust::tuple<thrust::detail::normal_iterator<thrust::device_ptr<long long>>, thrust::counting_iterator<long long, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>>, const signed long, const thrust::detail::normal_iterator<thrust::pointer<int, thrust::system::cuda::detail::tag, thrust::use_default, thrust::use_default>>, const thrust::zip_iterator<thrust::tuple<thrust::discard_iterator<thrust::use_default>, thrust::discard_iterator<thrust::use_default>, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>>, const thrust::detail::compare_first<thrust::less<long long>>)\r\n            object type is: thrust::system::cuda::detail::merge_detail::merge_kernel\r\n          detected during:\r\n            instantiation of \"void thrust::system::cuda::detail::bulk_::detail::apply_from_tuple(Function, const thrust::tuple<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, thrust::null_type, thrust::null_type> &) [with Function=thrust::system::cuda::detail::merge_detail::merge_kernel, Arg1=thrust::system::cuda::detail::bulk_::concurrent_group<thrust::system::cuda::detail::bulk_::agent<5UL>, 288UL> &, Arg2=thrust::zip_iterator<thrust::tuple<thrust::counting_iterator<long long, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::counting_iterator<long long, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>>, Arg3=thrust::detail::intmax_t, Arg4=thrust::zip_iterator<thrust::tuple<thrust::detail::normal_iterator<thrust::device_ptr<long long>>, thrust::counting_iterator<long long, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>>, Arg5=signed long, Arg6=thrust::detail::normal_iterator<thrust::pointer<int, thrust::system::cuda::detail::tag, thrust::use_default, thrust::use_default>>, Arg7=thrust::zip_iterator<thrust::tuple<thrust::discard_iterator<thrust::use_default>, thrust::discard_iterator<thrust::use_default>, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>>, Arg8=thrust::detail::compare_first<thrust::less<long long>>]\" \r\n/usr/local/cuda/include/thrust/system/cuda/detail/bulk/detail/closure.hpp(50): here\r\n```"},"comment":{"url":"https://api.github.com/repos/thrust/thrust/issues/comments/120602616","html_url":"https://github.com/thrust/thrust/issues/658#issuecomment-120602616","issue_url":"https://api.github.com/repos/thrust/thrust/issues/658","id":120602616,"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-07-11T10:26:42Z","updated_at":"2015-07-11T10:26:42Z","body":"Thanks Manuel. This suggests to me that the root cause of the problem is elsewhere.\r\n\r\nProbably there's some function inside of `merge` (possibly the one indicated by the original error message) that needs to be generalized to take two arguments of different types instead of two arguments of the same type."}}