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
Changes from 2 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/datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,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