arm_compute v17.10
Change-Id: If1489af40eccd0219ede8946577afbf04db31b29
diff --git a/src/graph/nodes/ActivationLayer.cpp b/src/graph/nodes/ActivationLayer.cpp
index b71e22c..5cd2a0b 100644
--- a/src/graph/nodes/ActivationLayer.cpp
+++ b/src/graph/nodes/ActivationLayer.cpp
@@ -23,6 +23,7 @@
*/
#include "arm_compute/graph/nodes/ActivationLayer.h"
+#include "arm_compute/core/Logger.h"
#include "arm_compute/runtime/CL/CLTensor.h"
#include "arm_compute/runtime/CL/functions/CLActivationLayer.h"
#include "arm_compute/runtime/NEON/functions/NEActivationLayer.h"
@@ -34,7 +35,7 @@
namespace
{
-template <typename ActivationType, typename TensorType, Hint hint>
+template <typename ActivationType, typename TensorType, TargetHint target_hint>
std::unique_ptr<arm_compute::IFunction> instantiate_function(ITensor *input, ITensor *output, const ActivationLayerInfo &activation_info)
{
auto activation = arm_compute::support::cpp14::make_unique<ActivationType>();
@@ -46,19 +47,19 @@
return std::move(activation);
}
-template <Hint hint>
+template <TargetHint target_hint>
std::unique_ptr<arm_compute::IFunction> instantiate(ITensor *input, ITensor *output, const ActivationLayerInfo &activation_info);
template <>
-std::unique_ptr<arm_compute::IFunction> instantiate<Hint::OPENCL>(ITensor *input, ITensor *output, const ActivationLayerInfo &activation_info)
+std::unique_ptr<arm_compute::IFunction> instantiate<TargetHint::OPENCL>(ITensor *input, ITensor *output, const ActivationLayerInfo &activation_info)
{
- return instantiate_function<arm_compute::CLActivationLayer, arm_compute::CLTensor, Hint::OPENCL>(input, output, activation_info);
+ return instantiate_function<arm_compute::CLActivationLayer, arm_compute::CLTensor, TargetHint::OPENCL>(input, output, activation_info);
}
template <>
-std::unique_ptr<arm_compute::IFunction> instantiate<Hint::NEON>(ITensor *input, ITensor *output, const ActivationLayerInfo &activation_info)
+std::unique_ptr<arm_compute::IFunction> instantiate<TargetHint::NEON>(ITensor *input, ITensor *output, const ActivationLayerInfo &activation_info)
{
- return instantiate_function<arm_compute::NEActivationLayer, arm_compute::Tensor, Hint::NEON>(input, output, activation_info);
+ return instantiate_function<arm_compute::NEActivationLayer, arm_compute::Tensor, TargetHint::NEON>(input, output, activation_info);
}
} // namespace
@@ -67,40 +68,28 @@
{
}
-std::unique_ptr<arm_compute::IFunction> ActivationLayer::instantiate_node(Hint hint, ITensor *input, ITensor *output)
+std::unique_ptr<arm_compute::IFunction> ActivationLayer::instantiate_node(GraphContext &ctx, ITensor *input, ITensor *output)
{
std::unique_ptr<arm_compute::IFunction> func;
- _hint = hint;
- _input = input;
- _output = output;
+ _target_hint = ctx.hints().target_hint();
- if(_hint == Hint::OPENCL)
+ if(_target_hint == TargetHint::OPENCL)
{
- func = instantiate<Hint::OPENCL>(input, output, _activation_info);
+ func = instantiate<TargetHint::OPENCL>(input, output, _activation_info);
+ ARM_COMPUTE_LOG("Instantiating CLActivationLayer");
}
else
{
- func = instantiate<Hint::NEON>(input, output, _activation_info);
+ func = instantiate<TargetHint::NEON>(input, output, _activation_info);
+ ARM_COMPUTE_LOG("Instantiating NEActivationLayer");
}
+
+ ARM_COMPUTE_LOG(" Data Type: " << input->info()->data_type()
+ << " Input shape: " << input->info()->tensor_shape()
+ << " Output shape: " << output->info()->tensor_shape()
+ << " Activation function: " << _activation_info.activation()
+ << " a: " << _activation_info.a()
+ << " b: " << _activation_info.b()
+ << std::endl);
return func;
}
-
-void ActivationLayer::print_info()
-{
- if(_hint == Hint::OPENCL)
- {
- std::cout << "Instantiating CLActivationLayer";
- }
- else
- {
- std::cout << "Instantiating NEActivationLayer";
- }
-
- std::cout << " Data Type: " << _input->info()->data_type()
- << " Input shape: " << _input->info()->tensor_shape()
- << " Output shape: " << _output->info()->tensor_shape()
- << " Activation function: " << _activation_info.activation()
- << " a: " << _activation_info.a()
- << " b: " << _activation_info.b()
- << std::endl;
-}