41 std::size_t tensor_bytes = tensor.size() *
sizeof(DataType);
42 std::size_t no_stride_bytes = no_stride.size() *
sizeof(DataType);
43 std::size_t stride_bytes = stride.size() *
sizeof(DataType);
44 DataType* d_tensor =
static_cast<DataType*
>(sycl_device.allocate(tensor_bytes));
45 DataType* d_no_stride =
static_cast<DataType*
>(sycl_device.allocate(no_stride_bytes));
46 DataType* d_stride =
static_cast<DataType*
>(sycl_device.allocate(stride_bytes));
58 sycl_device.memcpyHostToDevice(d_tensor, tensor.data(), tensor_bytes);
59 gpu_no_stride.device(sycl_device) = gpu_tensor.stride(
strides);
60 sycl_device.memcpyDeviceToHost(no_stride.data(), d_no_stride, no_stride_bytes);
69 for (IndexType
i = 0;
i < 2; ++
i) {
70 for (IndexType
j = 0;
j < 3; ++
j) {
71 for (IndexType
k = 0;
k < 5; ++
k) {
72 for (IndexType l = 0; l < 7; ++l) {
86 gpu_stride.device(sycl_device) = gpu_tensor.stride(
strides);
87 sycl_device.memcpyDeviceToHost(stride.data(), d_stride, stride_bytes);
94 for (IndexType
i = 0;
i < 1; ++
i) {
95 for (IndexType
j = 0;
j < 1; ++
j) {
96 for (IndexType
k = 0;
k < 3; ++
k) {
97 for (IndexType l = 0; l < 3; ++l) {
104 sycl_device.deallocate(d_tensor);
105 sycl_device.deallocate(d_no_stride);
106 sycl_device.deallocate(d_stride);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
A tensor expression mapping an existing array of data.
Definition: TensorMap.h:33
The tensor class.
Definition: Tensor.h:68
char char char int int * k
Definition: level2_impl.h:374
#define VERIFY_IS_EQUAL(a, b)
Definition: main.h:367
EIGEN_ALWAYS_INLINE DSizes< IndexType, NumDims > strides(const DSizes< IndexType, NumDims > &dimensions)
Definition: TensorBlock.h:29
std::array< T, N > array
Definition: EmulateArray.h:231
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2