10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_DEVICE_DEFAULT_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_DEVICE_DEFAULT_H 17 struct DefaultDevice {
18 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void* allocate(
size_t num_bytes)
const {
19 return internal::aligned_malloc(num_bytes);
21 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void deallocate(
void* buffer)
const {
22 internal::aligned_free(buffer);
24 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void* allocate_temp(
size_t num_bytes)
const {
25 return allocate(num_bytes);
27 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void deallocate_temp(
void* buffer)
const {
30 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memcpy(
void* dst,
const void* src,
size_t n)
const {
31 ::memcpy(dst, src, n);
33 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memcpyHostToDevice(
void* dst,
const void* src,
size_t n)
const {
36 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memcpyDeviceToHost(
void* dst,
const void* src,
size_t n)
const {
39 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memset(
void* buffer,
int c,
size_t n)
const {
40 ::memset(buffer, c, n);
42 template<
typename Type>
43 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Type
get(Type data)
const {
47 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
size_t numThreads()
const {
48 #if !defined(EIGEN_GPU_COMPILE_PHASE) 51 #elif defined(EIGEN_HIP_DEVICE_COMPILE) 60 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
size_t firstLevelCacheSize()
const {
61 #if !defined(EIGEN_GPU_COMPILE_PHASE) && !defined(SYCL_DEVICE_ONLY) 64 #elif defined(EIGEN_HIP_DEVICE_COMPILE) 73 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
size_t lastLevelCacheSize()
const {
74 #if !defined(EIGEN_GPU_COMPILE_PHASE) && !defined(SYCL_DEVICE_ONLY) 77 #elif defined(EIGEN_HIP_DEVICE_COMPILE) 79 return firstLevelCacheSize();
82 return firstLevelCacheSize();
86 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
int majorDeviceVersion()
const {
87 #if !defined(EIGEN_GPU_COMPILE_PHASE) 91 #elif defined(EIGEN_HIP_DEVICE_COMPILE) 97 return EIGEN_CUDA_ARCH / 100;
104 #endif // EIGEN_CXX11_TENSOR_TENSOR_DEVICE_DEFAULT_H Namespace containing all symbols from the Eigen library.