-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor: replace rmm::device_scalar with cudf::detail::device_scalar #23618
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
Changes from all commits
db3ba19
307032e
548fbcd
8f9d680
4f6a01e
c3e0bb4
b648813
b3a1e4f
fb9e1f4
4d9c4c2
d3bee4d
022defa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,7 +213,7 @@ class fixed_width_scalar : public scalar { | |
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| fixed_width_scalar(rmm::device_scalar<T>&& data, | ||
| fixed_width_scalar(cudf::detail::device_scalar<T>&& data, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This certainly gives me some pause. We have essentially turned this constructor from public to internal since it requires an internal class to call it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At first I agreed with you but after further analysis, it seems like Only classes like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to keep using our device_scalar for internal functions/methods/constructors while using |
||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
@@ -267,18 +267,37 @@ class numeric_scalar : public detail::fixed_width_scalar<T> { | |
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new numeric scalar object from another scalar. | ||
| * | ||
| * The input scalar's type must exactly match this scalar's type. | ||
| * | ||
| * @throws cudf::data_type_error if the input scalar type does not match. | ||
| * | ||
| * @param data The scalar to copy. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| explicit numeric_scalar( | ||
| scalar const& data, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new numeric scalar object from existing device memory. | ||
| * | ||
| * @deprecated Use the cudf::scalar constructor instead. | ||
| * | ||
| * @param data The scalar's data in device memory. | ||
| * @param is_valid Whether the value held by the scalar is valid. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| numeric_scalar(rmm::device_scalar<T>&& data, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
| [[deprecated("Use the cudf::scalar constructor instead.")]] numeric_scalar( | ||
| rmm::device_scalar<T>&& data, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -358,20 +377,40 @@ class fixed_point_scalar : public scalar { | |
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new fixed_point scalar object from another scalar. | ||
| * | ||
| * The input scalar's type ID must match this scalar's type. The input scalar's scale is | ||
| * preserved. | ||
| * | ||
| * @throws cudf::data_type_error if the input scalar type ID does not match. | ||
| * | ||
| * @param data The scalar to copy. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| explicit fixed_point_scalar( | ||
| scalar const& data, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new fixed_point scalar object from existing device memory. | ||
| * | ||
| * @deprecated Use the cudf::scalar constructor instead. | ||
| * | ||
| * @param data The scalar's data in device memory. | ||
| * @param scale The scale of the fixed_point scalar. | ||
| * @param is_valid Whether the value held by the scalar is valid. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| fixed_point_scalar(rmm::device_scalar<rep_type>&& data, | ||
| numeric::scale_type scale, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
| [[deprecated("Use the cudf::scalar constructor instead.")]] fixed_point_scalar( | ||
| rmm::device_scalar<rep_type>&& data, | ||
| numeric::scale_type scale, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Get the value of the scalar. | ||
|
|
@@ -466,20 +505,39 @@ class string_scalar : public scalar { | |
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new string scalar object from another scalar. | ||
| * | ||
| * The input scalar's type must be STRING. | ||
| * | ||
| * @throws cudf::data_type_error if the input scalar type is not STRING. | ||
| * | ||
| * @param data The scalar to copy. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| explicit string_scalar( | ||
| scalar const& data, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new string scalar object from string_view in device memory. | ||
| * | ||
| * Note that this function copies the data pointed by string_view. | ||
| * | ||
| * @deprecated Use the cudf::scalar constructor instead. | ||
| * | ||
| * @param data The device_scalar of string_view pointing to the string value to copy. | ||
| * @param is_valid Whether the value held by the scalar is valid. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| string_scalar(rmm::device_scalar<value_type>& data, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
| [[deprecated("Use the cudf::scalar constructor instead.")]] string_scalar( | ||
| rmm::device_scalar<value_type>& data, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new string scalar object by moving an existing string data buffer. | ||
|
|
@@ -576,18 +634,37 @@ class chrono_scalar : public detail::fixed_width_scalar<T> { | |
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new chrono scalar object from another scalar. | ||
| * | ||
| * The input scalar's type must exactly match this scalar's type. | ||
| * | ||
| * @throws cudf::data_type_error if the input scalar type does not match. | ||
| * | ||
| * @param data The scalar to copy. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| explicit chrono_scalar( | ||
| scalar const& data, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new chrono scalar object from existing device memory. | ||
| * | ||
| * @deprecated Use the cudf::scalar constructor instead. | ||
| * | ||
| * @param data The scalar's data in device memory. | ||
| * @param is_valid Whether the value held by the scalar is valid. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| chrono_scalar(rmm::device_scalar<T>&& data, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
| [[deprecated("Use the cudf::scalar constructor instead.")]] chrono_scalar( | ||
| rmm::device_scalar<T>&& data, | ||
| bool is_valid = true, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -622,6 +699,25 @@ class timestamp_scalar : public chrono_scalar<T> { | |
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new timestamp scalar object from another scalar. | ||
| * | ||
| * The input scalar's type must exactly match this scalar's type. | ||
| * | ||
| * @throws cudf::data_type_error if the input scalar type does not match. | ||
| * | ||
| * @param data The scalar to copy. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| explicit timestamp_scalar( | ||
| scalar const& data, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) | ||
| : chrono_scalar<T>(data, stream, mr) | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * @brief Construct a new timestamp scalar object from a duration that is | ||
| * convertible to T::duration | ||
|
|
@@ -678,6 +774,25 @@ class duration_scalar : public chrono_scalar<T> { | |
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()); | ||
|
|
||
| /** | ||
| * @brief Construct a new duration scalar object from another scalar. | ||
| * | ||
| * The input scalar's type must exactly match this scalar's type. | ||
| * | ||
| * @throws cudf::data_type_error if the input scalar type does not match. | ||
| * | ||
| * @param data The scalar to copy. | ||
| * @param stream CUDA stream used for device memory operations. | ||
| * @param mr Device memory resource to use for device memory allocation. | ||
| */ | ||
| explicit duration_scalar( | ||
| scalar const& data, | ||
| cuda::stream_ref stream = cudf::get_default_stream(), | ||
| rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref()) | ||
| : chrono_scalar<T>(data, stream, mr) | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * @brief Construct a new duration scalar object from tick counts. | ||
| * | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.