traits.cuh
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
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 
29 template <typename T>
30 constexpr inline bool has_atomic_support()
31 {
32  return cuda::std::atomic<T>::is_always_lock_free;
33 }
34 
35 struct has_atomic_support_impl {
36  template <typename T>
37  constexpr bool operator()()
38  {
39  return has_atomic_support<T>();
40  }
41 };
42 
50 constexpr inline bool has_atomic_support(data_type type)
51 {
52  return cudf::type_dispatcher(type, has_atomic_support_impl{});
53 }
54 
57 } // namespace CUDF_EXPORT cudf
Indicator for the logical data type of an element in a column.
Definition: types.hpp:286
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:50
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.