11#ifndef EIGEN_TENSOR_TENSOR_DEVICE_DEFAULT_H
12#define EIGEN_TENSOR_TENSOR_DEVICE_DEFAULT_H
15#include "./InternalHeaderCheck.h"
21 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void* allocate(
size_t num_bytes)
const {
22 return internal::aligned_malloc(num_bytes);
24 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void deallocate(
void* buffer)
const { internal::aligned_free(buffer); }
25 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void* allocate_temp(
size_t num_bytes)
const {
return allocate(num_bytes); }
26 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void deallocate_temp(
void* buffer)
const { deallocate(buffer); }
27 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memcpy(
void* dst,
const void* src,
size_t n)
const {
28 ::memcpy(dst, src, n);
30 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memcpyHostToDevice(
void* dst,
const void* src,
size_t n)
const {
33 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memcpyDeviceToHost(
void* dst,
const void* src,
size_t n)
const {
36 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void memset(
void* buffer,
int c,
size_t n)
const { ::memset(buffer, c, n); }
38 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void fill(T* begin, T* end,
const T& value)
const {
39#ifdef EIGEN_GPU_COMPILE_PHASE
41 for (T* it = begin; it != end; ++it) {
45 std::fill(begin, end, value);
48 template <
typename Type>
49 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Type get(Type data)
const {
53 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
size_t numThreads()
const {
54#if !defined(EIGEN_GPU_COMPILE_PHASE)
57#elif defined(EIGEN_HIP_DEVICE_COMPILE)
66 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
size_t firstLevelCacheSize()
const {
67#if !defined(EIGEN_GPU_COMPILE_PHASE) && !defined(SYCL_DEVICE_ONLY)
70#elif defined(EIGEN_HIP_DEVICE_COMPILE)
79 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
size_t lastLevelCacheSize()
const {
80#if !defined(EIGEN_GPU_COMPILE_PHASE) && !defined(SYCL_DEVICE_ONLY)
83#elif defined(EIGEN_HIP_DEVICE_COMPILE)
85 return firstLevelCacheSize();
88 return firstLevelCacheSize();
92 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void synchronize()
const {
96 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
int majorDeviceVersion()
const {
97#if !defined(EIGEN_GPU_COMPILE_PHASE)
101#elif defined(EIGEN_HIP_DEVICE_COMPILE)
107 return EIGEN_CUDA_ARCH / 100;
Namespace containing all symbols from the Eigen library.