From 6c2e972cefff05f6ffbba4fd9ba894e6849b041e Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Fri, 17 Nov 2023 13:29:23 -0800 Subject: [PATCH] Implement user_datasource_wrapper is_empty() and is_device_read_preferred(). (#14357) These two routines are missing from the current `user_datasource_wrapper` impl. Authors: - Trent Nelson (https://github.com/tpn) - Vukasin Milovanovic (https://github.com/vuule) Approvers: - Mike Wilson (https://github.com/hyperbolic2346) - Vukasin Milovanovic (https://github.com/vuule) URL: https://github.com/rapidsai/cudf/pull/14357 --- cpp/src/io/utilities/datasource.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/src/io/utilities/datasource.cpp b/cpp/src/io/utilities/datasource.cpp index 5cdd92ce3b7..a466ef84133 100644 --- a/cpp/src/io/utilities/datasource.cpp +++ b/cpp/src/io/utilities/datasource.cpp @@ -360,6 +360,11 @@ class user_datasource_wrapper : public datasource { return source->supports_device_read(); } + [[nodiscard]] bool is_device_read_preferred(size_t size) const override + { + return source->is_device_read_preferred(size); + } + size_t device_read(size_t offset, size_t size, uint8_t* dst, @@ -385,6 +390,8 @@ class user_datasource_wrapper : public datasource { [[nodiscard]] size_t size() const override { return source->size(); } + [[nodiscard]] bool is_empty() const override { return source->is_empty(); } + private: datasource* const source; ///< A non-owning pointer to the user-implemented datasource };