24 #ifndef ARM_COMPUTE_TEST_SOBEL_FIXTURE 25 #define ARM_COMPUTE_TEST_SOBEL_FIXTURE 54 template <
typename Function>
58 struct info<NESobel3x3>
65 struct info<CLSobel3x3>
72 struct info<NESobel5x5>
79 struct info<CLSobel5x5>
86 struct info<NESobel7x7>
93 struct info<CLSobel7x7>
100 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T,
typename U>
104 template <
typename...>
108 std::mt19937 gen(
library->seed());
109 std::uniform_int_distribution<uint8_t> int_dist(0, 255);
110 const uint8_t constant_border_value = int_dist(gen);
113 _target = compute_target(shape, border_mode, format, constant_border_value, gradient_dimension);
114 _reference = compute_reference(shape, info<FunctionType>::filter_size, border_mode, format, constant_border_value, gradient_dimension);
118 template <
typename V>
119 void fill(
V &&tensor)
121 library->fill_tensor_uniform(tensor, 0);
131 src.info()->set_format(format);
132 dst_x.info()->set_format(info<FunctionType>::dst_format);
133 dst_y.info()->set_format(info<FunctionType>::dst_format);
137 switch(gradient_dimension)
139 case GradientDimension::GRAD_X:
140 sobel.configure(&src, &dst_x,
nullptr, border_mode, constant_border_value);
142 case GradientDimension::GRAD_Y:
143 sobel.configure(&src,
nullptr, &dst_y, border_mode, constant_border_value);
146 sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value);
157 src.allocator()->allocate();
158 dst_x.allocator()->allocate();
159 dst_y.allocator()->allocate();
166 fill(AccessorType(src));
171 return std::make_pair(std::move(dst_x), std::move(dst_y));
187 std::pair<TensorType, TensorType> _target{};
BorderMode
Methods available to handle borders.
#define ARM_COMPUTE_ERROR(...)
Print the given message then throw an std::runtime_error.
src info() -> set_format(Format::S16)
This file contains all available output stages for GEMMLowp on OpenCL.
1 channel, 1 S32 per channel
void setup(TensorShape shape, BorderMode border_mode, Format format, GradientDimension gradient_dimension)
std::unique_ptr< AssetsLibrary > library
Format
Image colour formats.
1 channel, 1 S16 per channel
DataType data_type_from_format(Format format)
Return the data type used by a given single-planar pixel format.
x and y gradient dimension
ARM_COMPUTE_EXPECT(src.info() ->is_resizable(), framework::LogLevel::ERRORS)
Borders are left undefined.
std::pair< SimpleTensor< T >, SimpleTensor< T > > sobel(const SimpleTensor< U > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
GradientDimension
Gradient dimension type.
convolution configure & src