Skip to content

Commit

Permalink
cmake: define CUFILE_BATCH_API_FOUND
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed May 16, 2023
1 parent a771e1c commit 4d44f16
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ rapids_find_package(
)
if(NOT cuFile_FOUND)
message(WARNING "Building KvikIO without cuFile")
else()
file(READ "${cuFile_INCLUDE_DIRS}/cufile.h" CUFILE_H_STR)
string(FIND "${CUFILE_H_STR}" "cuFileBatchIOSetUp" cuFileBatchIOSetUp_location)
if(cuFileBatchIOSetUp_location EQUAL "-1")
set(cuFile_BATCH_API_FOUND FALSE)
else()
set(cuFile_BATCH_API_FOUND TRUE)
endif()
message(STATUS "Found cuFile's Batch API: ${cuFile_BATCH_API_FOUND}")
endif()

# library targets
Expand All @@ -75,6 +84,9 @@ target_link_libraries(kvikio INTERFACE Threads::Threads)
target_link_libraries(kvikio INTERFACE CUDA::toolkit)
if(cuFile_FOUND)
target_link_libraries(kvikio INTERFACE cufile::cuFile_interface)
if(cuFile_BATCH_API_FOUND)
target_compile_definitions(kvikio INTERFACE CUFILE_BATCH_API_FOUND)
endif()
endif()
target_link_libraries(kvikio INTERFACE ${CMAKE_DL_LIBS})
target_compile_features(kvikio INTERFACE cxx_std_17)
Expand Down

0 comments on commit 4d44f16

Please sign in to comment.