BUG|Torch编译错误

问题:

/home/weishu/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(414): error: more than one operator "==" matches these operands:

function "operator==(const __half &, const __half &)"

function "operator==(half, half)"

operand types are: half == half

2 errors detected in the compilation of "/tmp/tmpxft_000053e0_00000000-6_THCTensorMath.cpp1.ii".

CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message):

Error generating file

/home/weishu/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:112: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o' failed

make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1

make[2]: *** Waiting for unfinished jobs....

CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed

make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2

Makefile:127: recipe for target 'all' failed

make: *** [all] Error 2

Error: Build error: Failed building.

解决方案:

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容