Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k2 build without pytorch #1164

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ if(NOT K2_WITH_CUDA)
set(K2_ENABLE_NVTX OFF CACHE BOOL "" FORCE)
endif()

if(K2_WITH_CUDA)
find_package(CUDA QUIET)
message(STATUS "CUDA_INCLUDE_DIRS=${CUDA_INCLUDE_DIRS}")
message(STATUS "CUDA_LIBRARIES=${CUDA_LIBRARIES}")
message(STATUS "CUDA_nvToolsExt_LIBRARY=${CUDA_nvToolsExt_LIBRARY}")
message(STATUS "CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}")
endif()

zh794390558 marked this conversation as resolved.
Show resolved Hide resolved
if(NOT K2_USE_PYTORCH)
message(WARNING "\
K2_USE_PYTORCH is OFF, only k2 core lib will be build.
Expand Down
2 changes: 2 additions & 0 deletions k2/csrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ add_library(k2_nvtx INTERFACE)
target_include_directories(k2_nvtx INTERFACE ${CMAKE_SOURCE_DIR})
if(K2_ENABLE_NVTX)
target_compile_definitions(k2_nvtx INTERFACE K2_ENABLE_NVTX=1)
target_include_directories(k2_nvtx INTERFACE ${CUDA_INCLUDE_DIRS})
target_link_libraries(k2_nvtx INTERFACE ${CUDA_nvToolsExt_LIBRARY})
if(WIN32)
target_include_directories(k2_nvtx INTERFACE
${CUDA_TOOLKIT_ROOT_DIR}/include/nvtx3
Expand Down