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{};
58 const ActivationLayerInfo ainfo(ActivationLayerInfo::ActivationFunction::LOGISTIC, 0.5f, 1.f);
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);