torch / cutorch

A CUDA backend for Torch7
Other
337 stars 208 forks source link

compiling error on windows: class "__half" has no member "x" #815

Open JrManit opened 6 years ago

JrManit commented 6 years ago

I am trying to compile cutorch on Windows using Visual Studio 2015 and CUDA 9.1, and I am struggling with the error class "__half" has no member "x", as following.

1>j:\cpp-torch\cutorch\lib\thc\THCTensorTypeUtils.cuh(141): error : class "half" has no member "x" 1>j:\cpp-torch\cutorch\lib\thc\THCTensorTypeUtils.cuh(141): error : class "half" has no member "x" 1>j:\cpp-torch\cutorch\lib\thc\THCTensorTypeUtils.cuh(145): error : class "half" has no member "x" 1>j:\cpp-torch\cutorch\lib\thc\THCTensorTypeUtils.cuh(145): error : class "half" has no member "x" 1>j:\cpp-torch\cutorch\lib\thc\THCNumerics.cuh(114): error : class "half" has no member "x" 1>j:\cpp-torch\cutorch\lib\thc\THCNumerics.cuh(115): error : class "half" has no member "x"

I look at the definition of __half structure, and the x variable doesn't actually exist. The older CUDA version also doesn't work as well.

Anybody has any clue for this error?

tinalegre commented 6 years ago

@JrManit did you manage to solve the problem? I'm having the same issues with Ubuntu 16.04 LTS, CUDA 9.1, gcc 6.3.0. The following error messages were shown:

[ 30%] Building NVCC (Device) object src/ATen/CMakeFiles/ATen.dir/__/THC/generated/ATen_generated_THCTensorMathReduceDouble.cu.o [ 30%] Building NVCC (Device) object src/ATen/CMakeFiles/ATen.dir/__/THC/generated/ATen_generated_THCTensorMaskedDouble.cu.o [ 31%] Building NVCC (Device) object src/ATen/CMakeFiles/ATen.dir/__/THC/ATen_generated_THCHalf.cu.o [ 31%] Building NVCC (Device) object src/ATen/CMakeFiles/ATen.dir/__/THCUNN/ATen_generated_AbsCriterion.cu.o [ 31%] Building NVCC (Device) object src/ATen/CMakeFiles/ATen.dir/__/THCUNN/ATen_generated_Abs.cu.o [ 31%] Building NVCC (Device) object src/ATen/CMakeFiles/ATen.dir/__/THCUNN/ATen_generated_BatchNormalization.cu.o /home/anaconda3/include/THC/THCTensorTypeUtils.cuh(171): error: class "__half" has no member "x" /home/anaconda3/include/THC/THCTensorTypeUtils.cuh(171): error: class "__half" has no member "x" /home/anaconda3/include/THC/THCTensorTypeUtils.cuh(175): error: class "__half" has no member "x" /home/anaconda3/include/THC/THCTensorTypeUtils.cuh(175): error: class "__half" has no member "x" 4 errors detected in the compilation of "/tmp/tmpxft_00011fa2_00000000-11_Abs.compute_61.cpp1.ii". CMake Error at ATen_generated_Abs.cu.o.cmake:267 (message): Error generating file /home/Downloads/pytorch/torch/lib/build/aten/src/ATen/CMakeFiles/ATen.dir/__/THCUNN/./ATen_generated_Abs.cu.o`

raftx24 commented 6 years ago

i'm having the same issue! how to solve it!?

nagadomi commented 6 years ago

Probably the same issue as #797

maximiliangoettgens commented 6 years ago

I am having this error too, did anybody solve it yet? @nagadomi I posted this error into issue #797 as well but it seems to be something different since the proposed solutions do not work for me. Maybe anybody else has found a fix for this in the meantime?