This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Description
-D__CUDA_NO_HALF_CONVERSIONS__ is required for PyTorch, because PyTorch has its own half type, and without this macro definition will mess things up on C++ type system.
Test program:
#include <cub/cub.cuh>
int main() {}
Build with
nvcc -run cub-no-half.cu -D__CUDA_NO_HALF_CONVERSIONS__
Gets error:
/usr/local/cuda/bin/../targets/x86_64-linux/include/cub/agent/agent_sub_warp_merge_sort.cuh(125): error: no suitable conversion function from "__half" to "float" exists
/usr/local/cuda/bin/../targets/x86_64-linux/include/cub/agent/agent_sub_warp_merge_sort.cuh(125): error: no suitable conversion function from "__half" to "float" exists
/usr/local/cuda/bin/../targets/x86_64-linux/include/cub/agent/agent_sub_warp_merge_sort.cuh(133): error: no suitable conversion function from "__half" to "float" exists
/usr/local/cuda/bin/../targets/x86_64-linux/include/cub/agent/agent_sub_warp_merge_sort.cuh(133): error: no suitable conversion function from "__half" to "float" exists
4 errors detected in the compilation of "cub-no-half.cu".