15 #include <arm_compute/runtime/CL/CLTensor.h>
16 #include <arm_compute/runtime/IFunction.h>
26 switch (convolutionMethod)
28 case arm_compute::ConvolutionMethod::FFT:
30 case arm_compute::ConvolutionMethod::DIRECT:
32 case arm_compute::ConvolutionMethod::GEMM:
34 case arm_compute::ConvolutionMethod::WINOGRAD:
49 armcomputetensorutils::CopyArmComputeITensorData<T>(srcData, dstTensor);
56 const std::vector<int>& m_end,
57 const std::vector<int>& m_stride)
63 unsigned int num_dims =
static_cast<unsigned int>(m_begin.size());
65 for (
unsigned int i = 0; i < num_dims; i++) {
66 unsigned int revertedIndex = num_dims - i - 1;
68 starts.set(i,
static_cast<int>(m_begin[revertedIndex]));
69 ends.set(i,
static_cast<int>(m_end[revertedIndex]));
70 strides.set(i,
static_cast<int>(m_stride[revertedIndex]));
73 return std::make_tuple(starts, ends, strides);
76 inline auto SetClSliceData(
const std::vector<unsigned int>& m_begin,
77 const std::vector<unsigned int>& m_size)
84 unsigned int num_dims =
static_cast<unsigned int>(m_begin.size());
89 for (
unsigned int i = 0; i < num_dims; i++)
91 unsigned int revertedIndex = num_dims - i - 1;
93 starts.set(i,
static_cast<int>(m_begin[revertedIndex]));
94 ends.set(i,
static_cast<int>(m_begin[revertedIndex] + m_size[revertedIndex]));
97 return std::make_tuple(starts, ends);
101 const ConstTensorHandle* handle)
105 armcomputetensorutils::InitialiseArmComputeTensorEmpty(clTensor);
106 switch(handle->GetTensorInfo().GetDataType())
132 throw Exception(
"Unexpected tensor type during InitializeArmComputeClTensorData().");
136 inline RuntimeException
WrapClError(
const cl::Error& clError,
const CheckLocation& location)
138 std::stringstream message;
139 message <<
"CL error: " << clError.
what() <<
". Error code: " << clError.err();
141 return RuntimeException(message.str(), location);
144 inline void RunClFunction(arm_compute::IFunction&
function,
const CheckLocation& location)
150 catch (cl::Error& error)
156 template <
typename DataType,
typename PayloadType>
159 ITensorHandle* tensorHandle = data.m_Outputs[idx];
160 return reinterpret_cast<DataType*
>(tensorHandle->Map());