Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
This repository was 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

@lilohuang

Description

@lilohuang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions