Skip to content

Commit

Permalink
FIX: adding CUDA_ARCHITECTURES
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcarcamov committed Jul 9, 2022
1 parent 16fc24c commit 55bbccb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ if(Boost_FOUND)
set(TEMP "${TEMP} ") # A space to cleanly separate from existing content
endif()

set_property(TARGET gpuvmem PROPERTY CUDA_ARCHITECTURES
${CUDA_NVCC_ARCH_FLAGS})

if(MEMORY_DEBUG)
message(NOTICE "MEMORY DEBUG IS ON")
set(COMPFLAGS "-g -G -D_FORCE_INLINES -w")
Expand Down Expand Up @@ -105,14 +108,14 @@ if(Boost_FOUND)
CUDA_SEPARABLE_COMPILATION ON
CUDA_STANDARD 11)
set(CMAKE_CUDA_FLAGS
"${CMAKE_CUDA_FLAGS} -Xptxas -O3 -Xcompiler -fopenmp ${CUDA_NVCC_ARCH_FLAGS}"
)
"${CMAKE_CUDA_FLAGS} -Xptxas -O3 -Xcompiler -fopenmp")
endif()
endif()

set(ALL_CUDA_LIBRARIES ${CUDA_cuda_LIBRARY} ${CUDA_cudart_LIBRARY}
${CUDA_cufft_LIBRARY})
set(ALL_LIBRARIES ${CASACORE_LIBRARIES} ${CFITSIO_LIBRARY} ${Boost_LIBRARIES})

target_link_libraries(gpuvmem m stdc++ gomp ${ALL_CUDA_LIBRARIES}
${ALL_LIBRARIES})
# Adding install target
Expand Down
2 changes: 1 addition & 1 deletion cuda_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if(CUDA_FOUND)
endif()

if(${CUDA_SUCCESS})
message(STATUS "CUDA Architecture: ${ARCH}")
message(STATUS "CUDA Architecture: sm_${ARCH}")
message(STATUS "CUDA Version: ${CUDA_VERSION_STRING}")
message(STATUS "CUDA Path: ${CUDA_TOOLKIT_ROOT_DIR}")
message(STATUS "CUDA Libraries: ${CUDA_LIBRARIES}")
Expand Down
3 changes: 1 addition & 2 deletions scripts/check_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ int main(int argc, char** argv) {
min_cc, dP.major, dP.minor);
return 1; /* Failure */
} else {
printf("-gencode arch=compute_%d%d,code=sm_%d%d", dP.major, dP.minor,
dP.major, dP.minor);
printf("%d%d", dP.major, dP.minor);
return 0; /* Success */
}
}

0 comments on commit 55bbccb

Please sign in to comment.