/usr/include/af/traits.hpp is in libarrayfire-dev 3.3.2+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | /*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#pragma once
#ifdef __cplusplus
#include <complex>
#include <af/defines.h>
#include <af/complex.h>
namespace af {
template<typename T> struct dtype_traits;
template<>
struct dtype_traits<float> {
enum {
af_type = f32,
ctype = f32
};
typedef float base_type;
static const char* getName() { return "float"; }
};
template<>
struct dtype_traits<af::cfloat> {
enum {
af_type = c32 ,
ctype = c32
};
typedef float base_type;
static const char* getName() { return "std::complex<float>"; }
};
template<>
struct dtype_traits<std::complex<float> > {
enum {
af_type = c32 ,
ctype = c32
};
typedef float base_type;
static const char* getName() { return "std::complex<float>"; }
};
template<>
struct dtype_traits<double> {
enum {
af_type = f64 ,
ctype = f32
};
typedef double base_type;
static const char* getName() { return "double"; }
};
template<>
struct dtype_traits<af::cdouble> {
enum {
af_type = c64 ,
ctype = c64
};
typedef double base_type;
static const char* getName() { return "std::complex<double>"; }
};
template<>
struct dtype_traits<std::complex<double> > {
enum {
af_type = c64 ,
ctype = c64
};
typedef double base_type;
static const char* getName() { return "std::complex<double>"; }
};
template<>
struct dtype_traits<char> {
enum {
af_type = b8 ,
ctype = f32
};
typedef char base_type;
static const char* getName() { return "char"; }
};
template<>
struct dtype_traits<int> {
enum {
af_type = s32 ,
ctype = f32
};
typedef int base_type;
static const char* getName() { return "int"; }
};
template<>
struct dtype_traits<unsigned> {
enum {
af_type = u32 ,
ctype = f32
};
typedef unsigned base_type;
static const char* getName() { return "uint"; }
};
template<>
struct dtype_traits<unsigned char> {
enum {
af_type = u8 ,
ctype = f32
};
typedef unsigned char base_type;
static const char* getName() { return "uchar"; }
};
template<>
struct dtype_traits<long long> {
enum {
af_type = s64 ,
ctype = s64
};
typedef long long base_type;
static const char* getName() { return "long"; }
};
template<>
struct dtype_traits<unsigned long long> {
enum {
af_type = u64 ,
ctype = u64
};
typedef unsigned long long base_type;
static const char* getName() { return "ulong"; }
};
#if AF_API_VERSION >= 32
template<>
struct dtype_traits<short> {
enum {
af_type = s16 ,
ctype = s16
};
typedef short base_type;
static const char* getName() { return "short"; }
};
#endif
#if AF_API_VERSION >= 32
template<>
struct dtype_traits<unsigned short> {
enum {
af_type = u16 ,
ctype = u16
};
typedef unsigned short base_type;
static const char* getName() { return "ushort"; }
};
#endif
}
#endif
|