#include "model.h"
#include "logging.h"
-template<typename T> T from_env(const char *);
+template <typename T> T from_env(const char *);
-template<> bool from_env(const char *s)
+template <> bool from_env(const char *s)
{
if (s == nullptr)
{
// NOTE CLArithmeticAddition emits incorrect values for ADAS model.
// TODO Figure out why this happens, and fix it
- if(from_env<bool>(std::getenv("USE_CL_ARITHMETIC_ADDTION")))
+ if (from_env<bool>(std::getenv("USE_CL_ARITHMETIC_ADDTION")))
{
auto l = make_layer<::arm_compute::CLArithmeticAddition>();
#include "event.h"
-int ANeuralNetworksEvent_wait(ANeuralNetworksEvent *event)
-{
- return ANEURALNETWORKS_NO_ERROR;
-}
+int ANeuralNetworksEvent_wait(ANeuralNetworksEvent *event) { return ANEURALNETWORKS_NO_ERROR; }
-void ANeuralNetworksEvent_free(ANeuralNetworksEvent *event)
-{
- delete event;
-}
+void ANeuralNetworksEvent_free(ANeuralNetworksEvent *event) { delete event; }
}
int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution *execution, int32_t index,
- const ANeuralNetworksOperandType *type,
- const void *buffer, size_t length)
+ const ANeuralNetworksOperandType *type, const void *buffer,
+ size_t length)
{
const auto &operands = execution->plan().model().operands();
return ANEURALNETWORKS_NO_ERROR;
}
-void ANeuralNetworksExecution_free(ANeuralNetworksExecution *execution)
-{
-}
+void ANeuralNetworksExecution_free(ANeuralNetworksExecution *execution) {}
#include "GenericReshapeLayer.h"
-void GenericReshapeLayer::configure(::arm_compute::ICLTensor *input, ::arm_compute::ICLTensor *output)
+void GenericReshapeLayer::configure(::arm_compute::ICLTensor *input,
+ ::arm_compute::ICLTensor *output)
{
_input = input;
_output = output;
class SimpleArithmeticAdditionLayer : public ::arm_compute::IFunction
{
public:
- void configure(::arm_compute::ICLTensor *lhs, ::arm_compute::ICLTensor *rhs, ::arm_compute::ICLTensor *out)
+ void configure(::arm_compute::ICLTensor *lhs, ::arm_compute::ICLTensor *rhs,
+ ::arm_compute::ICLTensor *out)
{
_lhs = lhs;
_rhs = rhs;
return ANEURALNETWORKS_NO_ERROR;
}
-void ANeuralNetworksMemory_free(ANeuralNetworksMemory *memory)
-{
- delete memory;
-}
+void ANeuralNetworksMemory_free(ANeuralNetworksMemory *memory) { delete memory; }
//
// ANeuralNetworksMemory
return ANEURALNETWORKS_NO_ERROR;
}
-void ANeuralNetworksModel_free(ANeuralNetworksModel *model)
-{
- delete model;
-}
+void ANeuralNetworksModel_free(ANeuralNetworksModel *model) { delete model; }
int ANeuralNetworksModel_addOperand(ANeuralNetworksModel *model,
const ANeuralNetworksOperandType *type)
return ANEURALNETWORKS_NO_ERROR;
}
-int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel *model,
- int32_t index,
+int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel *model, int32_t index,
const ANeuralNetworksMemory *memory,
size_t offset, size_t length)
{
return ANEURALNETWORKS_NO_ERROR;
}
-int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel *model,
- uint32_t inputCount,
- const uint32_t *inputs,
- uint32_t outputCount,
+int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel *model, uint32_t inputCount,
+ const uint32_t *inputs, uint32_t outputCount,
const uint32_t *outputs)
{
// NOTE ::internal::tflite::operand::Index uses int as its underlying type as various NNAPI
return ANEURALNETWORKS_NO_ERROR;
}
-int ANeuralNetworksModel_finish(ANeuralNetworksModel *model)
-{
- return ANEURALNETWORKS_NO_ERROR;
-}
+int ANeuralNetworksModel_finish(ANeuralNetworksModel *model) { return ANEURALNETWORKS_NO_ERROR; }
//
// ANeuralNetworksModel
#include <iostream>
-#define SHOW_FUNC_ENTRY(name) { \
- std::cout << #name << " is at " << reinterpret_cast<void *>(name) << std::endl; \
-}
+#define SHOW_FUNC_ENTRY(name) \
+ { \
+ std::cout << #name << " is at " << reinterpret_cast<void *>(name) << std::endl; \
+ }
int main(int argc, char **argv)
{
// NOTE Pure CL runtime does not implement following NN API(s) as
// Tensorflow Lite does not use these API(s)
- //SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_free);
- //SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_setPreference);
- //SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setInputFromMemory);
- //SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setOutputFromMemory);
+ // SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_free);
+ // SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_setPreference);
+ // SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setInputFromMemory);
+ // SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setOutputFromMemory);
return 0;
}