Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always prefer device_reads and device_writes when kvikIO is enabled #17260

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cpp/src/io/utilities/data_sink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ class file_sink : public data_sink {

[[nodiscard]] bool is_device_write_preferred(size_t size) const override
{
if (size < _gds_write_preferred_threshold) { return false; }
return supports_device_write();
if (!supports_device_write()) { return false; }

// Always prefer device writes if kvikio is enabled
if (!_kvikio_file.closed()) { return true; }

return size >= _gds_write_preferred_threshold;
}

std::future<void> device_write_async(void const* gpu_data,
Expand Down
8 changes: 6 additions & 2 deletions cpp/src/io/utilities/datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ class file_source : public datasource {

[[nodiscard]] bool is_device_read_preferred(size_t size) const override
{
if (size < _gds_read_preferred_threshold) { return false; }
return supports_device_read();
if (!supports_device_read()) { return false; }

// Always prefer device reads if kvikio is enabled
if (!_kvikio_file.closed()) { return true; }

return size >= _gds_read_preferred_threshold;
}

std::future<size_t> device_read_async(size_t offset,
Expand Down
Loading