Compute Library
 23.11
CpuSoftmaxKernel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2023 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
25 
26 #include "arm_compute/core/Error.h"
30 #include "arm_compute/core/Utils.h"
33 
35 #include "src/core/CPP/Validate.h"
39 
40 namespace arm_compute
41 {
42 namespace cpu
43 {
44 namespace kernels
45 {
46 namespace
47 {
48 /* Softmax Logits 1D Max - identifying the max value of 1D Logits */
49 static const std::vector<CpuLogits1DMaxKernel::SoftmaxLogits1DMaxKernel> available_kernels_max_logits = {
50  {"sve_fp32_logits_1d_max",
51  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F32) && data.isa.sve; },
53  {"sve_fp16_logits_1d_max",
54  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F16) && data.isa.sve && data.isa.fp16; },
56  {"sve_qu8_logits_1d_max",
57  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8) && data.isa.sve; },
59  {"sve_qs8_logits_1d_max",
60  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8_SIGNED) && data.isa.sve; },
62  {"neon_fp32_logits_1d_max", [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F32); },
64  {"neon_fp16_logits_1d_max",
65  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F16) && data.isa.fp16; },
67  {"neon_qu8_logits_1d_max", [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8); },
69  {"neon_qs8_logits_1d_max",
70  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8_SIGNED); },
72 };
73 
74 Status validate_arguments_logits_1d_max(const ITensorInfo &input, const ITensorInfo &output)
75 {
79 
80  // Validate in case of configured output
81  if (output.total_size() != 0)
82  {
86  TensorShape(input.tensor_shape()).set(0, 1));
87  }
88 
89  return Status{};
90 }
91 } //namespace
92 const std::vector<CpuLogits1DMaxKernel::SoftmaxLogits1DMaxKernel> &CpuLogits1DMaxKernel::get_available_kernels()
93 {
94  return available_kernels_max_logits;
95 }
96 
98 {
100  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments_logits_1d_max(*src, *dst));
101 
102  // Softmax across the x dimension
103  const TensorShape output_shape = TensorShape(src->tensor_shape()).set(0, 1);
104  // Output auto initialization if not yet initialized
105  auto_init_if_empty(*dst, output_shape, 1, src->data_type(), src->quantization_info());
106 
107  const auto *uk = get_implementation(DataTypeISASelectorData{src->data_type(), CPUInfo::get().get_isa()});
108  ARM_COMPUTE_ERROR_ON(uk == nullptr || uk->ukernel == nullptr);
109 
110  _run_method = uk->ukernel;
111  _name = std::string("CpuLogits1DMaxKernel").append("/").append(uk->name);
112 
114  ICpuKernel::configure(win);
115 }
116 
118 {
120  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments_logits_1d_max(*src, *dst));
121 
122  return Status{};
123 }
124 
125 void CpuLogits1DMaxKernel::run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info)
126 {
130  ARM_COMPUTE_ERROR_ON(_run_method == nullptr);
131 
132  const auto src = tensors.get_const_tensor(TensorType::ACL_SRC);
133  auto dst = tensors.get_tensor(TensorType::ACL_DST);
134 
135  _run_method(src, dst, window);
136 }
137 
138 const char *CpuLogits1DMaxKernel::name() const
139 {
140  return _name.c_str();
141 }
142 
143 /* Softmax Logits 1D - computation for QASYMM8 with pre-computed max. */
144 template <bool IS_LOG>
145 static const std::vector<typename CpuLogits1DSoftmaxKernel<IS_LOG>::SoftmaxLogits1DKernel> available_kernels_logits = {
146  {"sve2_qu8_softmax_logits_1d",
147  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8) && data.isa.sve2; },
149  {"sve2_qs8_softmax_logits_1d",
150  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8_SIGNED) && data.isa.sve2; },
152  {"sve_fp32_softmax_logits_1d",
153  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F32) && data.isa.sve; },
155  {"sve_fp16_softmax_logits_1d",
156  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F16) && data.isa.sve && data.isa.fp16; },
158 
159  {"neon_fp32_softmax_logits_1d", [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F32); },
161  {"neon_fp16_softmax_logits_1d",
162  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::F16) && data.isa.fp16; },
164  {"neon_qu8_softmax_logits_1d", [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8); },
166  {"neon_qs8_softmax_logits_1d",
167  [](const DataTypeISASelectorData &data) { return (data.dt == DataType::QASYMM8_SIGNED); },
169 };
170 namespace
171 {
172 Status validate_arguments_logits_softmax(const ITensorInfo &src,
173  const ITensorInfo &max,
174  const ITensorInfo &dst,
175  const float beta,
176  const ITensorInfo &tmp,
177  bool is_log)
178 {
179  ARM_COMPUTE_UNUSED(beta);
180  // Check input
184 
185  const bool is_quantized_asymmetric = is_data_type_quantized_asymmetric(src.data_type());
186 
187  // Check max
189  ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(TensorShape(src.tensor_shape()).set(0, 1), max.tensor_shape());
191 
192  // Check output if configured
193  if (dst.total_size() != 0)
194  {
195  const QuantizationInfo output_quantization =
196  is_quantized_asymmetric ? arm_compute::get_softmax_output_quantization_info(src.data_type(), is_log)
197  : dst.quantization_info();
200  ARM_COMPUTE_RETURN_ERROR_ON(dst.quantization_info() != output_quantization);
201  }
202 
203  // Check tmp if configured
204  if (tmp.total_size() != 0)
205  {
206  const DataType tmp_data_type = is_quantized_asymmetric ? DataType::F32 : src.data_type();
207  ARM_COMPUTE_RETURN_ERROR_ON(tmp.data_type() != tmp_data_type);
208  // We could potentially reduce tmp memory if we could predict or make an assumption
209  // on the maximum number of threads that will run in parallel.
211  }
212 
213  return Status{};
214 }
215 } // namespace
216 
217 template <bool IS_LOG>
218 const std::vector<typename CpuLogits1DSoftmaxKernel<IS_LOG>::SoftmaxLogits1DKernel> &
220 {
221  return available_kernels_logits<IS_LOG>;
222 }
223 
224 template <bool IS_LOG>
226  const ITensorInfo *src, const ITensorInfo *max, ITensorInfo *dst, const float beta, ITensorInfo *tmp)
227 {
229  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments_logits_softmax(*src, *max, *dst, beta, *tmp, IS_LOG));
230 
231  // Configure kernel window
232  const bool is_quantized_asymmetric = is_data_type_quantized_asymmetric(src->data_type());
233 
234  // Output auto initialization if not yet initialized
235  const QuantizationInfo output_quantization =
236  is_quantized_asymmetric ? arm_compute::get_softmax_output_quantization_info(src->data_type(), IS_LOG)
237  : dst->quantization_info();
238  auto_init_if_empty(*dst, TensorInfo(*src).set_quantization_info(output_quantization).reset_padding());
239 
240  // Tmp auto initialization if not yet initialized
241  const DataType tmp_data_type = is_quantized_asymmetric ? DataType::F32 : src->data_type();
242  auto_init_if_empty(*tmp, TensorInfo(*src).set_data_type(tmp_data_type).reset_padding());
243 
245  DataTypeISASelectorData{src->data_type(), CPUInfo::get().get_isa()});
246  ARM_COMPUTE_ERROR_ON(uk == nullptr || uk->ukernel == nullptr);
247 
248  std::string kernel_name =
249  IS_LOG ? std::string("CpuLogits1DLogSoftmaxKernel") : std::string("CpuLogits1DSoftmaxKernel");
250 
251  _beta = beta;
252  _run_method = uk->ukernel;
253  _name = kernel_name.append("/").append(uk->name);
254 
255  // Configure kernel window
256  Window win = calculate_max_window(*max, Steps());
257 
259 }
260 
261 template <bool IS_LOG>
263  const ITensorInfo *src, const ITensorInfo *max, const ITensorInfo *dst, const float beta, const ITensorInfo *tmp)
264 {
266  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments_logits_softmax(*src, *max, *dst, beta, *tmp, IS_LOG));
267 
268  return Status{};
269 }
270 
271 template <bool IS_LOG>
273 {
277  ARM_COMPUTE_ERROR_ON(_run_method == nullptr);
278 
279  const auto src = tensors.get_const_tensor(TensorType::ACL_SRC_0);
280  auto max = tensors.get_tensor(TensorType::ACL_SRC_1);
281  auto dst = tensors.get_tensor(TensorType::ACL_DST_0);
282  auto tmp = tensors.get_tensor(TensorType::ACL_DST_1);
283 
284  const unsigned int num_elems_processed_per_iteration = src->info()->valid_region().shape.x();
285  const unsigned int tmp_size_for_thread = tmp->info()->element_size() * num_elems_processed_per_iteration;
286 
287  ARM_COMPUTE_ERROR_ON(tmp->info()->total_size() < (info.num_threads * tmp_size_for_thread));
288 
289  void *tmp_for_thread = tmp->buffer() + (info.thread_id * tmp_size_for_thread);
290  _run_method(src, max, tmp_for_thread, dst, _beta, IS_LOG, window);
291 }
292 
293 template <bool IS_LOG>
295 {
296  return _name.c_str();
297 }
298 
299 template class CpuLogits1DSoftmaxKernel<true>;
300 template class CpuLogits1DSoftmaxKernel<false>;
301 
302 } // namespace kernels
303 } // namespace cpu
304 } // namespace arm_compute
arm_compute::Steps
Class to describe a number of elements in each dimension.
Definition: Steps.h:40
arm_compute::test::validation::configure
im2col_func configure(src_target.info(), dst_target.info(), spatial_kernel, conv_info, has_bias)
arm_compute::cpu::sve_fp16_softmax
void sve_fp16_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
arm_compute::ACL_DST_1
@ ACL_DST_1
Definition: Types.h:57
arm_compute::test::validation::src
SimpleTensor< float > src
Definition: DFT.cpp:155
arm_compute::cpu::kernels::CpuLogits1DSoftmaxKernel::run_op
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
Definition: CpuSoftmaxKernel.cpp:272
arm_compute::QuantizationInfo
Quantization information.
Definition: QuantizationInfo.h:67
CpuSoftmaxKernel.h
Helpers.h
arm_compute::calculate_max_window
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
Definition: WindowHelpers.cpp:29
arm_compute::cpu::kernels::CpuLogits1DSoftmaxKernel
Interface for softmax computation for QASYMM8 with pre-computed max.
Definition: CpuSoftmaxKernel.h:79
arm_compute::test::validation::output_shape
TensorShape output_shape
Definition: LSTMLayerQuantized.cpp:469
arm_compute::DataType::QASYMM8
@ QASYMM8
quantized, asymmetric fixed-point 8-bit number unsigned
arm_compute::TensorShape
Shape of a tensor.
Definition: TensorShape.h:39
arm_compute::test::validation::dst
auto dst
Definition: DFT.cpp:170
arm_compute::cpu::kernels::CpuLogits1DMaxKernel::validate
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
Definition: CpuSoftmaxKernel.cpp:117
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:1079
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
Definition: Validate.h:574
Window.h
REGISTER_QASYMM8_SIGNED_NEON
#define REGISTER_QASYMM8_SIGNED_NEON(func_name)
Definition: Registrars.h:96
arm_compute::CPUInfo::get
static CPUInfo & get()
Access the KernelLibrary singleton.
Definition: CPPTypes.cpp:41
arm_compute::cpu::sve2_qasymm8_signed_softmax
void sve2_qasymm8_signed_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
Definition: qasymm8_signed.cpp:33
TensorInfo.h
arm_compute::ITensorPack::get_tensor
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
Definition: ITensorPack.cpp:63
REGISTER_FP16_NEON
#define REGISTER_FP16_NEON(func_name)
Definition: Registrars.h:48
arm_compute::ACL_SRC_0
@ ACL_SRC_0
Definition: Types.h:45
arm_compute::TensorInfo::set_data_type
ITensorInfo & set_data_type(DataType data_type) override
Set the data type to the specified value.
Definition: TensorInfo.cpp:339
arm_compute::cpu::sve_fp16_logits
void sve_fp16_logits(const ITensor *in, ITensor *out, const Window &window)
arm_compute::cpu::kernels::CpuLogits1DSoftmaxKernel::validate
static Status validate(const ITensorInfo *src, const ITensorInfo *max, const ITensorInfo *dst, const float beta, const ITensorInfo *tmp)
Static function to check if given info will lead to a valid configuration.
Definition: CpuSoftmaxKernel.cpp:262
Error.h
arm_compute::ACL_SRC_1
@ ACL_SRC_1
Definition: Types.h:46
Registrars.h
REGISTER_QASYMM8_NEON
#define REGISTER_QASYMM8_NEON(func_name)
Definition: Registrars.h:117
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Definition: Validate.h:677
ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:952
ARM_COMPUTE_RETURN_ON_ERROR
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:205
REGISTER_FP32_NEON
#define REGISTER_FP32_NEON(func_name)
Definition: Registrars.h:74
arm_compute::cpu::neon_qasymm8_signed_softmax
void neon_qasymm8_signed_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
Definition: qasymm8_signed.cpp:32
REGISTER_QASYMM8_SVE
#define REGISTER_QASYMM8_SVE(func_name)
Definition: Registrars.h:118
ARM_COMPUTE_ERROR_ON_NULLPTR
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:159
REGISTER_FP32_SVE
#define REGISTER_FP32_SVE(func_name)
Definition: Registrars.h:75
ARM_COMPUTE_ERROR_ON
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
arm_compute::get_softmax_output_quantization_info
QuantizationInfo get_softmax_output_quantization_info(DataType input_type, bool is_log)
Returns output quantization information for softmax layer.
Definition: Utils.cpp:421
arm_compute::TensorInfo::set_quantization_info
ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info) override
Set the quantization settings (scale and offset) of the tensor.
Definition: TensorInfo.cpp:398
arm_compute::cpu::sve_fp32_softmax
void sve_fp32_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
Definition: fp32.cpp:33
arm_compute::ITensorPack::get_const_tensor
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
Definition: ITensorPack.cpp:53
arm_compute::ITensorInfo::reset_padding
virtual ITensorInfo & reset_padding()=0
Resets the padding settings of the tensor.
ARM_COMPUTE_ERROR_THROW_ON
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
arm_compute::ITensorPack
Tensor packing service.
Definition: ITensorPack.h:39
arm_compute::ACL_DST_0
@ ACL_DST_0
Definition: Types.h:56
REGISTER_QASYMM8_SIGNED_SVE
#define REGISTER_QASYMM8_SIGNED_SVE(func_name)
Definition: Registrars.h:97
ARM_COMPUTE_RETURN_ERROR_ON
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Definition: Error.h:298
arm_compute::cpu::neon_fp16_softmax
void neon_fp16_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
arm_compute::ACL_DST
@ ACL_DST
Definition: Types.h:55
ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
Definition: Validate.h:117
arm_compute::auto_init_if_empty
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
Definition: AutoConfiguration.h:43
arm_compute::cpu::kernels::CpuLogits1DMaxKernel::configure
void configure(const ITensorInfo *src, ITensorInfo *dst)
Set the input and output tensors.
Definition: CpuSoftmaxKernel.cpp:97
arm_compute::cpu::kernels::CpuLogits1DMaxKernel::get_available_kernels
static const std::vector< SoftmaxLogits1DMaxKernel > & get_available_kernels()
Definition: CpuSoftmaxKernel.cpp:92
arm_compute::Status
Status class.
Definition: Error.h:52
arm_compute::DataType::QASYMM8_SIGNED
@ QASYMM8_SIGNED
quantized, asymmetric fixed-point 8-bit number signed
WindowHelpers.h
arm_compute::cpu::neon_fp32_logits
void neon_fp32_logits(const ITensor *in, ITensor *out, const Window &window)
Definition: fp32.cpp:43
ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:203
arm_compute::cpu::ICpuKernel
Definition: ICpuKernel.h:42
arm_compute::cpu::neon_fp16_logits
void neon_fp16_logits(const ITensor *in, ITensor *out, const Window &window)
arm_compute::cpu::kernels::CpuLogits1DSoftmaxKernel::get_available_kernels
static const std::vector< SoftmaxLogits1DKernel > & get_available_kernels()
Definition: CpuSoftmaxKernel.cpp:219
REGISTER_QASYMM8_SIGNED_SVE2
#define REGISTER_QASYMM8_SIGNED_SVE2(func_name)
Definition: Registrars.h:98
ARM_COMPUTE_UNUSED
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:151
arm_compute::cpu::ICpuKernel< CpuLogits1DMaxKernel >::get_implementation
static const auto * get_implementation(const SelectorType &selector, KernelSelectionType selection_type=KernelSelectionType::Supported)
Micro-kernel selector.
Definition: ICpuKernel.h:54
arm_compute::cpu::kernels::CpuLogits1DSoftmaxKernel::configure
void configure(const ITensorInfo *src, const ITensorInfo *max, ITensorInfo *dst, const float beta, ITensorInfo *tmp)
Set the input and output tensors.
Definition: CpuSoftmaxKernel.cpp:225
AutoConfiguration.h
arm_compute::IKernel::window
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...)
Definition: Validate.h:753
arm_compute::ThreadInfo
Information about executing thread and CPU.
Definition: CPPTypes.h:180
arm_compute::cpu::kernels::CpuLogits1DMaxKernel::run_op
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
Definition: CpuSoftmaxKernel.cpp:125
Utils.h
arm_compute::cpu::neon_fp32_softmax
void neon_fp32_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
Definition: fp32.cpp:32
arm_compute::TensorInfo
Store the tensor's metadata.
Definition: TensorInfo.h:41
arm_compute::cpu::sve_qasymm8_logits
void sve_qasymm8_logits(const ITensor *in, ITensor *out, const Window &window)
Definition: qasymm8.cpp:33
arm_compute::cpu::neon_qasymm8_singed_logits
void neon_qasymm8_singed_logits(const ITensor *in, ITensor *out, const Window &window)
Definition: qasymm8_signed.cpp:43
arm_compute::Window
Describe a multidimensional execution window.
Definition: Window.h:39
Validate.h
arm_compute::cpu::neon_qasymm8_softmax
void neon_qasymm8_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
Definition: qasymm8.cpp:32
list.h
arm_compute
Copyright (c) 2017-2023 Arm Limited.
Definition: introduction.dox:24
REGISTER_FP16_SVE
#define REGISTER_FP16_SVE(func_name)
Definition: Registrars.h:49
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
Definition: Validate.h:294
arm_compute::DataType::F16
@ F16
16-bit floating-point number
arm_compute::cpu::kernels::DataTypeISASelectorData
Definition: CpuKernelSelectionTypes.h:38
arm_compute::cpu::sve2_qasymm8_softmax
void sve2_qasymm8_softmax(const ITensor *in, const ITensor *max, void *const tmp, ITensor *out, const float beta, bool is_log, const Window &window)
Definition: qasymm8.cpp:33
arm_compute::is_data_type_quantized_asymmetric
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
Definition: DataTypeUtils.h:346
arm_compute::cpu::kernels::CpuLogits1DSoftmaxKernel::name
const char * name() const override
Name of the kernel.
Definition: CpuSoftmaxKernel.cpp:294
arm_compute::cpu::sve_qasymm8_signed_logits
void sve_qasymm8_signed_logits(const ITensor *in, ITensor *out, const Window &window)
Definition: qasymm8_signed.cpp:33
arm_compute::cpu::neon_qasymm8_logits
void neon_qasymm8_logits(const ITensor *in, ITensor *out, const Window &window)
Definition: qasymm8.cpp:43
arm_compute::ACL_SRC
@ ACL_SRC
Definition: Types.h:44
arm_compute::ITensorInfo
Store the tensor's metadata.
Definition: ITensorInfo.h:44
arm_compute::DataType::F32
@ F32
32-bit floating-point number
ITensor.h
arm_compute::test::validation::info
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
arm_compute::TensorShape::set
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Definition: TensorShape.h:78
Validate.h
num_elems_processed_per_iteration
unsigned int num_elems_processed_per_iteration
Definition: ClIm2ColKernel.cpp:60
arm_compute::cpu::sve_fp32_logits
void sve_fp32_logits(const ITensor *in, ITensor *out, const Window &window)
Definition: fp32.cpp:44
arm_compute::DataType
DataType
Available data types.
Definition: CoreTypes.h:83
arm_compute::cpu::kernels::CpuLogits1DMaxKernel::name
const char * name() const override
Name of the kernel.
Definition: CpuSoftmaxKernel.cpp:138
REGISTER_QASYMM8_SVE2
#define REGISTER_QASYMM8_SVE2(func_name)
Definition: Registrars.h:119
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486
kernel_name
std::string kernel_name
Definition: ClIm2ColKernel.cpp:58