9 #include <kvikio/shim/cufile.hpp>
10 #include <kvikio/shim/cufile_h_wrapper.hpp>
14 #ifdef KVIKIO_CUFILE_FOUND
16 class DriverInitializer {
21 DriverInitializer(DriverInitializer
const&) =
delete;
22 DriverInitializer& operator=(DriverInitializer
const&) =
delete;
23 DriverInitializer(DriverInitializer&&) noexcept = delete;
24 DriverInitializer& operator=(DriverInitializer&&) noexcept = delete;
26 ~DriverInitializer() noexcept;
29 class DriverProperties {
31 CUfileDrvProps_t _props{};
32 bool _initialized{
false};
39 DriverProperties() =
default;
41 bool is_gds_available();
43 [[nodiscard]]
unsigned int get_nvfs_major_version();
45 [[nodiscard]]
unsigned int get_nvfs_minor_version();
47 [[nodiscard]]
bool get_nvfs_allow_compat_mode();
49 [[nodiscard]]
bool get_nvfs_poll_mode();
51 [[nodiscard]] std::size_t get_nvfs_poll_thresh_size();
53 void set_nvfs_poll_mode(
bool enable);
55 void set_nvfs_poll_thresh_size(std::size_t size_in_kb);
57 [[nodiscard]] std::vector<CUfileDriverControlFlags> get_nvfs_statusflags();
59 [[nodiscard]] std::size_t get_max_device_cache_size();
61 void set_max_device_cache_size(std::size_t size_in_kb);
63 [[nodiscard]] std::size_t get_per_buffer_cache_size();
65 [[nodiscard]] std::size_t get_max_pinned_memory_size();
67 void set_max_pinned_memory_size(std::size_t size_in_kb);
69 [[nodiscard]] std::size_t get_max_batch_io_size();
82 static bool is_gds_available();
84 [[nodiscard]]
static unsigned int get_nvfs_major_version();
86 [[nodiscard]]
static unsigned int get_nvfs_minor_version();
88 [[nodiscard]]
static bool get_nvfs_allow_compat_mode();
90 [[nodiscard]]
static bool get_nvfs_poll_mode();
92 [[nodiscard]]
static std::size_t get_nvfs_poll_thresh_size();
94 static void set_nvfs_poll_mode(
bool enable);
96 static void set_nvfs_poll_thresh_size(std::size_t size_in_kb);
98 [[nodiscard]]
static std::vector<CUfileDriverControlFlags> get_nvfs_statusflags();
100 [[nodiscard]]
static std::size_t get_max_device_cache_size();
102 static void set_max_device_cache_size(std::size_t size_in_kb);
104 [[nodiscard]]
static std::size_t get_per_buffer_cache_size();
106 [[nodiscard]]
static std::size_t get_max_pinned_memory_size();
108 static void set_max_pinned_memory_size(std::size_t size_in_kb);
110 [[nodiscard]] std::size_t get_max_batch_io_size();