5#ifndef ATEN_CORE_TENSOR_TYPES_H_
6#define ATEN_CORE_TENSOR_TYPES_H_
22#if defined(__CUDACC__) || defined(__HIPCC__)
23#include <thrust/complex.h>
28template <
typename T,
int Accuracy>
29static inline bool element_compare(
T& a,
T& b) {
31 return (a == b) || (std::norm(a - b) < 1e-7);
33 else if (Accuracy <= 8) {
34 return (a == b) || (std::norm(a - b) < 1e-15);
98 using type = base_device::DEVICE_CPU;
103 using type = base_device::DEVICE_GPU;
106#if defined(__CUDACC__) || defined(__HIPCC__)
113struct DataTypeToEnum<thrust::
complex<double>> {
#define complex
Definition elpa_new.h:28
#define T
Definition exp.cpp:237
DataType
Definition tensor_enums.h:15
@ DT_COMPLEX
Definition tensor_enums.h:21
@ DT_COMPLEX_DOUBLE
Definition tensor_enums.h:22
DeviceType
Definition tensor_enums.h:28
std::ostream & operator<<(std::ostream &os, const Tensor &tensor)
Overloaded operator<< for the Tensor class.
Definition tensor.cpp:330
base_device::DEVICE_CPU type
Definition tensor_types.h:98
base_device::DEVICE_GPU type
Definition tensor_types.h:103
Definition tensor_types.h:92
T type
Definition tensor_types.h:93
Definition tensor_enums.h:25
Definition tensor_enums.h:26
Definition tensor_enums.h:60
static constexpr DataType value
Definition tensor_enums.h:61
double type
Definition tensor_types.h:71
float type
Definition tensor_types.h:61
Template struct to determine the return type based on the input type.
Definition tensor_types.h:50
T type
Definition tensor_types.h:51
container::DEVICE_CPU type
Definition tensor_types.h:82
container::DEVICE_GPU type
Definition tensor_types.h:88
Definition tensor_types.h:75
T type
Definition tensor_types.h:76