Skip to content

Commit

Permalink
Merge pull request #487 from rapidsai/branch-24.10
Browse files Browse the repository at this point in the history
Forward-merge branch-24.10 into branch-24.12
  • Loading branch information
GPUtester authored Oct 3, 2024
2 parents 4153097 + 5a733bd commit 473e537
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ if(KvikIO_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if(KvikIO_BUILD_TESTS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(CUDAToolkit_FOUND
AND KvikIO_BUILD_TESTS
AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME
)
include(cmake/thirdparty/get_gtest.cmake)

# include CTest module -- automatically calls enable_testing()
Expand Down
10 changes: 10 additions & 0 deletions cpp/include/kvikio/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
#include <tuple>
#include <type_traits>

#ifdef KVIKIO_CUDA_FOUND
#include <nvtx3/nvtx3.hpp>
#endif

#include <kvikio/error.hpp>
#include <kvikio/shim/cuda.hpp>
Expand Down Expand Up @@ -291,6 +293,7 @@ inline bool is_future_done(const T& future)
return future.wait_for(std::chrono::seconds(0)) != std::future_status::timeout;
}

#ifdef KVIKIO_CUDA_FOUND
/**
* @brief Tag type for libkvikio's NVTX domain.
*/
Expand All @@ -309,6 +312,7 @@ struct libkvikio_domain {
} \
}
#define GET_KVIKIO_NVTX_FUNC_RANGE_MACRO(_1, _2, NAME, ...) NAME
#endif

/**
* @brief Convenience macro for generating an NVTX range in the `libkvikio` domain
Expand All @@ -329,9 +333,15 @@ struct libkvikio_domain {
* }
* ```
*/
#ifdef KVIKIO_CUDA_FOUND
#define KVIKIO_NVTX_FUNC_RANGE(...) \
GET_KVIKIO_NVTX_FUNC_RANGE_MACRO( \
__VA_ARGS__, KVIKIO_NVTX_FUNC_RANGE_2, KVIKIO_NVTX_FUNC_RANGE_1) \
(__VA_ARGS__)
#else
#define KVIKIO_NVTX_FUNC_RANGE(...) \
do { \
} while (0)
#endif

} // namespace kvikio

0 comments on commit 473e537

Please sign in to comment.