+++ /dev/null
-file(GLOB_RECURSE SOURCES "src/*.cpp")
-
-add_library(nnfw_lib_nnapi STATIC ${SOURCES})
-set_property(TARGET nnfw_lib_nnapi PROPERTY POSITION_INDEPENDENT_CODE ON)
-target_include_directories(nnfw_lib_nnapi PUBLIC ${CMAKE_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include)
-target_link_libraries(nnfw_lib_nnapi nnfw_lib_misc)
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file Reader.h
- * @brief This file contains Reader class
- * @ingroup COM_AI_RUNTIME
- */
-
-#ifndef __NNFW_NNAPI_FEATURE_READER_H__
-#define __NNFW_NNAPI_FEATURE_READER_H__
-
-#include "nnapi/feature/Utils.h"
-
-#include "misc/feature/Shape.h"
-#include "misc/feature/Reader.h"
-
-namespace nnfw
-{
-namespace nnapi
-{
-namespace feature
-{
-
-/**
- * @brief Class to read value of feature which is inherited
- * from nnfw::misc::feature::Reader<T> class
- */
-template <typename T> class Reader : public nnfw::misc::feature::Reader<T>
-{
-public:
- /**
- * @brief Construct a new Reader object with base and shape informations
- * @param[in] shape The shape of a feature
- * @param[in] base The base address of a feature
- */
- Reader(const nnfw::misc::feature::Shape &shape, const T *base) : _shape{shape}, _base{base}
- {
- // DO NOTHING
- }
-
-public:
- /**
- * @brief Get the value used by three indexes
- * @param[in] ch The channel index
- * @param[in] row The row index
- * @param[in] col The column index
- * @return The value at the offset
- */
- T at(uint32_t ch, uint32_t row, uint32_t col) const override
- {
- return *(_base + indexOf(_shape, ch, row, col));
- }
-
-private:
- nnfw::misc::feature::Shape _shape; /**< Shape of feature */
- const T *_base; /**< Base address of feature */
-};
-
-} // namespace feature
-} // namespace nnapi
-} // namespace nnfw
-
-#endif // __NNFW_NNAPI_FEATURE_READER_H__
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file Utils.h
- * @brief This file contains indexOf function
- * @ingroup COM_AI_RUNTIME
- */
-
-#ifndef __NNFW_NNAPI_FEATURE_UTILS_H__
-#define __NNFW_NNAPI_FEATURE_UTILS_H__
-
-#include "misc/feature/Shape.h"
-
-#include <cstdint>
-
-namespace nnfw
-{
-namespace nnapi
-{
-namespace feature
-{
-
-/**
- * @brief Get index for given parameters
- * @param[in] shape The shape of feature
- * @param[in] ch The channel index
- * @param[in] row The row index
- * @param[in] col The column index
- * @return The value index of given parameters
- */
-uint32_t indexOf(const nnfw::misc::feature::Shape &shape, uint32_t ch, uint32_t row, uint32_t col);
-
-} // namespace feature
-} // namespace nnapi
-} // namespace nnfw
-
-#endif // __NNFW_NNAPI_FEATURE_UTILS_H__
+++ /dev/null
-#include "nnapi/Utils.h"
-
-#include <cassert>
-
-namespace nnfw
-{
-namespace nnapi
-{
-
-const char *to_string(const PaddingCode &code)
-{
- assert((ANEURALNETWORKS_PADDING_SAME == code) || (ANEURALNETWORKS_PADDING_VALID == code));
-
- switch (code)
- {
- case ANEURALNETWORKS_PADDING_SAME:
- return "ANEURALNETWORKS_PADDING_SAME";
- case ANEURALNETWORKS_PADDING_VALID:
- return "ANEURALNETWORKS_PADDING_VALID";
- }
-
- return nullptr;
-}
-
-} // namespace nnapi
-} // namespace nnfw
target_link_libraries(${LIB_NEURUN} arm_compute)
target_link_libraries(${LIB_NEURUN} tensorflow-lite)
target_link_libraries(${LIB_NEURUN} nnfw_lib_misc)
-target_link_libraries(${LIB_NEURUN} nnfw_lib_nnapi)
target_link_libraries(${LIB_NEURUN} nnfw_lib_cpp14)
target_compile_options(${LIB_NEURUN} PRIVATE -Wall -Wextra -Werror)
target_include_directories(${LIB_NEURUN_BACKEND_ACL_CL} PUBLIC ${CMAKE_SOURCE_DIR}/externals/tensorflow) # TODO Remove this file. We should not need this.
target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} arm_compute)
-target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} nnfw_lib_nnapi)
target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} ${LIB_NEURUN_KERNEL_ACL_CL})
target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} ${LIB_NEURUN})
#include "NeuralNetworks.h"
-#include "nnapi/Utils.h"
+#include "util/Utils.h"
template <typename T> std::unique_ptr<T> make_layer(void) { return std::unique_ptr<T>{new T}; }
VERBOSE(AvgPool2D) << "KER_W: " << kw << std::endl;
VERBOSE(AvgPool2D) << "STRIDE_H: " << vstride << std::endl;
VERBOSE(AvgPool2D) << "STRIDE_W: " << hstride << std::endl;
- VERBOSE(AvgPool2D) << "PAD: " << ::nnfw::nnapi::to_string(padding_type) << std::endl;
+ VERBOSE(AvgPool2D) << "PAD: " << neurun::util::to_string(padding_type) << std::endl;
VERBOSE(AvgPool2D) << "PAD(T): " << param.padding.top << std::endl;
VERBOSE(AvgPool2D) << "PAD(B): " << param.padding.bottom << std::endl;
VERBOSE(AvgPool2D) << "PAD(L): " << param.padding.left << std::endl;
#include "util/logging.h"
-#include "nnapi/Utils.h"
+#include "util/Utils.h"
namespace neurun
{
VERBOSE(AvgPool2D) << "KER_W: " << kw << std::endl;
VERBOSE(AvgPool2D) << "STRIDE_H: " << vstride << std::endl;
VERBOSE(AvgPool2D) << "STRIDE_W: " << hstride << std::endl;
- VERBOSE(AvgPool2D) << "PAD: " << ::nnfw::nnapi::to_string(padding_type) << std::endl;
+ VERBOSE(AvgPool2D) << "PAD: " << util::to_string(padding_type) << std::endl;
VERBOSE(AvgPool2D) << "PAD(T): " << param.padding.top << std::endl;
VERBOSE(AvgPool2D) << "PAD(B): " << param.padding.bottom << std::endl;
VERBOSE(AvgPool2D) << "PAD(L): " << param.padding.left << std::endl;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* limitations under the License.
*/
-#include "nnapi/feature/Utils.h"
+#include "Utils.h"
-namespace nnfw
-{
-namespace nnapi
+#include <cassert>
+
+namespace neurun
{
-namespace feature
+namespace util
{
-uint32_t indexOf(const nnfw::misc::feature::Shape &shape, uint32_t ch, uint32_t row, uint32_t col)
+const char *to_string(const PaddingCode &code)
{
- uint32_t res = 0;
+ assert((ANEURALNETWORKS_PADDING_SAME == code) || (ANEURALNETWORKS_PADDING_VALID == code));
- // NNAPI assumes that NHWC ordering for feature map
- res += row * shape.W * shape.C;
- res += col * shape.C;
- res += ch;
+ switch (code)
+ {
+ case ANEURALNETWORKS_PADDING_SAME:
+ return "ANEURALNETWORKS_PADDING_SAME";
+ case ANEURALNETWORKS_PADDING_VALID:
+ return "ANEURALNETWORKS_PADDING_VALID";
+ }
- return res;
+ return nullptr;
}
-} // namespace feature
-} // namespace nnapi
-} // namespace nnfw
+} // namespace util
+} // namespace neurun
* @ingroup COM_AI_RUNTIME
*/
-#ifndef __NNFW_NNAPI_UTILS_H__
-#define __NNFW_NNAPI_UTILS_H__
+#ifndef __NEURUN_UTIL_UTILS_H__
+#define __NEURUN_UTIL_UTILS_H__
#include "NeuralNetworks.h"
-namespace nnfw
+namespace neurun
{
-namespace nnapi
+namespace util
{
/**
*/
const char *to_string(const PaddingCode &code);
-} // namespace nnapi
-} // namespace nnfw
+} // namespace util
+} // namespace neurun
-#endif // __NNFW_NNAPI_UTILS_H__
+#endif // __NEURUN_UTIL_UTILS_H__