Skip to content

Commit

Permalink
Update for the batch
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcrimsontianyu committed Nov 14, 2024
1 parent 2519cc8 commit 353fcbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpp/include/kvikio/batch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class BatchHandle {
std::vector<CUfileIOParams_t> io_batch_params;
io_batch_params.reserve(operations.size());
for (const auto& op : operations) {
if (op.file_handle.is_compat_mode_on()) {
if (op.file_handle.is_compat_mode_always_on()) {
throw CUfileException("Cannot submit a FileHandle opened in compatibility mode");
}

Expand Down
8 changes: 6 additions & 2 deletions cpp/include/kvikio/file_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,15 @@ class FileHandle {
* @brief Returns `true` if the compatibility mode has been enabled for this file.
*
* Compatibility mode can be explicitly enabled in object creation. The mode is also enabled
* automatically, if file cannot be opened with the `O_DIRECT` flag.
* automatically, if file cannot be opened with the `O_DIRECT` flag, or if the system does not
* meet the requirements for the cuFile library under the `AUTO` compatibility mode.
*
* @return compatibility mode state for the object
*/
[[nodiscard]] bool is_compat_mode_on() const noexcept { return _compat_mode == CompatMode::ON; }
[[nodiscard]] bool is_compat_mode_always_on() const noexcept
{
return defaults::is_compat_mode_always_on(_compat_mode);
}
};

} // namespace kvikio

0 comments on commit 353fcbf

Please sign in to comment.