Skip to content

Commit

Permalink
KVIKIO_CUFILE_DUMMY_BATCH_TYPEDEFS
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Aug 28, 2023
1 parent c979aef commit f4f71ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ else()
set(cuFile_BATCH_AND_STREAM_API_FOUND TRUE)
endif()
message(STATUS "Found cuFile's Batch and Stream API: ${cuFile_BATCH_AND_STREAM_API_FOUND}")

# When the batch and stream API isn't found, we might need some dummy typedefs
string(FIND "${CUFILE_H_STR}" "CUfileOpcode" CUfileOpcode_location)
endif()

# library targets
Expand All @@ -90,6 +93,9 @@ if(cuFile_FOUND)
if(cuFile_BATCH_AND_STREAM_API_FOUND)
target_compile_definitions(kvikio INTERFACE KVIKIO_CUFILE_BATCH_AND_STREAM_API_FOUND)
endif()
if(CUfileOpcode_location EQUAL "-1")
target_compile_definitions(kvikio INTERFACE KVIKIO_CUFILE_DUMMY_BATCH_TYPEDEFS)
endif()
endif()
target_link_libraries(kvikio INTERFACE ${CMAKE_DL_LIBS})
target_compile_features(kvikio INTERFACE cxx_std_17)
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/kvikio/shim/cufile_h_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ using CUfileDriverControlFlags_t = enum CUfileDriverControlFlags {
using CUfileHandle_t = void*;
#endif

// If the Batch API isn't defined, we define some of the data types here.
// When the batch and stream API isn't found, we might need some dummy typedefs.
// Notice, this doesn't need to be ABI compatible with the cufile definitions.
#ifndef KVIKIO_CUFILE_BATCH_AND_STREAM_API_FOUND
#ifdef KVIKIO_CUFILE_DUMMY_BATCH_TYPEDEFS
typedef enum CUfileOpcode { CUFILE_READ = 0, CUFILE_WRITE } CUfileOpcode_t;

typedef enum CUFILEStatus_enum {
Expand Down

0 comments on commit f4f71ab

Please sign in to comment.