15 #include <arm_compute/runtime/CL/CLTensor.h> 16 #include <arm_compute/runtime/IFunction.h> 20 #define ARMNN_SCOPED_PROFILING_EVENT_CL(name) \ 21 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::GpuAcc, \ 23 armnn::OpenClTimer(), \ 24 armnn::WallClockTimer()) 39 armcomputetensorutils::CopyArmComputeITensorData<T>(srcData, dstTensor);
46 const std::vector<int>& m_end,
47 const std::vector<int>& m_stride)
53 unsigned int num_dims =
static_cast<unsigned int>(m_begin.size());
55 for (
unsigned int i = 0; i < num_dims; i++) {
56 unsigned int revertedIndex = num_dims - i - 1;
58 starts.set(i, static_cast<int>(m_begin[revertedIndex]));
59 ends.set(i, static_cast<int>(m_end[revertedIndex]));
60 strides.set(i, static_cast<int>(m_stride[revertedIndex]));
63 return std::make_tuple(starts, ends, strides);
67 const std::vector<unsigned int>& m_size)
74 unsigned int num_dims =
static_cast<unsigned int>(m_begin.size());
79 for (
unsigned int i = 0; i < num_dims; i++)
81 unsigned int revertedIndex = num_dims - i - 1;
83 starts.set(i, static_cast<int>(m_begin[revertedIndex]));
84 ends.set(i, static_cast<int>(m_begin[revertedIndex] + m_size[revertedIndex]));
87 return std::make_tuple(starts, ends);
95 armcomputetensorutils::InitialiseArmComputeTensorEmpty(clTensor);
119 BOOST_ASSERT_MSG(
false,
"Unexpected tensor type.");
125 std::stringstream message;
126 message <<
"CL error: " << clError.
what() <<
". Error code: " << clError.err();
const T * GetConstTensor() const
auto SetClStridedSliceData(const std::vector< int > &m_begin, const std::vector< int > &m_end, const std::vector< int > &m_stride)
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
const TensorInfo & GetTensorInfo() const
void InitializeArmComputeClTensorData(arm_compute::CLTensor &clTensor, const ConstCpuTensorHandle *handle)
#define ARMNN_FALLTHROUGH
RuntimeException WrapClError(const cl::Error &clError, const CheckLocation &location)
virtual const char * what() const noexcept override
std::array< unsigned int, MaxNumOfTensorDimensions > Coordinates
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
void CopyArmComputeClTensorData(arm_compute::CLTensor &dstTensor, const T *srcData)
DataType GetDataType() const
#define ARMNN_SCOPED_PROFILING_EVENT_CL(name)
auto SetClSliceData(const std::vector< unsigned int > &m_begin, const std::vector< unsigned int > &m_size)
#define ARMNN_NO_DEPRECATE_WARN_END