Thanks to visit codestin.com
Credit goes to github.com

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.

Unable to build with -D__CUDA_NO_HALF_CONVERSIONS__ #394

@zasdfgbnm

Description

@zasdfgbnm

-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".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions