Skip to content

Commit

Permalink
dummy CUFILE_CHECK_STREAM_IO
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Aug 28, 2023
1 parent 1c65524 commit 5358b35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 1 addition & 5 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ rapids_find_package(
INSTALL_EXPORT_SET kvikio-exports
)

rapids_find_package(
cuFile
BUILD_EXPORT_SET kvikio-exports
INSTALL_EXPORT_SET kvikio-exports
)
# rapids_find_package( cuFile BUILD_EXPORT_SET kvikio-exports INSTALL_EXPORT_SET kvikio-exports )
if(NOT cuFile_FOUND)
message(WARNING "Building KvikIO without cuFile")
else()
Expand Down
9 changes: 7 additions & 2 deletions cpp/include/kvikio/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ struct CUfileException : public std::runtime_error {
#endif
#endif

#ifdef KVIKIO_CUFILE_FOUND
#ifndef CUFILE_CHECK_STREAM_IO
#define CUFILE_CHECK_STREAM_IO(...) \
GET_CUFILE_CHECK_STREAM_IO_MACRO( \
__VA_ARGS__, CUFILE_CHECK_STREAM_IO_2, CUFILE_CHECK_STREAM_IO_1) \
(__VA_ARGS__)
#define GET_CUFILE_CHECK_STREAM_IO_MACRO(_1, _2, NAME, ...) NAME
#ifdef KVIKIO_CUFILE_FOUND
#define CUFILE_CHECK_STREAM_IO_2(_nbytes_done, _exception_type) \
do { \
int const _nbytes = (_nbytes_done); \
Expand All @@ -95,8 +95,13 @@ struct CUfileException : public std::runtime_error {
cufileop_status_error((CUfileOpError)(CUFILEOP_BASE_ERR - _nbytes))}; \
} \
} while (0)
#define CUFILE_CHECK_STREAM_IO_1(_call) CUFILE_CHECK_STREAM_IO_2(_call, kvikio::CUfileException)
#else
// if cufile isn't available, we don't do anything in the body
#define CUFILE_CHECK_STREAM_IO_2(_nbytes_done, _exception_type) \
do { \
} while (0)
#endif
#define CUFILE_CHECK_STREAM_IO_1(_call) CUFILE_CHECK_STREAM_IO_2(_call, kvikio::CUfileException)
#endif

} // namespace kvikio

0 comments on commit 5358b35

Please sign in to comment.