Skip to content

Commit

Permalink
Futher tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcrimsontianyu committed Nov 15, 2024
1 parent 1852545 commit 0725d63
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpp/include/kvikio/defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class defaults {
static auto inferred_compat_mode_for_auto = []() -> CompatMode {
return is_cufile_available() ? CompatMode::OFF : CompatMode::ON;
}();
compat_mode = inferred_compat_mode_for_auto;
return inferred_compat_mode_for_auto;
}
return compat_mode;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/kvikio/file_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class FileHandle {
* @brief Get the underlying cuFile file handle
*
* The file handle must be open and not in compatibility mode i.e.
* both `.closed()` and `defaults::can_compat_mode_reduce_to_on()` must be return false.
* both `.closed()` and `defaults::can_compat_mode_reduce_to_on()` must be false.
*
* @return cuFile's file handle
*/
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/test_defaults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TEST(Defaults, parse_compat_mode_str)
}

{
std::vector<std::string> inputs{"AUTO", "auto", "aUtO"};
std::vector<std::string> inputs{"AUTO", "auto", "aUtO", "WHATEVER", "whatever", "WhatEver"};
for (const auto& input : inputs) {
EXPECT_EQ(kvikio::detail::parse_compat_mode_str(input), kvikio::CompatMode::AUTO);
}
Expand Down
2 changes: 2 additions & 0 deletions python/kvikio/tests/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def test_compat_mode():
assert kvikio.defaults.compat_mode() == kvikio.CompatMode.ON
kvikio.defaults.compat_mode_reset(kvikio.CompatMode.OFF)
assert kvikio.defaults.compat_mode() == kvikio.CompatMode.OFF
kvikio.defaults.compat_mode_reset(kvikio.CompatMode.AUTO)
assert kvikio.defaults.compat_mode() == kvikio.CompatMode.AUTO
assert before == kvikio.defaults.compat_mode()


Expand Down

0 comments on commit 0725d63

Please sign in to comment.