48 constexpr
auto num_threads(16u);
49 std::array<CLActivationLayer, num_threads> func{};
50 std::array<CLPixelWiseMultiplication, num_threads> pmul{};
51 std::array<CLTensor, num_threads> s0{};
52 std::array<CLTensor, num_threads> s1{};
54 std::array<CLTensor, num_threads> st{};
55 std::array<CLTensor, num_threads>
dt{};
59 std::array<std::thread, num_threads> threads;
62 for(
auto i = 0u; i < num_threads; ++i)
64 s0[i] = create_tensor<CLTensor>(tensor_shape,
DataType::F32, 1);
65 s1[i] = create_tensor<CLTensor>(tensor_shape,
DataType::F32, 1);
66 st[i] = create_tensor<CLTensor>(tensor_shape,
DataType::F32, 1);
78 func[i].configure(&s, &
t, ainfo);
79 s.allocator()->allocate();
80 t.allocator()->allocate();
81 p0.allocator()->allocate();
82 p1.allocator()->allocate();
90 for(
auto &
t : threads)
98 library->fill_tensor_uniform(ra, 0, -1.f, 1.f);
99 library->fill_tensor_uniform(rb, 0, -1.f, 1.f);
101 const auto golden = reference::activation_layer<float>(mul, ainfo);
Rounds to nearest value; half rounds away from zero.
1 channel, 1 F32 per channel
Basic function to run opencl::kernels::ClActivationKernel.
Activation Layer Information class.
Copyright (c) 2017-2022 Arm Limited.
DatasetMode
Possible dataset modes.
std::unique_ptr< AssetsLibrary > library
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
std::unique_ptr< ParametersLibrary > parameters
Accessor implementation for CLTensor objects.
validate(CLAccessor(output_state), expected_output)
Basic function to run opencl::ClMul.
Simple tensor object that stores elements in a consecutive chunk of memory.
TEST_CASE(FusedActivation, framework::DatasetMode::ALL)
Validate fused activation expecting the following behaviours:
TEST_SUITE(QASYMM8_to_F32) FIXTURE_DATA_TEST_CASE(RunSmall
Basic implementation of the OpenCL tensor interface.