Skip to content

Commit 5405ae4

Browse files
committed
Drop is_batch_api_available & is_stream_api_available
As of CUDA 12.2+, these functions are always true as the relevant APIs are always included. So go ahead drop them. Also equate their calls to `true` in relevant logic.
1 parent d6ec8e5 commit 5405ae4

File tree

4 files changed

+5
-34
lines changed

4 files changed

+5
-34
lines changed

cpp/examples/basic_io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ int main()
170170
cout << "Parallel POSIX read (" << kvikio::defaults::thread_pool_nthreads()
171171
<< " threads): " << read << endl;
172172
}
173-
if (kvikio::is_batch_api_available() && !kvikio::defaults::is_compat_mode_preferred()) {
173+
if (!kvikio::defaults::is_compat_mode_preferred()) {
174174
std::cout << std::endl;
175175
Timer timer;
176176
// Here we use the batch API to read "/tmp/test-file" into `b_dev` by

cpp/include/kvikio/shim/cufile.hpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,4 @@ bool is_cufile_available() noexcept;
110110
*/
111111
int cufile_version() noexcept;
112112

113-
/**
114-
* @brief Check if cuFile's batch API is available.
115-
*
116-
* Since `cuFileGetVersion()` first became available in cufile v1.8 (CTK v12.3),
117-
* this function returns false for versions older than v1.8 even though the batch
118-
* API became available in v1.6.
119-
*
120-
* @return The boolean answer
121-
*/
122-
bool is_batch_api_available() noexcept;
123-
124-
/**
125-
* @brief Check if cuFile's stream (async) API is available.
126-
*
127-
* Since `cuFileGetVersion()` first became available in cufile v1.8 (CTK v12.3),
128-
* this function returns false for versions older than v1.8 even though the stream
129-
* API became available in v1.7.
130-
*
131-
* @return The boolean answer
132-
*/
133-
bool is_stream_api_available() noexcept;
134-
135113
} // namespace kvikio

cpp/src/compat_mode_manager.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,19 @@ CompatModeManager::CompatModeManager(std::string const& file_path,
7474
}
7575

7676
// Check cuFile async API
77-
static bool const is_extra_symbol_available = is_stream_api_available();
78-
static bool const is_config_path_empty = config_path().empty();
77+
static bool const is_config_path_empty = config_path().empty();
7978
_is_compat_mode_preferred_for_async =
80-
_is_compat_mode_preferred || !is_extra_symbol_available || is_config_path_empty;
79+
_is_compat_mode_preferred || is_config_path_empty;
8180
}
8281

8382
void CompatModeManager::validate_compat_mode_for_async() const
8483
{
8584
KVIKIO_NVTX_FUNC_RANGE();
8685
if (_is_compat_mode_preferred_for_async && _compat_mode_requested == CompatMode::OFF) {
8786
std::string err_msg;
88-
if (!is_stream_api_available()) { err_msg += "Missing the cuFile stream api."; }
89-
90-
// When checking for availability, we also check if cuFile's config file exists. This is
87+
// When checking for availability, we check if cuFile's config file exists. This is
9188
// because even when the stream API is available, it doesn't work if no config file exists.
92-
if (config_path().empty()) { err_msg += " Missing cuFile configuration file."; }
89+
if (config_path().empty()) { err_msg += "Missing cuFile configuration file."; }
9390

9491
KVIKIO_FAIL(err_msg, std::runtime_error);
9592
}

cpp/src/shim/cufile.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,4 @@ int cufile_version() noexcept
111111
int cufile_version() noexcept { return 0; }
112112
#endif
113113

114-
bool is_batch_api_available() noexcept { return cufile_version() >= 1060; }
115-
116-
bool is_stream_api_available() noexcept { return cufile_version() >= 1070; }
117-
118114
} // namespace kvikio

0 commit comments

Comments
 (0)