scalar.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2022, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <cudf/column/column.hpp>
19 #include <cudf/table/table.hpp>
20 #include <cudf/types.hpp>
21 #include <cudf/utilities/default_stream.hpp>
23 
24 #include <rmm/cuda_stream_view.hpp>
25 #include <rmm/device_buffer.hpp>
26 #include <rmm/device_scalar.hpp>
28 
34 namespace cudf {
48 class scalar {
49  public:
50  virtual ~scalar() = default;
51  scalar& operator=(scalar const& other) = delete;
52  scalar& operator=(scalar&& other) = delete;
53 
59  [[nodiscard]] data_type type() const noexcept;
60 
67  void set_valid_async(bool is_valid, rmm::cuda_stream_view stream = cudf::default_stream_value);
68 
79  [[nodiscard]] bool is_valid(rmm::cuda_stream_view stream = cudf::default_stream_value) const;
80 
86  bool* validity_data();
87 
93  [[nodiscard]] bool const* validity_data() const;
94 
95  protected:
96  data_type _type{type_id::EMPTY};
98 
99  scalar() = delete;
100 
105  scalar(scalar&& other) = default;
106 
114  scalar(scalar const& other,
115  rmm::cuda_stream_view stream = cudf::default_stream_value,
116  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
117 
130  bool is_valid = false,
131  rmm::cuda_stream_view stream = cudf::default_stream_value,
132  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
133 };
134 
135 namespace detail {
141 template <typename T>
142 class fixed_width_scalar : public scalar {
143  static_assert(is_fixed_width<T>(), "Unexpected non-fixed-width type.");
144 
145  public:
146  using value_type = T;
147 
148  ~fixed_width_scalar() override = default;
149 
155 
156  fixed_width_scalar& operator=(fixed_width_scalar const& other) = delete;
157  fixed_width_scalar& operator=(fixed_width_scalar&& other) = delete;
158 
167  rmm::cuda_stream_view stream = cudf::default_stream_value,
168  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
169 
176  void set_value(T value, rmm::cuda_stream_view stream = cudf::default_stream_value);
177 
181  explicit operator value_type() const;
182 
189  T value(rmm::cuda_stream_view stream = cudf::default_stream_value) const;
190 
195  T* data();
196 
201  T const* data() const;
202 
203  protected:
205 
206  fixed_width_scalar() = delete;
207 
217  bool is_valid = true,
218  rmm::cuda_stream_view stream = cudf::default_stream_value,
219  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
220 
230  bool is_valid = true,
231  rmm::cuda_stream_view stream = cudf::default_stream_value,
232  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
233 };
234 
235 } // namespace detail
236 
242 template <typename T>
244  static_assert(is_numeric<T>(), "Unexpected non-numeric type.");
245 
246  public:
247  numeric_scalar() = delete;
248  ~numeric_scalar() = default;
249 
254  numeric_scalar(numeric_scalar&& other) = default;
255 
256  numeric_scalar& operator=(numeric_scalar const& other) = delete;
257  numeric_scalar& operator=(numeric_scalar&& other) = delete;
258 
267  rmm::cuda_stream_view stream = cudf::default_stream_value,
268  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
269 
279  bool is_valid = true,
280  rmm::cuda_stream_view stream = cudf::default_stream_value,
281  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
282 
292  bool is_valid = true,
293  rmm::cuda_stream_view stream = cudf::default_stream_value,
294  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
295 };
296 
302 template <typename T>
303 class fixed_point_scalar : public scalar {
304  static_assert(is_fixed_point<T>(), "Unexpected non-fixed_point type.");
305 
306  public:
307  using rep_type = typename T::rep;
308  using value_type = T;
309 
310  fixed_point_scalar() = delete;
311  ~fixed_point_scalar() override = default;
312 
318 
319  fixed_point_scalar& operator=(fixed_point_scalar const& other) = delete;
320  fixed_point_scalar& operator=(fixed_point_scalar&& other) = delete;
321 
330  rmm::cuda_stream_view stream = cudf::default_stream_value,
331  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
332 
343  numeric::scale_type scale,
344  bool is_valid = true,
345  rmm::cuda_stream_view stream = cudf::default_stream_value,
346  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
347 
357  bool is_valid = true,
358  rmm::cuda_stream_view stream = cudf::default_stream_value,
359  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
360 
370  bool is_valid = true,
371  rmm::cuda_stream_view stream = cudf::default_stream_value,
372  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
373 
384  numeric::scale_type scale,
385  bool is_valid = true,
386  rmm::cuda_stream_view stream = cudf::default_stream_value,
387  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
388 
395  rep_type value(rmm::cuda_stream_view stream = cudf::default_stream_value) const;
396 
403  T fixed_point_value(rmm::cuda_stream_view stream = cudf::default_stream_value) const;
404 
408  explicit operator value_type() const;
409 
415 
420  rep_type const* data() const;
421 
422  protected:
424 };
425 
429 class string_scalar : public scalar {
430  public:
432 
433  string_scalar() = delete;
434  ~string_scalar() override = default;
435 
440  string_scalar(string_scalar&& other) = default;
441 
442  // string_scalar(string_scalar const& other) = delete;
443  string_scalar& operator=(string_scalar const& other) = delete;
444  string_scalar& operator=(string_scalar&& other) = delete;
445 
454  rmm::cuda_stream_view stream = cudf::default_stream_value,
455  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
456 
465  string_scalar(std::string const& string,
466  bool is_valid = true,
467  rmm::cuda_stream_view stream = cudf::default_stream_value,
468  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
469 
480  string_scalar(value_type const& source,
481  bool is_valid = true,
482  rmm::cuda_stream_view stream = cudf::default_stream_value,
483  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
484 
496  bool is_valid = true,
497  rmm::cuda_stream_view stream = cudf::default_stream_value,
498  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
499 
512  bool is_valid = true,
513  rmm::cuda_stream_view stream = cudf::default_stream_value,
514  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
515 
519  explicit operator std::string() const;
520 
527  [[nodiscard]] std::string to_string(
528  rmm::cuda_stream_view stream = cudf::default_stream_value) const;
529 
536  [[nodiscard]] value_type value(rmm::cuda_stream_view stream = cudf::default_stream_value) const;
537 
542  [[nodiscard]] size_type size() const;
543 
548  [[nodiscard]] const char* data() const;
549 
550  protected:
552 };
553 
560 template <typename T>
562  static_assert(is_chrono<T>(), "Unexpected non-chrono type");
563 
564  public:
565  chrono_scalar() = delete;
566  ~chrono_scalar() = default;
567 
572  chrono_scalar(chrono_scalar&& other) = default;
573 
574  chrono_scalar& operator=(chrono_scalar const& other) = delete;
575  chrono_scalar& operator=(chrono_scalar&& other) = delete;
576 
585  rmm::cuda_stream_view stream = cudf::default_stream_value,
586  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
587 
597  bool is_valid = true,
598  rmm::cuda_stream_view stream = cudf::default_stream_value,
599  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
600 
610  bool is_valid = true,
611  rmm::cuda_stream_view stream = cudf::default_stream_value,
612  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
613 };
614 
621 template <typename T>
622 class timestamp_scalar : public chrono_scalar<T> {
623  public:
624  static_assert(is_timestamp<T>(), "Unexpected non-timestamp type");
626  using rep_type = typename T::rep;
627 
628  timestamp_scalar() = delete;
629 
634  timestamp_scalar(timestamp_scalar&& other) = default;
635 
644  rmm::cuda_stream_view stream = cudf::default_stream_value,
645  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
646 
657  template <typename Duration2>
658  timestamp_scalar(Duration2 const& value,
659  bool is_valid,
660  rmm::cuda_stream_view stream = cudf::default_stream_value,
661  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
662 
668 };
669 
676 template <typename T>
677 class duration_scalar : public chrono_scalar<T> {
678  public:
679  static_assert(is_duration<T>(), "Unexpected non-duration type");
681  using rep_type = typename T::rep;
682 
683  duration_scalar() = delete;
684 
689  duration_scalar(duration_scalar&& other) = default;
690 
699  rmm::cuda_stream_view stream = cudf::default_stream_value,
700  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
701 
711  bool is_valid,
712  rmm::cuda_stream_view stream = cudf::default_stream_value,
713  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
714 
720 };
721 
725 class list_scalar : public scalar {
726  public:
727  list_scalar() = delete;
728  ~list_scalar() override = default;
729 
734  list_scalar(list_scalar&& other) = default;
735 
736  list_scalar& operator=(list_scalar const& other) = delete;
737  list_scalar& operator=(list_scalar&& other) = delete;
738 
746  list_scalar(list_scalar const& other,
747  rmm::cuda_stream_view stream = cudf::default_stream_value,
748  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
749 
761  bool is_valid = true,
762  rmm::cuda_stream_view stream = cudf::default_stream_value,
763  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
764 
774  bool is_valid = true,
775  rmm::cuda_stream_view stream = cudf::default_stream_value,
776  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
777 
782  [[nodiscard]] column_view view() const;
783 
784  private:
785  cudf::column _data;
786 };
787 
791 class struct_scalar : public scalar {
792  public:
793  struct_scalar() = delete;
794  ~struct_scalar() override = default;
795 
800  struct_scalar(struct_scalar&& other) = default;
801  struct_scalar& operator=(struct_scalar const& other) = delete;
802  struct_scalar& operator=(struct_scalar&& other) = delete;
803 
812  rmm::cuda_stream_view stream = cudf::default_stream_value,
813  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
814 
826  bool is_valid = true,
827  rmm::cuda_stream_view stream = cudf::default_stream_value,
828  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
829 
841  bool is_valid = true,
842  rmm::cuda_stream_view stream = cudf::default_stream_value,
843  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
844 
857  bool is_valid = true,
858  rmm::cuda_stream_view stream = cudf::default_stream_value,
859  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
860 
865  [[nodiscard]] table_view view() const;
866 
867  private:
868  table _data;
869 
871  void superimpose_nulls(rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr);
872 };
873  // end of group
875 } // namespace cudf
cudf::duration_scalar::duration_scalar
duration_scalar(duration_scalar &&other)=default
Move constructor for duration_scalar.
cudf::detail::fixed_width_scalar::fixed_width_scalar
fixed_width_scalar(rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed width scalar object from existing device memory.
per_device_resource.hpp
cudf::detail::fixed_width_scalar::value_type
T value_type
Type of the value held by the scalar.
Definition: scalar.hpp:146
cudf::column
A container of nullable device data as a column of elements.
Definition: column.hpp:48
cudf::fixed_point_scalar::fixed_point_scalar
fixed_point_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed_point scalar object from a fixed_point number.
cudf::numeric_scalar::numeric_scalar
numeric_scalar(numeric_scalar &&other)=default
Move constructor for numeric_scalar.
cudf::list_scalar::list_scalar
list_scalar(cudf::column &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new list scalar object from existing column.
cudf::timestamp_scalar
An owning class to represent a timestamp value in device memory.
Definition: scalar.hpp:622
cudf::scalar::validity_data
bool * validity_data()
Returns a raw pointer to the validity bool in device memory.
cudf::timestamp_scalar::timestamp_scalar
timestamp_scalar(timestamp_scalar &&other)=default
Move constructor for timestamp_scalar.
cudf::struct_scalar::struct_scalar
struct_scalar(struct_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new struct scalar object by deep copying another.
cudf::detail::fixed_width_scalar::value
T value(rmm::cuda_stream_view stream=cudf::default_stream_value) const
Get the value of the scalar.
cudf::duration_scalar::rep_type
typename T::rep rep_type
The duration's underlying representation type.
Definition: scalar.hpp:681
cudf::detail::fixed_width_scalar::data
T const * data() const
Returns a const raw pointer to the value in device memory.
cudf::fixed_point_scalar::fixed_point_scalar
fixed_point_scalar(rep_type value, numeric::scale_type scale, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed_point scalar object from already shifted value and scale.
cudf::detail::fixed_width_scalar::fixed_width_scalar
fixed_width_scalar(fixed_width_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed-width scalar object by deep copying another.
cudf::numeric_scalar::numeric_scalar
numeric_scalar(numeric_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new numeric scalar object by deep copying another.
cudf::size_type
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:80
column.hpp
Class definition for cudf::column.
cudf::fixed_point_scalar::value_type
T value_type
The value type of the fixed_point number.
Definition: scalar.hpp:308
cudf::scalar::_is_valid
rmm::device_scalar< bool > _is_valid
Device bool signifying validity.
Definition: scalar.hpp:97
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:322
cudf::fixed_point_scalar::fixed_point_scalar
fixed_point_scalar(fixed_point_scalar &&other)=default
Move constructor for fixed_point_scalar.
cudf::scalar::_type
data_type _type
Logical type of value in the scalar.
Definition: scalar.hpp:96
cudf::host_span
C++20 std::span with reduced feature set.
Definition: span.hpp:214
types.hpp
Type declarations for libcudf.
cudf::string_scalar::string_scalar
string_scalar(rmm::device_buffer &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new string scalar object by moving an existing string data buffer.
rmm
cudf::fixed_point_scalar::fixed_point_value
T fixed_point_value(rmm::cuda_stream_view stream=cudf::default_stream_value) const
Get the decimal32, decimal64 or decimal128.
cudf::fixed_point_scalar::fixed_point_scalar
fixed_point_scalar(rmm::device_scalar< rep_type > &&data, numeric::scale_type scale, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed_point scalar object from existing device memory.
cudf::string_view
A non-owning, immutable view of device data that is a variable length char array representing a UTF-8...
Definition: string_view.hpp:42
cudf::timestamp_scalar::rep_type
typename T::rep rep_type
The underlying representation type of the timestamp.
Definition: scalar.hpp:626
rmm::cuda_stream_view
cudf::numeric_scalar::numeric_scalar
numeric_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new numeric scalar object.
cudf::numeric_scalar::numeric_scalar
numeric_scalar(rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new numeric scalar object from existing device memory.
cudf::scalar::scalar
scalar(data_type type, bool is_valid=false, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new scalar object.
cudf::struct_scalar
An owning class to represent a struct value in device memory.
Definition: scalar.hpp:791
cudf::struct_scalar::struct_scalar
struct_scalar(host_span< column_view const > data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new struct scalar object from a host_span of column_views.
cudf::table
A set of cudf::column's of the same size.
Definition: table.hpp:40
cudf::fixed_point_scalar::value
rep_type value(rmm::cuda_stream_view stream=cudf::default_stream_value) const
Get the value of the scalar.
cudf::string_scalar::string_scalar
string_scalar(value_type const &source, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new string scalar object from string_view.
cudf::scalar::is_valid
bool is_valid(rmm::cuda_stream_view stream=cudf::default_stream_value) const
Indicates whether the scalar contains a valid value.
cudf::fixed_point_scalar::data
rep_type * data()
Returns a raw pointer to the value in device memory.
cudf::duration_scalar::count
rep_type count()
Returns the duration in number of ticks.
cudf::fixed_point_scalar::_data
rmm::device_scalar< rep_type > _data
device memory containing the value
Definition: scalar.hpp:423
cudf::string_scalar::string_scalar
string_scalar(std::string const &string, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new string scalar object.
cudf::timestamp_scalar::timestamp_scalar
timestamp_scalar(timestamp_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new timestamp scalar object by deep copying another.
cudf::list_scalar::list_scalar
list_scalar(cudf::column_view const &data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new list scalar object from column_view.
cudf::fixed_point_scalar::data
rep_type const * data() const
Returns a const raw pointer to the value in device memory.
cudf::string_scalar::string_scalar
string_scalar(rmm::device_scalar< value_type > &data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new string scalar object from string_view in device memory.
cudf::duration_scalar::duration_scalar
duration_scalar(rep_type value, bool is_valid, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new duration scalar object from tick counts.
cudf::duration_scalar
An owning class to represent a duration value in device memory.
Definition: scalar.hpp:677
rmm::device_buffer
device_buffer.hpp
cudf::struct_scalar::struct_scalar
struct_scalar(table &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new struct scalar object from an existing table in device memory.
cudf::struct_scalar::struct_scalar
struct_scalar(table_view const &data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new struct scalar object from table_view.
cudf::scalar
An owning class to represent a singular value.
Definition: scalar.hpp:48
cudf::string_scalar::data
const char * data() const
Returns a raw pointer to the string in device memory.
cudf::numeric_scalar
An owning class to represent a numerical value in device memory.
Definition: scalar.hpp:243
cudf::table_view
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:187
cudf::detail::fixed_width_scalar::fixed_width_scalar
fixed_width_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed width scalar object.
cudf::detail::fixed_width_scalar
An owning class to represent a fixed-width type value in device memory.
Definition: scalar.hpp:142
cudf::string_scalar::value
value_type value(rmm::cuda_stream_view stream=cudf::default_stream_value) const
Get the value of the scalar as a string_view.
cudf::data_type
Indicator for the logical data type of an element in a column.
Definition: types.hpp:236
cudf::detail::fixed_width_scalar::_data
rmm::device_scalar< T > _data
device memory containing the value
Definition: scalar.hpp:204
cudf::fixed_point_scalar
An owning class to represent a fixed_point number in device memory.
Definition: scalar.hpp:303
cudf::chrono_scalar
An owning class to represent a timestamp/duration value in device memory.
Definition: scalar.hpp:561
cudf::timestamp_scalar::ticks_since_epoch
rep_type ticks_since_epoch()
Returns the duration in number of ticks since the UNIX epoch.
cudf::detail::fixed_width_scalar::data
T * data()
Returns a raw pointer to the value in device memory.
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::string_scalar::size
size_type size() const
Returns the size of the string in bytes.
cudf::list_scalar
An owning class to represent a list value in device memory.
Definition: scalar.hpp:725
rmm::device_scalar< bool >
cudf::string_scalar::string_scalar
string_scalar(string_scalar &&other)=default
Move constructor for string_scalar.
cudf::struct_scalar::view
table_view view() const
Returns a non-owning, immutable view to underlying device data.
cudf::fixed_point_scalar::fixed_point_scalar
fixed_point_scalar(rep_type value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed_point scalar object from a value and default 0-scale.
table.hpp
Class definition for cudf::table.
cudf::string_scalar
An owning class to represent a string in device memory.
Definition: scalar.hpp:429
cudf::scalar::scalar
scalar(scalar &&other)=default
Move constructor for scalar.
cudf::detail::fixed_width_scalar::fixed_width_scalar
fixed_width_scalar(fixed_width_scalar &&other)=default
Move constructor for fixed_width_scalar.
cudf::list_scalar::list_scalar
list_scalar(list_scalar &&other)=default
Move constructor for list_scalar.
cudf::chrono_scalar::chrono_scalar
chrono_scalar(chrono_scalar &&other)=default
Move constructor for chrono_scalar.
cudf::string_scalar::string_scalar
string_scalar(string_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new string scalar object by deep copying another string_scalar.
cudf::list_scalar::view
column_view view() const
Returns a non-owning, immutable view to underlying device data.
cudf::chrono_scalar::chrono_scalar
chrono_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new chrono scalar object.
cudf::fixed_point_scalar::rep_type
typename T::rep rep_type
The representation type of the fixed_point number.
Definition: scalar.hpp:307
cudf::scalar::type
data_type type() const noexcept
Returns the scalar's logical value type.
rmm::mr::device_memory_resource
cudf::duration_scalar::duration_scalar
duration_scalar(duration_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new duration scalar object by deep copying another.
traits.hpp
cudf::fixed_point_scalar::fixed_point_scalar
fixed_point_scalar(fixed_point_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new fixed_point scalar object by deep copying another.
cudf::chrono_scalar::chrono_scalar
chrono_scalar(chrono_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new chrono scalar object by deep copying another.
cudf::scalar::scalar
scalar(scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new scalar object by deep copying another.
cudf::string_scalar::to_string
std::string to_string(rmm::cuda_stream_view stream=cudf::default_stream_value) const
Get the value of the scalar in a host std::string.
cudf::timestamp_scalar::timestamp_scalar
timestamp_scalar(Duration2 const &value, bool is_valid, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new timestamp scalar object from a duration that is convertible to T::duration.
cudf::scalar::set_valid_async
void set_valid_async(bool is_valid, rmm::cuda_stream_view stream=cudf::default_stream_value)
Updates the validity of the value.
cudf::chrono_scalar::chrono_scalar
chrono_scalar(rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new chrono scalar object from existing device memory.
cudf::struct_scalar::struct_scalar
struct_scalar(struct_scalar &&other)=default
Move constructor for struct_scalar.
numeric::scale_type
scale_type
The scale type for fixed_point.
Definition: fixed_point.hpp:38
cudf::list_scalar::list_scalar
list_scalar(list_scalar const &other, rmm::cuda_stream_view stream=cudf::default_stream_value, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Construct a new list scalar object by deep copying another.
cudf::string_scalar::_data
rmm::device_buffer _data
device memory containing the string
Definition: scalar.hpp:551
cudf::detail::fixed_width_scalar::set_value
void set_value(T value, rmm::cuda_stream_view stream=cudf::default_stream_value)
Set the value of the scalar.