traits.cuh
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <cudf/types.hpp>
10 
11 #include <cuda/std/atomic>
12 
13 namespace CUDF_EXPORT cudf {
14 
28 template <typename T>
29 constexpr inline bool has_atomic_support()
30 {
31  return cuda::std::atomic<T>::is_always_lock_free;
32 }
33 
34 struct has_atomic_support_impl {
35  template <typename T>
36  constexpr bool operator()()
37  {
38  return has_atomic_support<T>();
39  }
40 };
41 
49 constexpr inline bool has_atomic_support(data_type type)
50 {
51  return cudf::type_dispatcher(type, has_atomic_support_impl{});
52 }
53 
56 } // namespace CUDF_EXPORT cudf
Indicator for the logical data type of an element in a column.
Definition: types.hpp:238
CUDF_HOST_DEVICE constexpr decltype(auto) __forceinline__ type_dispatcher(cudf::data_type dtype, Functor f, Ts &&... args)
Invokes an operator() template with the type instantiation based on the specified cudf::data_type's i...
constexpr bool has_atomic_support(data_type type)
Indicates whether type has support for atomics.
Definition: traits.cuh:49
cuDF interfaces
Definition: host_udf.hpp:26
Defines the mapping between cudf::type_id runtime type information and concrete C++ types.
Type declarations for libcudf.