3333#include < rmm/cuda_stream_view.hpp>
3434
3535#include < cuda/std/optional>
36+ #include < cuda/std/type_traits>
3637#include < thrust/iterator/counting_iterator.h>
3738#include < thrust/iterator/transform_iterator.h>
3839#include < thrust/pair.h>
3940
4041#include < algorithm>
42+ #include < type_traits>
4143
4244/* *
4345 * @file column_device_view.cuh
@@ -56,8 +58,8 @@ namespace CUDF_EXPORT cudf {
5658 *
5759 */
5860struct nullate {
59- struct YES : std::bool_constant<true > {};
60- struct NO : std::bool_constant<false > {};
61+ struct YES : cuda:: std::bool_constant<true > {};
62+ struct NO : cuda:: std::bool_constant<false > {};
6163 /* *
6264 * @brief `nullate::DYNAMIC` defers the determination of nullability to run time rather than
6365 * compile time. The calling code is responsible for specifying whether or not nulls are
@@ -80,7 +82,7 @@ struct nullate {
8082 * @return `true` if nulls are expected in the operation in which this object is applied,
8183 * otherwise false
8284 */
83- constexpr operator bool () const noexcept { return value; }
85+ CUDF_HOST_DEVICE constexpr operator bool () const noexcept { return value; }
8486 bool value; // /< True if nulls are expected
8587 };
8688};
@@ -319,14 +321,14 @@ class alignas(16) column_device_view_base {
319321 }
320322
321323 template <typename C, typename T, typename = void >
322- struct has_element_accessor_impl : std::false_type {};
324+ struct has_element_accessor_impl : cuda:: std::false_type {};
323325
324326 template <typename C, typename T>
325327 struct has_element_accessor_impl <
326328 C,
327329 T,
328- void_t <decltype (std::declval<C>().template element<T>(std::declval<size_type>()))>>
329- : std::true_type {};
330+ void_t <decltype (cuda:: std::declval<C>().template element<T>(cuda:: std::declval<size_type>()))>>
331+ : cuda:: std::true_type {};
330332};
331333// @cond
332334// Forward declaration
@@ -442,7 +444,7 @@ class alignas(16) column_device_view : public detail::column_device_view_base {
442444 * @return string_view instance representing this element at this index
443445 */
444446 template <typename T, CUDF_ENABLE_IF (std::is_same_v<T, string_view>)>
445- __device__ [[nodiscard]] T element (size_type element_index) const noexcept
447+ [[nodiscard]] __device__ T element (size_type element_index) const noexcept
446448 {
447449 size_type index = element_index + offset (); // account for this view's _offset
448450 char const * d_strings = static_cast <char const *>(_data);
@@ -501,7 +503,7 @@ class alignas(16) column_device_view : public detail::column_device_view_base {
501503 * @return dictionary32 instance representing this element at this index
502504 */
503505 template <typename T, CUDF_ENABLE_IF (std::is_same_v<T, dictionary32>)>
504- __device__ [[nodiscard]] T element (size_type element_index) const noexcept
506+ [[nodiscard]] __device__ T element (size_type element_index) const noexcept
505507 {
506508 size_type index = element_index + offset (); // account for this view's _offset
507509 auto const indices = d_children[0 ];
@@ -519,7 +521,7 @@ class alignas(16) column_device_view : public detail::column_device_view_base {
519521 * @return numeric::fixed_point representing the element at this index
520522 */
521523 template <typename T, CUDF_ENABLE_IF (cudf::is_fixed_point<T>())>
522- __device__ [[nodiscard]] T element (size_type element_index) const noexcept
524+ [[nodiscard]] __device__ T element (size_type element_index) const noexcept
523525 {
524526 using namespace numeric ;
525527 using rep = typename T::rep;
@@ -534,7 +536,7 @@ class alignas(16) column_device_view : public detail::column_device_view_base {
534536 * @return `true` if `column_device_view::element<T>()` has a valid overload, `false` otherwise
535537 */
536538 template <typename T>
537- static constexpr bool has_element_accessor ()
539+ CUDF_HOST_DEVICE static constexpr bool has_element_accessor ()
538540 {
539541 return has_element_accessor_impl<column_device_view, T>::value;
540542 }
@@ -1032,7 +1034,7 @@ class alignas(16) mutable_column_device_view : public detail::column_device_view
10321034 * @return Reference to the element at the specified index
10331035 */
10341036 template <typename T, CUDF_ENABLE_IF (is_rep_layout_compatible<T>())>
1035- __device__ [[nodiscard]] T& element (size_type element_index) const noexcept
1037+ [[nodiscard]] __device__ T& element (size_type element_index) const noexcept
10361038 {
10371039 return data<T>()[element_index];
10381040 }
@@ -1044,7 +1046,7 @@ class alignas(16) mutable_column_device_view : public detail::column_device_view
10441046 * @return `true` if `mutable_column_device_view::element<T>()` has a valid overload, `false`
10451047 */
10461048 template <typename T>
1047- static constexpr bool has_element_accessor ()
1049+ CUDF_HOST_DEVICE static constexpr bool has_element_accessor ()
10481050 {
10491051 return has_element_accessor_impl<mutable_column_device_view, T>::value;
10501052 }
@@ -1425,13 +1427,13 @@ struct pair_rep_accessor {
14251427
14261428 private:
14271429 template <typename R, std::enable_if_t <std::is_same_v<R, rep_type>, void >* = nullptr >
1428- __device__ [[nodiscard]] inline auto get_rep (cudf::size_type i) const
1430+ [[nodiscard]] __device__ inline auto get_rep (cudf::size_type i) const
14291431 {
14301432 return col.element <R>(i);
14311433 }
14321434
14331435 template <typename R, std::enable_if_t <not std::is_same_v<R, rep_type>, void >* = nullptr >
1434- __device__ [[nodiscard]] inline auto get_rep (cudf::size_type i) const
1436+ [[nodiscard]] __device__ inline auto get_rep (cudf::size_type i) const
14351437 {
14361438 return col.element <R>(i).value ();
14371439 }
0 commit comments