diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-07-25 13:31:10 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-09-09 11:22:01 +0000 |
commit | 12833d063259cb7809a97a4262f821efdc40554f (patch) | |
tree | 455333091c9eeba97079a385e0186f56076f5169 /tests/main.cpp | |
parent | ed0e35bfe15bad01387504afc15b8553e585bdb9 (diff) | |
download | ComputeLibrary-12833d063259cb7809a97a4262f821efdc40554f.tar.gz |
COMPMID-2204: RuntimeContext interface for NEON functions.
This patch creates the interfaces for the runtime context for NEON.
Only the Neon backend implements the context which currently only holds
an instance of the scheduler.
The NEActivationLayer function has been updated to use the new context
interface and the corresponding validation tests ported.
Change-Id: I32e7e6aa888796dcbbfc5039b1e7f784a24f47da
Signed-off-by: Pablo Tello <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1851
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'tests/main.cpp')
-rw-r--r-- | tests/main.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/main.cpp b/tests/main.cpp index 9690eb9a00..01741939a0 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -23,6 +23,7 @@ */ #include "support/ToolchainSupport.h" #include "tests/AssetsLibrary.h" +#include "tests/ParametersLibrary.h" #include "tests/framework/DatasetModes.h" #include "tests/framework/Exceptions.h" #include "tests/framework/Framework.h" @@ -31,6 +32,7 @@ #include "tests/framework/command_line/CommonOptions.h" #include "tests/framework/instruments/Instruments.h" #include "tests/framework/printers/Printers.h" +#include "tests/instruments/Helpers.h" #include "utils/command_line/CommandLineOptions.h" #include "utils/command_line/CommandLineParser.h" @@ -72,7 +74,8 @@ namespace arm_compute { namespace test { -std::unique_ptr<AssetsLibrary> library; +std::unique_ptr<AssetsLibrary> library; +std::unique_ptr<ParametersLibrary> parameters; } // namespace test } // namespace arm_compute @@ -167,7 +170,20 @@ int main(int argc, char **argv) std::vector<std::unique_ptr<framework::Printer>> printers = options.create_printers(); + // Setup CPU Scheduler Scheduler::get().set_num_threads(threads->value()); + + // Create CPU context + auto cpu_ctx = support::cpp14::make_unique<RuntimeContext>(); + cpu_ctx->set_scheduler(&Scheduler::get()); + + // Track CPU context + auto cpu_ctx_track = support::cpp14::make_unique<ContextSchedulerUser>(cpu_ctx.get()); + + // Create parameters + parameters = support::cpp14::make_unique<ParametersLibrary>(); + parameters->set_cpu_ctx(std::move(cpu_ctx)); + #ifdef ARM_COMPUTE_CL if(enable_tuner->is_set()) { @@ -232,7 +248,19 @@ int main(int argc, char **argv) } } - framework.init(options.instruments->value(), options.iterations->value(), dataset_mode->value(), filter->value(), filter_id->value(), options.log_level->value()); + // Setup instruments meta-data + framework::InstrumentsInfo instruments_info; + instruments_info._scheduler_users.push_back(cpu_ctx_track.get()); + framework.set_instruments_info(instruments_info); + + // Initialize framework + framework.init(options.instruments->value(), + options.iterations->value(), + dataset_mode->value(), + filter->value(), + filter_id->value(), + options.log_level->value()); + for(auto &p : printers) { framework.add_printer(p.get()); |