Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

[Bug] thrust::reduce_by_key triggers compilation error on thrust 1.17.2 #1826

Closed
lilohuang opened this issue Nov 14, 2022 · 2 comments · Fixed by #1827
Closed

[Bug] thrust::reduce_by_key triggers compilation error on thrust 1.17.2 #1826

lilohuang opened this issue Nov 14, 2022 · 2 comments · Fixed by #1827

Comments

@lilohuang
Copy link
Contributor

lilohuang commented Nov 14, 2022

Hi @senior-zero and @allisonvacanti ,

Using CUDA 11.8 compiler to compile below example code with thrust 1.17.2 and cub 1.17.2 produces compilation error. There is no error on thrust 1.16 with cub 1.16.

I suspect this could be a new bug introduced by #1671 code change in thrust 1.17 but didn't get a chance to triangulate the root cause.

#include <cstdint>
#include <thrust/execution_policy.h>
#include <thrust/reduce.h>
#include <thrust/device_vector.h>
#include <thrust/iterator/discard_iterator.h>
#include <thrust/iterator/transform_output_iterator.h>

int main() {

   thrust::device_vector<int32_t> key(16);
   thrust::device_vector<int32_t> value(16);

   thrust::reduce_by_key(thrust::device, key.begin(), key.end(),
      value.begin(),
      thrust::make_discard_iterator(),
      thrust::make_transform_output_iterator(
         thrust::make_discard_iterator(),
         thrust::negate<int32_t>()));

   return 0;
}
no instance of constructor "thrust::transform_output_iterator<UnaryFunction, OutputIterator>::transform_output_iterator [with UnaryFunction=thrust::negate<int32_t>, OutputIterator=thrust::discard_iterator<thrust::use_default>]" matches the argument list

Please let me know if you cannot reproduce the bug.

Thanks,
Lilo

@lilohuang lilohuang changed the title [Bug] thrust::reduce_by_key triggers compilation error after thrust1.16 [Bug] thrust::reduce_by_key triggers compilation error on thrust 1.17.2 Nov 14, 2022
@gevtushenko
Copy link
Collaborator

@lilohuang thank you for reporting this! I can reproduce the issue. Could you please verify the following fix?

@lilohuang
Copy link
Contributor Author

@senior-zero thanks for your quick fix. No compilation error after applying #1827 fix. Please close this issue once it's merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants