update cmake
This commit is contained in:
parent
534366dea2
commit
9cc7ea4a97
@ -65,6 +65,7 @@ message(STATUS TORCH_VERSION=${TORCH_VERSION_MAJOR}.${TORCH_VERSION_MINOR})
|
|||||||
# find CUDA
|
# find CUDA
|
||||||
if (TORCH_ENABLE_CUDA)
|
if (TORCH_ENABLE_CUDA)
|
||||||
find_package(CUDA 11.4)
|
find_package(CUDA 11.4)
|
||||||
|
find_package(CUDAToolkit)
|
||||||
if (NOT CUDA_FOUND)
|
if (NOT CUDA_FOUND)
|
||||||
set(TORCH_ENABLE_CUDA 0 CACHE BOOL "Whether enable CUDA" FORCE)
|
set(TORCH_ENABLE_CUDA 0 CACHE BOOL "Whether enable CUDA" FORCE)
|
||||||
message(FATAL_ERROR "Xplace only supports CUDA mode, CMake will exit." )
|
message(FATAL_ERROR "Xplace only supports CUDA mode, CMake will exit." )
|
||||||
|
|||||||
@ -24,7 +24,7 @@ add_library(dp SHARED ${CMAKE_CURRENT_SOURCE_DIR}/../io_parser/gp/GPDatabase.cpp
|
|||||||
${SRC_FILES_DP_CUDA})
|
${SRC_FILES_DP_CUDA})
|
||||||
|
|
||||||
target_include_directories(dp PRIVATE ${PROJECT_SOURCE_DIR}/cpp_to_py ${TORCH_INCLUDE_DIRS} ${FLUTE_INCLUDE_DIR})
|
target_include_directories(dp PRIVATE ${PROJECT_SOURCE_DIR}/cpp_to_py ${TORCH_INCLUDE_DIRS} ${FLUTE_INCLUDE_DIR})
|
||||||
target_link_libraries(dp PRIVATE torch ${TORCH_PYTHON_LIBRARY} xplace_common flute dp_cuda_tmp pthread)
|
target_link_libraries(dp PRIVATE torch ${TORCH_PYTHON_LIBRARY} xplace_common flute dp_cuda_tmp pthread CUDA::curand)
|
||||||
target_compile_options(dp PRIVATE -fPIC)
|
target_compile_options(dp PRIVATE -fPIC)
|
||||||
|
|
||||||
install(TARGETS dp DESTINATION ${XPLACE_LIB_DIR})
|
install(TARGETS dp DESTINATION ${XPLACE_LIB_DIR})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user