Loading CMakeLists.txt +3 −3 Original line number Diff line number Diff line Loading @@ -183,9 +183,9 @@ if( ${WITH_CUDA} ) endif() set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ;-DHAVE_CUDA) # disable false compiler warnings # reference for the -Xcudafe flag: http://stackoverflow.com/questions/14831051/how-to-disable-compiler-warnings-with-nvcc/17095910#17095910 # list of possible tokens: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe "\"--diag_suppress=code_is_unreachable --diag_suppress=implicit_return_from_non_void_function\"") # reference for the -Xcudafe --diag_suppress and --display_error_number flags: https://stackoverflow.com/a/54142937 # incomplete list of tokens: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe "\"--diag_suppress=code_is_unreachable --diag_suppress=implicit_return_from_non_void_function --diag_suppress=2906 --display_error_number\"") set( ALL_CUDA_ARCHS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 Loading src/UnitTests/AssertCudaTest.cu +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,10 @@ using namespace TNL; #ifdef HAVE_CUDA // ignore useless nvcc warning: https://stackoverflow.com/a/49997636 #pragma push #pragma diag_suppress = declared_but_not_referenced #define WRAP_ASSERT( suffix, statement, not_failing ) \ __global__ \ void kernel_##suffix( int* output ) \ Loading Loading @@ -99,6 +103,8 @@ WRAP_ASSERT( test26, TNL_ASSERT_LT( ten, 2, "ten < 2" );, false ); WRAP_ASSERT( test27, TNL_ASSERT_TRUE( data_null, "nullptr is true" );, false ); WRAP_ASSERT( test28, TNL_ASSERT_FALSE( data_full, "non-nullptr is false" );, false ); #pragma pop #endif #endif Loading Loading
CMakeLists.txt +3 −3 Original line number Diff line number Diff line Loading @@ -183,9 +183,9 @@ if( ${WITH_CUDA} ) endif() set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ;-DHAVE_CUDA) # disable false compiler warnings # reference for the -Xcudafe flag: http://stackoverflow.com/questions/14831051/how-to-disable-compiler-warnings-with-nvcc/17095910#17095910 # list of possible tokens: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe "\"--diag_suppress=code_is_unreachable --diag_suppress=implicit_return_from_non_void_function\"") # reference for the -Xcudafe --diag_suppress and --display_error_number flags: https://stackoverflow.com/a/54142937 # incomplete list of tokens: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe "\"--diag_suppress=code_is_unreachable --diag_suppress=implicit_return_from_non_void_function --diag_suppress=2906 --display_error_number\"") set( ALL_CUDA_ARCHS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 Loading
src/UnitTests/AssertCudaTest.cu +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,10 @@ using namespace TNL; #ifdef HAVE_CUDA // ignore useless nvcc warning: https://stackoverflow.com/a/49997636 #pragma push #pragma diag_suppress = declared_but_not_referenced #define WRAP_ASSERT( suffix, statement, not_failing ) \ __global__ \ void kernel_##suffix( int* output ) \ Loading Loading @@ -99,6 +103,8 @@ WRAP_ASSERT( test26, TNL_ASSERT_LT( ten, 2, "ten < 2" );, false ); WRAP_ASSERT( test27, TNL_ASSERT_TRUE( data_null, "nullptr is true" );, false ); WRAP_ASSERT( test28, TNL_ASSERT_FALSE( data_full, "non-nullptr is false" );, false ); #pragma pop #endif #endif Loading