ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
tensor_enums.h
Go to the documentation of this file.
1// Extracted from tensor_types.h to break the circular dependency:
2// macros.h -> tensor_types.h -> cuda.h/rocm.h -> macros.h
3// This file provides only enums and template specializations needed by macros.h,
4// without any GPU library dependencies.
5// mohan add 20260605
6#ifndef ATEN_CORE_TENSOR_ENUMS_H_
7#define ATEN_CORE_TENSOR_ENUMS_H_
8
9#include <complex>
10
12
13namespace container {
14
24
25struct DEVICE_CPU {};
26struct DEVICE_GPU {};
27
28enum class DeviceType {
32};
33
34template <typename T>
36 static constexpr DeviceType value = {};
37};
38
39template <>
43
44template <>
48
49template <>
53
54template <>
58
59template <typename T>
61 static constexpr DataType value = {};
62};
63
64template <>
65struct DataTypeToEnum<int> {
66 static constexpr DataType value = DataType::DT_INT;
67};
68
69template <>
70struct DataTypeToEnum<float> {
71 static constexpr DataType value = DataType::DT_FLOAT;
72};
73
74template <>
75struct DataTypeToEnum<double> {
77};
78
79template <>
80struct DataTypeToEnum<int64_t> {
81 static constexpr DataType value = DataType::DT_INT64;
82};
83
84template <>
85struct DataTypeToEnum<std::complex<float>> {
87};
88
89template <>
90struct DataTypeToEnum<std::complex<double>> {
92};
93
94} // namespace container
95
96#endif // ATEN_CORE_TENSOR_ENUMS_H_
#define complex
Definition elpa_new.h:28
Definition device.cpp:21
Definition tensor.cpp:8
DataType
Definition tensor_enums.h:15
@ DT_COMPLEX
Definition tensor_enums.h:21
@ DT_INT64
Definition tensor_enums.h:20
@ DT_FLOAT
Definition tensor_enums.h:17
@ DT_COMPLEX_DOUBLE
Definition tensor_enums.h:22
@ DT_INT
Definition tensor_enums.h:19
@ DT_DOUBLE
Definition tensor_enums.h:18
@ DT_INVALID
Definition tensor_enums.h:16
DeviceType
Definition tensor_enums.h:28
@ UnKnown
Definition tensor_enums.h:29
@ CpuDevice
Definition tensor_enums.h:30
@ GpuDevice
Definition tensor_enums.h:31
Definition tensor_enums.h:25
Definition tensor_enums.h:26
static constexpr DataType value
Definition tensor_enums.h:76
static constexpr DataType value
Definition tensor_enums.h:71
static constexpr DataType value
Definition tensor_enums.h:81
static constexpr DataType value
Definition tensor_enums.h:66
static constexpr DataType value
Definition tensor_enums.h:91
static constexpr DataType value
Definition tensor_enums.h:86
Definition tensor_enums.h:60
static constexpr DataType value
Definition tensor_enums.h:61
static constexpr DeviceType value
Definition tensor_enums.h:41
static constexpr DeviceType value
Definition tensor_enums.h:46
static constexpr DeviceType value
Definition tensor_enums.h:51
static constexpr DeviceType value
Definition tensor_enums.h:56
Definition tensor_enums.h:35
static constexpr DeviceType value
Definition tensor_enums.h:36