From 96becb7e4f5f510344c3850278a706d63a564fc4 Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Tue, 16 Jun 2020 12:41:49 +0100 Subject: Revert "IVGCVSW-3726 Upload ArmNN Doxygen files" This reverts commit de36e4a9c299028e792c3a5bd99ad0816d806077. Signed-off-by: Jan Eilers Change-Id: Idbf20c12ea07583ca552d7cc7fb517fbadc73fff --- Documentation/_cl_workload_utils_8hpp_source.xhtml | 147 --------------------- 1 file changed, 147 deletions(-) delete mode 100644 Documentation/_cl_workload_utils_8hpp_source.xhtml (limited to 'Documentation/_cl_workload_utils_8hpp_source.xhtml') diff --git a/Documentation/_cl_workload_utils_8hpp_source.xhtml b/Documentation/_cl_workload_utils_8hpp_source.xhtml deleted file mode 100644 index 46225eb04e..0000000000 --- a/Documentation/_cl_workload_utils_8hpp_source.xhtml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - -ArmNN: src/backends/cl/workloads/ClWorkloadUtils.hpp Source File - - - - - - - - - - - - - - - - -
-
- - - - ArmNN - - - -
-
-  20.02 -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
ClWorkloadUtils.hpp
-
-
-Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include <Half.hpp>
8 
10 #include <cl/OpenClTimer.hpp>
12 
13 #include <armnn/Utils.hpp>
14 
15 #include <arm_compute/runtime/CL/CLTensor.h>
16 #include <arm_compute/runtime/IFunction.h>
17 
18 #include <sstream>
19 
20 #define ARMNN_SCOPED_PROFILING_EVENT_CL(name) \
21  ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::GpuAcc, \
22  name, \
23  armnn::OpenClTimer(), \
24  armnn::WallClockTimer())
25 
26 namespace armnn
27 {
28 
29 template <typename T>
30 void CopyArmComputeClTensorData(arm_compute::CLTensor& dstTensor, const T* srcData)
31 {
32  {
33  ARMNN_SCOPED_PROFILING_EVENT_CL("MapClTensorForWriting");
34  dstTensor.map(true);
35  }
36 
37  {
38  ARMNN_SCOPED_PROFILING_EVENT_CL("CopyToClTensor");
39  armcomputetensorutils::CopyArmComputeITensorData<T>(srcData, dstTensor);
40  }
41 
42  dstTensor.unmap();
43 }
44 
45 inline auto SetClStridedSliceData(const std::vector<int>& m_begin,
46  const std::vector<int>& m_end,
47  const std::vector<int>& m_stride)
48 {
52 
53  unsigned int num_dims = static_cast<unsigned int>(m_begin.size());
54 
55  for (unsigned int i = 0; i < num_dims; i++) {
56  unsigned int revertedIndex = num_dims - i - 1;
57 
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]));
61  }
62 
63  return std::make_tuple(starts, ends, strides);
64 }
65 
66 inline auto SetClSliceData(const std::vector<unsigned int>& m_begin,
67  const std::vector<unsigned int>& m_size)
68 {
69  // This function must translate the size vector given to an end vector
70  // expected by the ACL NESlice workload
73 
74  unsigned int num_dims = static_cast<unsigned int>(m_begin.size());
75 
76  // For strided slices, we have the relationship size = (end - begin) / stride
77  // For slice, we assume stride to be a vector of all ones, yielding the formula
78  // size = (end - begin) therefore we know end = size + begin
79  for (unsigned int i = 0; i < num_dims; i++)
80  {
81  unsigned int revertedIndex = num_dims - i - 1;
82 
83  starts.set(i, static_cast<int>(m_begin[revertedIndex]));
84  ends.set(i, static_cast<int>(m_begin[revertedIndex] + m_size[revertedIndex]));
85  }
86 
87  return std::make_tuple(starts, ends);
88 }
89 
90 inline void InitializeArmComputeClTensorData(arm_compute::CLTensor& clTensor,
91  const ConstCpuTensorHandle* handle)
92 {
93  BOOST_ASSERT(handle);
94 
95  armcomputetensorutils::InitialiseArmComputeTensorEmpty(clTensor);
96  switch(handle->GetTensorInfo().GetDataType())
97  {
98  case DataType::Float16:
100  break;
101  case DataType::Float32:
102  CopyArmComputeClTensorData(clTensor, handle->GetConstTensor<float>());
103  break;
104  case DataType::QAsymmS8:
105  case DataType::QAsymmU8:
106  CopyArmComputeClTensorData(clTensor, handle->GetConstTensor<uint8_t>());
107  break;
111  case DataType::QSymmS8:
112  CopyArmComputeClTensorData(clTensor, handle->GetConstTensor<int8_t>());
113  break;
115  case DataType::Signed32:
116  CopyArmComputeClTensorData(clTensor, handle->GetConstTensor<int32_t>());
117  break;
118  default:
119  BOOST_ASSERT_MSG(false, "Unexpected tensor type.");
120  }
121 };
122 
123 inline RuntimeException WrapClError(const cl::Error& clError, const CheckLocation& location)
124 {
125  std::stringstream message;
126  message << "CL error: " << clError.what() << ". Error code: " << clError.err();
127 
128  return RuntimeException(message.str(), location);
129 }
130 
131 inline void RunClFunction(arm_compute::IFunction& function, const CheckLocation& location)
132 {
133  try
134  {
135  function.run();
136  }
137  catch (cl::Error& error)
138  {
139  throw WrapClError(error, location);
140  }
141 }
142 
143 } //namespace armnn
-
void InitializeArmComputeClTensorData(arm_compute::CLTensor &clTensor, const ConstCpuTensorHandle *handle)
-
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
Definition: Deprecated.hpp:33
- -
#define ARMNN_SCOPED_PROFILING_EVENT_CL(name)
-
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
- -
std::array< unsigned int, MaxNumOfTensorDimensions > Coordinates
- -
virtual const char * what() const noexcept override
Definition: Exceptions.cpp:32
- - -
const T * GetConstTensor() const
-
Copyright (c) 2020 ARM Limited.
- - - -
#define ARMNN_NO_DEPRECATE_WARN_END
Definition: Deprecated.hpp:34
-
DataType GetDataType() const
Definition: Tensor.hpp:95
- - - -
#define ARMNN_FALLTHROUGH
Definition: Utils.hpp:35
-
RuntimeException WrapClError(const cl::Error &clError, const CheckLocation &location)
- -
auto SetClSliceData(const std::vector< unsigned int > &m_begin, const std::vector< unsigned int > &m_size)
- - -
void CopyArmComputeClTensorData(arm_compute::CLTensor &dstTensor, const T *srcData)
- - -
half_float::half Half
Definition: Half.hpp:16
-
auto SetClStridedSliceData(const std::vector< int > &m_begin, const std::vector< int > &m_end, const std::vector< int > &m_stride)
-
const TensorInfo & GetTensorInfo() const
-
-
- - - - -- cgit v1.2.1