Closed psyhtest closed 5 years ago
Suppose we call this test ck-armnn:program:mnist-armnn-tensorflow
. It will have a dependency on ArmNN with tags lib,armnn,tensorflow
. Then:
$ ck compile program:mnist-armnn-tensorflow
should do the equivalent of:
$ g++ -std=c++11 -I$(ARMNN_INC) mnist.cpp -o mnist -L$(ARMNN_LIB) -larmnn -larmnnTfParser
Furthermore, we enable execution via:
$ ck run program:mnist-armnn-tensorflow --env.CK_ARMNN_BACKEND=<backend>
where <backend>
is one of:
CpuRef
(default)CpuAcc
(Neon)GpuAcc
(OpenCL)The choice of <backend>
should be propagated to the call to armnn::Optimize
:
// Optimize the network for a specific runtime compute device, e.g. CpuAcc, GpuAcc
armnn::IRuntime::CreationOptions options;
armnn::IRuntimePtr runtime = armnn::IRuntime::Create(options);
armnn::IOptimizedNetworkPtr optNet = armnn::Optimize(*network, {armnn::Compute::CpuRef}, runtime->GetDeviceSpec());
The program can be linked against ArmNN configured with different backend support: reference, Neon, OpenCL, Neon + OpenCL.
If an invalid backend is given (e.g. backend=GpuAcc
and ArmNN was built without OpenCL support), either an error should happen or at least a warning given.
@bellycat77 Many thanks for creating the program. Please also copy LICENSE and create a simple README.me
in the program's directory describing how to compile and run it (including the environment variables).
@ens-lg4 To create automated Travis tests, do we need to move this repository to github.com/ctuning
first (and make it public then)?
Files LICENSE and README.md were added
@psyhtest Not necessarily, but Travis seems to provide free testing only for open-source. So there is still an option to auto-test private repositories, but at cost.
The interface has changed to --env.USE_NEON and --env.USE_OPENCL , otherwise it works fine.
Once we can configure ArmNN with TensorFlow and have a basic test, we should implement a more comprehensive test following the tutorial.