| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #pragma once |
|
|
| #include "middleware/runner.hpp" |
|
|
| #if defined(ENV_AXCL_RUNTIME_API_ENABLE) || defined(ENV_AXCL_NATIVE_API_ENABLE) |
|
|
| #include <functional> |
|
|
| namespace middleware { |
|
|
| class axcl_base : public runner { |
| public: |
| using npu_func = std::function<bool()>; |
|
|
| [[nodiscard]] static bool init(const std::string& config, const uint32_t& index, const npu_func& func); |
| [[nodiscard]] static bool final(const npu_func& func); |
|
|
| [[nodiscard]] bool flush_input() const override; |
| [[nodiscard]] bool invalidate_output() const override; |
|
|
| [[nodiscard]] bool feed(const std::string& input_folder, const std::string& stimulus_name) const override; |
| [[nodiscard]] bool verify(const std::string& output_folder, const std::string& stimulus_name) const override; |
| [[nodiscard]] bool save(const std::string& output_folder, const std::string& stimulus_name) const override; |
|
|
| private: |
| [[nodiscard]] static bool feed(const std::string& folder, const std::string& stimulus_name, const std::string& tensor_name, void* address, uintmax_t size) ; |
| [[nodiscard]] static bool verify(const std::string &folder, const std::string &stimulus_name, const std::string &tensor_name, void *address, uintmax_t size) ; |
| [[nodiscard]] static bool save(const std::string& output_folder, const std::string& stimulus_name, const std::string& tensor_name, void* address, uintmax_t size); |
| }; |
|
|
| } |
| #endif |
|
|