Guest User

Untitled

a guest
Nov 18th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index cd92b01..b752eb9 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -241,30 +241,18 @@ add_custom_command(
  6. set(GPU_CODE modelHandler_OpenCL.cl.h)
  7.  
  8. if(CUDA_FOUND)
  9. - add_custom_command(
  10. - OUTPUT modelHandler_CUDA.ptx20.h
  11. - COMMAND ${CONV_EXE} modelHandler_CUDA.ptx20 modelHandler_CUDA.ptx20.h str
  12. - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/modelHandler_CUDA.ptx20 conv
  13. - )
  14. -
  15. add_custom_command(
  16. OUTPUT modelHandler_CUDA.ptx30.h
  17. COMMAND ${CONV_EXE} modelHandler_CUDA.ptx30 modelHandler_CUDA.ptx30.h str
  18. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/modelHandler_CUDA.ptx30 conv
  19. )
  20. -
  21. - add_custom_command(
  22. - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/modelHandler_CUDA.ptx20
  23. - COMMAND ${CUDA_NVCC_EXECUTABLE} ${CUDA_NVCC_FLAGS} -arch=sm_20 -ptx -o ${CMAKE_CURRENT_BINARY_DIR}/modelHandler_CUDA.ptx20 ${CMAKE_CURRENT_SOURCE_DIR}/src/modelHandler_CUDA.cu
  24. - DEPENDS src/modelHandler_CUDA.cu
  25. - )
  26. add_custom_command(
  27. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/modelHandler_CUDA.ptx30
  28. COMMAND ${CUDA_NVCC_EXECUTABLE} ${CUDA_NVCC_FLAGS} -arch=sm_30 -ptx -o ${CMAKE_CURRENT_BINARY_DIR}/modelHandler_CUDA.ptx30 ${CMAKE_CURRENT_SOURCE_DIR}/src/modelHandler_CUDA.cu
  29. DEPENDS src/modelHandler_CUDA.cu
  30. )
  31.  
  32. - set(GPU_CODE ${GPU_CODE} modelHandler_CUDA.ptx30.h modelHandler_CUDA.ptx20.h)
  33. + set(GPU_CODE ${GPU_CODE} modelHandler_CUDA.ptx30.h)
  34. endif()
  35.  
  36. add_custom_target(gensrcs ALL
  37. diff --git a/src/modelHandler_CUDA.cpp b/src/modelHandler_CUDA.cpp
  38. index 8ed0ef8..8f2c316 100644
  39. --- a/src/modelHandler_CUDA.cpp
  40. +++ b/src/modelHandler_CUDA.cpp
  41. @@ -15,9 +15,6 @@ static void *handle;
  42. #endif
  43.  
  44. #ifdef HAVE_CUDA
  45. -static const char prog20[] =
  46. -#include "modelHandler_CUDA.ptx20.h"
  47. - ;
  48. static const char prog30[] =
  49. #include "modelHandler_CUDA.ptx30.h"
  50. ;
  51. @@ -136,7 +133,7 @@ initCUDA(ComputeEnv *env, int dev_id)
  52. return false;
  53. }
  54.  
  55. - const char *prog = prog20;
  56. + const char *prog;
  57. if (cap_major >= 3) {
  58. prog = prog30;
  59. }
Add Comment
Please, Sign In to add comment