This will introduce initialize function for nnfw acl kernels
Signed-off-by: SaeHie Park <saehie.park@samsung.com>
--- /dev/null
+#ifndef __NNFW_KERNEL_ACL_H__
+#define __NNFW_KERNEL_ACL_H__
+
+namespace nnfw {
+namespace kernel {
+namespace acl {
+
+void Initialize(void);
+
+} // namespace acl
+} // namespace kernel
+} // namespace nnfw
+
+#endif // __NNFW_KERNEL_ACL_H__
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
# kernel library
-set(KERNELACL_SRCS "src/Conv2D_acl.cpp"
+set(KERNELACL_SRCS "src/Init_acl.cpp"
+ "src/Conv2D_acl.cpp"
)
add_library(${LIB_KERNELACL} SHARED ${KERNELACL_SRCS})
#include "gtest/gtest.h"
#include "OperationsUtils.h"
+#include <kernel/acl/nnfw_kernel_acl.h>
namespace nnfw {
namespace kernel {
TEST(KernelACL_TC, convFloat32_test)
{
+ nnfw::kernel::acl::Initialize();
+
float inputData[9];
const android::nn::Shape inputShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 };
float filterData[9];
--- /dev/null
+#include <arm_compute/runtime/CL/CLScheduler.h>
+#include <kernel/acl/nnfw_kernel_acl.h>
+
+namespace nnfw {
+namespace kernel {
+namespace acl {
+
+// This will do one time initialization but can be called multiple times
+void Initialize(void)
+{
+ arm_compute::CLScheduler::get().default_init();
+}
+
+} // namespace acl
+} // namespace kernel
+} // namespace nnfw