Compute Library
 21.02
reduction_operation.cl File Reference
#include "helpers.h"
#include "helpers_asymm.h"

Go to the source code of this file.

Macros

#define ISGREATER(x, y)   select((int16)0, (int16)-1, x > y)
 
#define ISLESS(x, y)   select((int16)0, (int16)-1, x < y)
 

Functions

DATA_TYPE square_sum (__global const DATA_TYPE *input)
 Calculate square sum of a vector. More...
 
DATA_TYPE sum (__global const DATA_TYPE *input)
 Calculate sum of a vector. More...
 
DATA_TYPE product (__global const DATA_TYPE *input)
 Calculate product of a vector. More...
 

Macro Definition Documentation

◆ ISGREATER

#define ISGREATER (   x,
 
)    select((int16)0, (int16)-1, x > y)

Definition at line 35 of file reduction_operation.cl.

Referenced by product().

◆ ISLESS

#define ISLESS (   x,
 
)    select((int16)0, (int16)-1, x < y)

Definition at line 36 of file reduction_operation.cl.

Referenced by product().

Function Documentation

◆ product()

DATA_TYPE product ( __global const DATA_TYPE input)
inline

Calculate product of a vector.

Parameters
[in]inputPointer to the first pixel.
Returns
product of vector.

Definition at line 84 of file reduction_operation.cl.

References CONVERT, CONVERT_SAT, CONVERT_TO_IMAGE_STRUCT, CONVERT_TO_TENSOR3D_STRUCT, CONVERT_TO_TENSOR4D_STRUCT, CONVERT_TO_VECTOR_STRUCT, DATA_TYPE, DEQUANTIZE, IMAGE_DECLARATION, arm_compute::test::validation::input, ISGREATER, ISLESS, offset(), Vector::ptr, Image::ptr, Tensor3D::ptr, Tensor4D::ptr, QUANTIZE, arm_compute::test::validation::reference::select(), arm_compute::test::validation::src, TENSOR3D_DECLARATION, tensor3D_offset(), TENSOR4D_DECLARATION, tensor4D_offset(), VEC_DATA_TYPE, VECTOR_DECLARATION, vector_offset(), and arm_compute::test::validation::w.

Referenced by MaliCounter::~MaliCounter().

85 {
87  in = vload16(0, input);
88 
89  in.s01234567 *= in.s89ABCDEF;
90  in.s0123 *= in.s4567;
91  in.s01 *= in.s23;
92 
93  return (in.s0 * in.s1);
94 }
#define DATA_TYPE
#define VEC_DATA_TYPE(type, size)
Definition: helpers.h:514

◆ square_sum()

DATA_TYPE square_sum ( __global const DATA_TYPE input)
inline

Calculate square sum of a vector.

Parameters
[in]inputPointer to the first pixel.
Returns
square sum of vector.

Definition at line 46 of file reduction_operation.cl.

References DATA_TYPE, and VEC_DATA_TYPE.

47 {
49  in = vload16(0, input);
50 
51  in *= in;
52 
53  in.s01234567 += in.s89ABCDEF;
54  in.s0123 += in.s4567;
55  in.s01 += in.s23;
56 
57  return (in.s0 + in.s1);
58 }
#define DATA_TYPE
#define VEC_DATA_TYPE(type, size)
Definition: helpers.h:514

◆ sum()

DATA_TYPE sum ( __global const DATA_TYPE input)
inline

Calculate sum of a vector.

Parameters
[in]inputPointer to the first pixel.
Returns
sum of vector.

Definition at line 66 of file reduction_operation.cl.

References DATA_TYPE, and VEC_DATA_TYPE.

Referenced by GCLogits1DShiftExpSumKernel::configure(), CLLogits1DMaxShiftExpSumKernel::configure(), CLL2NormalizeLayerKernel::configure(), GCLogits1DNormKernel::configure(), CLLogits1DNormKernel::configure(), arm_compute::test::validation::reference::convolution(), GemmTuner::extract_benchmark_results(), get_invsqrt_quantized_multiplier_exp(), arm_compute::test::validation::reference::l2_normalize(), l2_normalize_x(), l2_normalize_y(), l2_normalize_z(), arm_compute::test::validation::reference::magnitude(), arm_compute::test::validation::reference::mean_std_normalization_layer(), NEL2NormalizeLayerKernel::name(), arm_compute::cpu::neon_softmax_logits_1d_float(), arm_compute::scale_helpers::pixel_area_c1u8_clamp(), arm_compute::test::validation::reference::qlstm_layer_normalization(), arm_compute::test::validation::reference::scale_core(), arm_compute::test::validation::reference::softmax_layer_generic(), GEMMConfigDistribution::std(), and GEMMBenchmarkResultRecorder::summary().

67 {
69  in = vload16(0, input);
70 
71  in.s01234567 += in.s89ABCDEF;
72  in.s0123 += in.s4567;
73  in.s01 += in.s23;
74 
75  return (in.s0 + in.s1);
76 }
#define DATA_TYPE
#define VEC_DATA_TYPE(type, size)
Definition: helpers.h:514