Skip to content

Instantly share code, notes, and snippets.

@akors
Created October 9, 2017 12:37
Show Gist options
  • Save akors/e945c7099100f7069c3477275bbfdc04 to your computer and use it in GitHub Desktop.
Save akors/e945c7099100f7069c3477275bbfdc04 to your computer and use it in GitHub Desktop.
#include <thrust/device_vector.h>
#include <thrust/transform.h>
// commmand line:
// nvcc --std=c++11 -c nvcc-cpp11-crash.cu nvcc-cpp11-crash.cu.o
//
// crashes nvcc with:
// Error: Internal Compiler Error (codegen): "there was an error in verifying the lgenfe output!"
// GCC 6.4, CUDA (9.0.176)
struct unary_op
{
__host__ __device__
thrust::tuple<float, float> operator()(const float a)
{
if (isinf(a)) {}
return thrust::tuple<float, float>();
}
};
struct compare_key_value{
__host__ __device__
thrust::tuple<float, float> operator()(thrust::tuple<float, float> lhs, thrust::tuple<float, float> rhs) {
return true;
}
};
void somefun() {
thrust::transform_reduce(
thrust::device_pointer_cast((float*) nullptr),
thrust::device_pointer_cast((float*) nullptr),
unary_op(),
thrust::tuple<float, float>(0.0f, 0.0f),
compare_key_value()
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment