torch / cunn

Other
215 stars 174 forks source link

CMake Error at THCUNN_generated_LookupTable.cu.o.cmake:267 (message): #494

Open lethal233 opened 3 years ago

lethal233 commented 3 years ago

when I tried to install the cunn through luarocks: luarocks make rocks/cunn-scm-1.rockspec, it occurs error:

/media/xxx/21EC3ABD229B0E60/project/cnncomplete-master/torch/cunn/lib/THCUNN/LookupTable.cu(32): error: identifier "__shfl" is undefined

/media/xxx/21EC3ABD229B0E60/project/cnncomplete-master/torch/cunn/lib/THCUNN/LookupTable.cu(49): warning: function "__any"
/usr/local/cuda/include/device_atomic_functions.h(178): here was declared deprecated ("__any() is not valid on compute_70 and above, and should be replaced with __any_sync().To continue using __any(), specify virtual architecture compute_60 when targeting sm_70 and above, for example, using the pair of compiler options: -arch=compute_60 -code=sm_70.")

1 error detected in the compilation of "/tmp/tmpxft_00002d60_00000000-6_LookupTable.cpp1.ii".
CMake Error at THCUNN_generated_LookupTable.cu.o.cmake:267 (message):
  Error generating file
  /media/xxx/21EC3ABD229B0E60/project/cnncomplete-master/torch/cunn/build/lib/THCUNN/CMakeFiles/THCUNN.dir//./THCUNN_generated_LookupTable.cu.o

lib/THCUNN/CMakeFiles/THCUNN.dir/build.make:8598: recipe for target 'lib/THCUNN/CMakeFiles/THCUNN.dir/THCUNN_generated_LookupTable.cu.o' failed
make[2]: *** [lib/THCUNN/CMakeFiles/THCUNN.dir/THCUNN_generated_LookupTable.cu.o] Error 1
CMakeFiles/Makefile2:130: recipe for target 'lib/THCUNN/CMakeFiles/THCUNN.dir/all' failed
make[1]: *** [lib/THCUNN/CMakeFiles/THCUNN.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

and in LookupTable.cu

#if __CUDA_ARCH__ >= 300

  #pragma unroll
  for (int i = 1; i <= 16; i++)
  {
    dup |= (__shfl(val, (laneId + i) % 32) == val);    <- line 32
  }

#else

  volatile __shared__ int values[128];
  values[threadIdx.x] = val;
  const int offset = threadIdx.x - laneId;

  #pragma unroll
  for (int i = 1; i <= 16; i++)
  {
    dup |= (values[offset + ((laneId + i) % 32)] == val);
  }

#endif