Eigen::DefaultDevice Struct Reference

#include <TensorDeviceDefault.h>

Public Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void * allocate (size_t num_bytes) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void deallocate (void *buffer) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void * allocate_temp (size_t num_bytes) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void deallocate_temp (void *buffer) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memcpy (void *dst, const void *src, size_t n) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memcpyHostToDevice (void *dst, const void *src, size_t n) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memcpyDeviceToHost (void *dst, const void *src, size_t n) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memset (void *buffer, int c, size_t n) const
 
template<typename T >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void fill (T *begin, T *end, const T &value) const
 
template<typename Type >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Type get (Type data) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t numThreads () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t firstLevelCacheSize () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t lastLevelCacheSize () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void synchronize () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int majorDeviceVersion () const
 

Member Function Documentation

◆ allocate()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void* Eigen::DefaultDevice::allocate ( size_t  num_bytes) const
inline
20  {
21  return internal::aligned_malloc(num_bytes);
22  }
EIGEN_DEVICE_FUNC void * aligned_malloc(std::size_t size)
Definition: Memory.h:199

References Eigen::internal::aligned_malloc().

Referenced by allocate_temp().

◆ allocate_temp()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void* Eigen::DefaultDevice::allocate_temp ( size_t  num_bytes) const
inline
24 { return allocate(num_bytes); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void * allocate(size_t num_bytes) const
Definition: TensorDeviceDefault.h:20

References allocate().

◆ deallocate()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::deallocate ( void *  buffer) const
inline
23 { internal::aligned_free(buffer); }
EIGEN_DEVICE_FUNC void aligned_free(void *ptr)
Definition: Memory.h:224

References Eigen::internal::aligned_free().

Referenced by deallocate_temp().

◆ deallocate_temp()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::deallocate_temp ( void *  buffer) const
inline
25 { deallocate(buffer); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void deallocate(void *buffer) const
Definition: TensorDeviceDefault.h:23

References deallocate().

◆ fill()

template<typename T >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::fill ( T begin,
T end,
const T value 
) const
inline
37  {
38 #ifdef EIGEN_GPU_COMPILE_PHASE
39  // std::fill is not a device function, so resort to simple loop.
40  for (T* it = begin; it != end; ++it) {
41  *it = value;
42  }
43 #else
44  std::fill(begin, end, value);
45 #endif
46  }
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
squared absolute value
Definition: GlobalFunctions.h:87

References Eigen::placeholders::end, and Eigen::value.

◆ firstLevelCacheSize()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t Eigen::DefaultDevice::firstLevelCacheSize ( ) const
inline
65  {
66 #if !defined(EIGEN_GPU_COMPILE_PHASE) && !defined(SYCL_DEVICE_ONLY)
67  // Running on the host CPU
68  return l1CacheSize();
69 #elif defined(EIGEN_HIP_DEVICE_COMPILE)
70  // Running on a HIP device
71  return 48 * 1024; // FIXME : update this number for HIP
72 #else
73  // Running on a CUDA device, return the amount of shared memory available.
74  return 48 * 1024;
75 #endif
76  }
std::ptrdiff_t l1CacheSize()
Definition: products/GeneralBlockPanelKernel.h:3119

References Eigen::l1CacheSize().

Referenced by lastLevelCacheSize().

◆ get()

template<typename Type >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Type Eigen::DefaultDevice::get ( Type  data) const
inline
48  {
49  return data;
50  }
int data[]
Definition: Map_placement_new.cpp:1

References data.

◆ lastLevelCacheSize()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t Eigen::DefaultDevice::lastLevelCacheSize ( ) const
inline
78  {
79 #if !defined(EIGEN_GPU_COMPILE_PHASE) && !defined(SYCL_DEVICE_ONLY)
80  // Running single threaded on the host CPU
81  return l3CacheSize();
82 #elif defined(EIGEN_HIP_DEVICE_COMPILE)
83  // Running on a HIP device
84  return firstLevelCacheSize(); // FIXME : update this number for HIP
85 #else
86  // Running on a CUDA device
87  return firstLevelCacheSize();
88 #endif
89  }
std::ptrdiff_t l3CacheSize()
Definition: products/GeneralBlockPanelKernel.h:3135
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t firstLevelCacheSize() const
Definition: TensorDeviceDefault.h:65

References firstLevelCacheSize(), and Eigen::l3CacheSize().

◆ majorDeviceVersion()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int Eigen::DefaultDevice::majorDeviceVersion ( ) const
inline
95  {
96 #if !defined(EIGEN_GPU_COMPILE_PHASE)
97  // Running single threaded on the host CPU
98  // Should return an enum that encodes the ISA supported by the CPU
99  return 1;
100 #elif defined(EIGEN_HIP_DEVICE_COMPILE)
101  // Running on a HIP device
102  // return 1 as major for HIP
103  return 1;
104 #else
105  // Running on a CUDA device
106  return EIGEN_CUDA_ARCH / 100;
107 #endif
108  }

◆ memcpy()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::memcpy ( void *  dst,
const void *  src,
size_t  n 
) const
inline
26  {
27  ::memcpy(dst, src, n);
28  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memcpy(void *dst, const void *src, size_t n) const
Definition: TensorDeviceDefault.h:26

References n.

Referenced by memcpyDeviceToHost(), and memcpyHostToDevice().

◆ memcpyDeviceToHost()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::memcpyDeviceToHost ( void *  dst,
const void *  src,
size_t  n 
) const
inline
32  {
33  memcpy(dst, src, n);
34  }

References memcpy(), and n.

◆ memcpyHostToDevice()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::memcpyHostToDevice ( void *  dst,
const void *  src,
size_t  n 
) const
inline
29  {
30  memcpy(dst, src, n);
31  }

References memcpy(), and n.

◆ memset()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::memset ( void *  buffer,
int  c,
size_t  n 
) const
inline
35 { ::memset(buffer, c, n); }
int c
Definition: calibrate.py:100
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memset(void *buffer, int c, size_t n) const
Definition: TensorDeviceDefault.h:35

References calibrate::c, and n.

◆ numThreads()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t Eigen::DefaultDevice::numThreads ( ) const
inline
52  {
53 #if !defined(EIGEN_GPU_COMPILE_PHASE)
54  // Running on the host CPU
55  return 1;
56 #elif defined(EIGEN_HIP_DEVICE_COMPILE)
57  // Running on a HIP device
58  return 64;
59 #else
60  // Running on a CUDA device
61  return 32;
62 #endif
63  }

◆ synchronize()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DefaultDevice::synchronize ( ) const
inline
91  {
92  // Nothing. Default device operations are synchronous.
93  }

The documentation for this struct was generated from the following file: