# TODO: fix acl location
set(ACL_DIR ${CMAKE_SOURCE_DIR}/externals/acl)
+# These are not included in arm_compute libraries so add here
+set(ACL_GRAPH_UTILS_SRCS ${ACL_DIR}/utils/GraphUtils.cpp
+ ${ACL_DIR}/utils/Utils.cpp)
+
set(ACL_INCLUDES ${ACL_DIR}
${ACL_DIR}/include)
set(ACL_LIBS arm_compute_graph arm_compute arm_compute_core)
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
-add_library(exp_bindacl SHARED ${NNAPI_BINDACL_SRCS})
+add_library(exp_bindacl SHARED ${NNAPI_BINDACL_SRCS}
+ ${ACL_GRAPH_UTILS_SRCS})
target_include_directories(exp_bindacl PUBLIC ${NNAPI_INCLUDE_DIR}
${ACL_INCLUDES})
target_link_libraries(exp_bindacl ${ACL_LIBS})
#include <boost/format.hpp>
// ACL Headers
#include <arm_compute/graph/Graph.h>
+#include <arm_compute/graph/Nodes.h>
#include <utils/GraphUtils.h>
#include <utils/Utils.h>
arm_compute::graph::Graph& graph = execlocal->graph;
TargetHint target_hint;
-#if 0
std::string image;
std::string label;
constexpr float mean_r = 122.68f; // Mean value to subtract from red channel
constexpr float mean_g = 116.67f; // Mean value to subtract from green channel
constexpr float mean_b = 104.01f; // Mean value to subtract from blue channel
-#endif
// 0 = NEON, 1 = OpenCL
// arm_compute::graph_utils can't be used with 'using'
target_hint = arm_compute::graph_utils::set_target_hint(1);
graph << target_hint
-#if 0
- // TODO: fix load library fail when get_input_accessor() is used
<< Tensor(TensorInfo(TensorShape(224U, 224U, 3U, 1U), 1, DataType::F32),
arm_compute::graph_utils::get_input_accessor(image, mean_r, mean_g, mean_b))
-#endif
+ << arm_compute::graph::SoftmaxLayer()
+ << Tensor(arm_compute::graph_utils::get_output_accessor(label, 5));
;
std::cout << __FUNCTION__ << " ---" << std::endl;
std::cout << __FUNCTION__ << " +++" << std::endl;
*event = new ANeuralNetworksEvent;
-#if 0
// graph.run() fails with segment fail when only target_hint is added.
// after fix adding 'Tensor' we may call graph.run()
arm_compute::graph::Graph& graph = execution->graph;
graph.run();
-#endif
std::cout << __FUNCTION__ << " ---" << std::endl;
return ANEURALNETWORKS_NO_ERROR;