118 DataType* gpu_in1_data =
119 static_cast<DataType*
>(sycl_device.allocate(in1.dimensions().TotalSize() *
sizeof(DataType)));
120 DataType* gpu_in2_data =
121 static_cast<DataType*
>(sycl_device.allocate(in2.dimensions().TotalSize() *
sizeof(DataType)));
122 DataType* gpu_out_data =
123 static_cast<DataType*
>(sycl_device.allocate(
out.dimensions().TotalSize() *
sizeof(DataType)));
126 TensorType gpu_in1(gpu_in1_data, tensorRange1);
127 TensorType gpu_in2(gpu_in2_data, tensorRange2);
128 TensorType gpu_out(gpu_out_data, tensorResultRange);
133 sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(), (in1.dimensions().TotalSize()) *
sizeof(DataType));
134 sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(), (in2.dimensions().TotalSize()) *
sizeof(DataType));
137 sycl_device.memcpyDeviceToHost(
out.data(), gpu_out_data, (
out.dimensions().TotalSize()) *
sizeof(DataType));
139 for (IndexType
i = 0;
i < 5; ++
i) {
144 in1.template chip<2>(
i).contract(in2.template chip<2>(
i), dims);
146 for (IndexType
j = 0;
j < 2; ++
j) {
147 for (IndexType
k = 0;
k < 7; ++
k) {
152 sycl_device.deallocate(gpu_in1_data);
153 sycl_device.deallocate(gpu_in2_data);
154 sycl_device.deallocate(gpu_out_data);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
A tensor expression mapping an existing array of data.
Definition: TensorMap.h:33
A reference to a tensor expression The expression will be evaluated lazily (as much as possible).
Definition: TensorRef.h:114
The tensor class.
Definition: Tensor.h:68
Tensor< float, 1 >::DimensionPair DimPair
Definition: cxx11_tensor_contraction.cpp:17
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
char char char int int * k
Definition: level2_impl.h:374
std::array< T, N > array
Definition: EmulateArray.h:231
val
Definition: calibrate.py:119
Definition: cxx11_tensor_custom_op.cpp:57
std::ofstream out("Result.txt")
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2