16 #include <arm_compute/runtime/CL/CLTensor.h>
17 #include <arm_compute/runtime/IFunction.h>
21 #define ARMNN_SCOPED_PROFILING_EVENT_CL(name) \
22 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::GpuAcc, \
23 armnn::EmptyOptional(), \
25 armnn::OpenClTimer(), \
26 armnn::WallClockTimer())
28 #define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid) \
29 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::GpuAcc, \
31 GetName() + "_" + name, \
32 armnn::OpenClTimer(), \
33 armnn::WallClockTimer())
36 #define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label) \
37 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::GpuAcc, \
39 this->GetName() + "_" + label, \
40 armnn::OpenClTimer(), \
41 armnn::WallClockTimer())
48 switch (convolutionMethod)
50 case arm_compute::ConvolutionMethod::FFT:
52 case arm_compute::ConvolutionMethod::DIRECT:
54 case arm_compute::ConvolutionMethod::GEMM:
56 case arm_compute::ConvolutionMethod::WINOGRAD:
73 armcomputetensorutils::CopyArmComputeITensorData<T>(srcData, dstTensor);
80 const std::vector<int>& m_end,
81 const std::vector<int>& m_stride)
87 unsigned int num_dims =
static_cast<unsigned int>(m_begin.size());
89 for (
unsigned int i = 0; i < num_dims; i++) {
90 unsigned int revertedIndex = num_dims - i - 1;
92 starts.set(i,
static_cast<int>(m_begin[revertedIndex]));
93 ends.set(i,
static_cast<int>(m_end[revertedIndex]));
94 strides.set(i,
static_cast<int>(m_stride[revertedIndex]));
97 return std::make_tuple(starts, ends, strides);
101 const std::vector<unsigned int>& m_size)
108 unsigned int num_dims =
static_cast<unsigned int>(m_begin.size());
113 for (
unsigned int i = 0; i < num_dims; i++)
115 unsigned int revertedIndex = num_dims - i - 1;
117 starts.set(i,
static_cast<int>(m_begin[revertedIndex]));
118 ends.set(i,
static_cast<int>(m_begin[revertedIndex] + m_size[revertedIndex]));
121 return std::make_tuple(starts, ends);
129 armcomputetensorutils::InitialiseArmComputeTensorEmpty(clTensor);
156 throw Exception(
"Unexpected tensor type during InitializeArmComputeClTensorData().");
162 std::stringstream message;
163 message <<
"CL error: " << clError.
what() <<
". Error code: " << clError.err();
174 catch (cl::Error&
error)
180 template <
typename DataType,
typename PayloadType>
184 return reinterpret_cast<DataType*
>(tensorHandle->
Map());