23 #include <kvikio/defaults.hpp>
24 #include <kvikio/error.hpp>
25 #include <kvikio/shim/cufile.hpp>
26 #include <kvikio/shim/cufile_h_wrapper.hpp>
27 #include <kvikio/utils.hpp>
47 inline void buffer_register(
const void* devPtr_base,
50 const std::vector<int>& errors_to_ignore = std::vector<int>())
53 #ifdef KVIKIO_CUFILE_FOUND
54 CUfileError_t status = cuFileAPI::instance().BufRegister(devPtr_base, size, flags);
55 if (status.err != CU_FILE_SUCCESS) {
57 if (std::find(errors_to_ignore.begin(), errors_to_ignore.end(), status.err) ==
58 errors_to_ignore.end()) {
70 inline void buffer_deregister(
const void* devPtr_base)
73 #ifdef KVIKIO_CUFILE_FOUND
74 CUFILE_TRY(cuFileAPI::instance().BufDeregister(devPtr_base));
92 inline void memory_register(
const void* devPtr,
94 const std::vector<int>& errors_to_ignore = {})
96 auto [base, nbytes, offset] = get_alloc_info(devPtr);
97 buffer_register(base, nbytes, flags, errors_to_ignore);
105 inline void memory_deregister(
const void* devPtr)
107 auto [base, nbytes, offset] = get_alloc_info(devPtr);
108 buffer_deregister(base);
static bool compat_mode()
Return whether the KvikIO library is running in compatibility mode or not.