20 #include <kvikio/shim/cufile.hpp>
21 #include <kvikio/shim/cufile_h_wrapper.hpp>
25 #ifdef KVIKIO_CUFILE_FOUND
27 class DriverInitializer {
32 DriverInitializer(DriverInitializer
const&) =
delete;
33 DriverInitializer& operator=(DriverInitializer
const&) =
delete;
34 DriverInitializer(DriverInitializer&&) noexcept = delete;
35 DriverInitializer& operator=(DriverInitializer&&) noexcept = delete;
37 ~DriverInitializer() noexcept;
40 class DriverProperties {
42 CUfileDrvProps_t _props{};
43 bool _initialized{
false};
50 DriverProperties() =
default;
52 bool is_gds_available();
54 [[nodiscard]]
unsigned int get_nvfs_major_version();
56 [[nodiscard]]
unsigned int get_nvfs_minor_version();
58 [[nodiscard]]
bool get_nvfs_allow_compat_mode();
60 [[nodiscard]]
bool get_nvfs_poll_mode();
62 [[nodiscard]] std::size_t get_nvfs_poll_thresh_size();
64 void set_nvfs_poll_mode(
bool enable);
66 void set_nvfs_poll_thresh_size(std::size_t size_in_kb);
68 [[nodiscard]] std::vector<CUfileDriverControlFlags> get_nvfs_statusflags();
70 [[nodiscard]] std::size_t get_max_device_cache_size();
72 void set_max_device_cache_size(std::size_t size_in_kb);
74 [[nodiscard]] std::size_t get_per_buffer_cache_size();
76 [[nodiscard]] std::size_t get_max_pinned_memory_size();
78 void set_max_pinned_memory_size(std::size_t size_in_kb);
80 [[nodiscard]] std::size_t get_max_batch_io_size();
93 static bool is_gds_available();
95 [[nodiscard]]
static unsigned int get_nvfs_major_version();
97 [[nodiscard]]
static unsigned int get_nvfs_minor_version();
99 [[nodiscard]]
static bool get_nvfs_allow_compat_mode();
101 [[nodiscard]]
static bool get_nvfs_poll_mode();
103 [[nodiscard]]
static std::size_t get_nvfs_poll_thresh_size();
105 static void set_nvfs_poll_mode(
bool enable);
107 static void set_nvfs_poll_thresh_size(std::size_t size_in_kb);
109 [[nodiscard]]
static std::vector<CUfileDriverControlFlags> get_nvfs_statusflags();
111 [[nodiscard]]
static std::size_t get_max_device_cache_size();
113 static void set_max_device_cache_size(std::size_t size_in_kb);
115 [[nodiscard]]
static std::size_t get_per_buffer_cache_size();
117 [[nodiscard]]
static std::size_t get_max_pinned_memory_size();
119 static void set_max_pinned_memory_size(std::size_t size_in_kb);
121 [[nodiscard]] std::size_t get_max_batch_io_size();