This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to pass IRuntimePtr to another function?

In my ARMNN network initialization routine I am creating an ARMNN runtime like this:

    armnn::IRuntimePtr runtime = armnn::IRuntime::Create(armnn::IRuntime::CreationOptions());

    armnn::IOptimizedNetworkPtr optNet = Optimize(*network, backends, runtime->GetDeviceSpec(), armnn::OptimizerOptions());

    runtime->LoadNetwork(networkId, std::move(optNet), errorMessage);

I need to run the network in another C++ function.  How can I pass the runtime pointer to that other function?  Or, is there a way for the other function to retrieve the pointer to the runtime?

Parents
  • It depends if you are training the model, say using Tensorflow, you can do that entirely with x-86 if you want to.
    Then that model can be used by the ArmNN on your board to run inferences.

    If you need to link the arm64 Arm NN libraries to an executable or library then that executable/library needs to be compiling for arm64 as well. So you would have to use the cross compiler. I had a similar issue while working on chatbot development services for my company, and if you visit that page you will get to know how handled it.

    Profiling is enabled using the ExternalProfilingOptions inside IRuntime::CreationOptions, which are passed in when Runtime is created.

    Like this for example:

    IRuntime::CreationOptions options;
    options.m_ProfilingOptions.m_EnableProfiling = true;
    options.m_ProfilingOptions.m_TimelineEnabled = true;
    IRuntimePtr runtime(IRuntime::Create(options));

    Some executables calling Arm NN, like ExecuteNetwork, may also have a command line option to do this.
    With ExecuteNetwork it is -a for instance.

Reply
  • It depends if you are training the model, say using Tensorflow, you can do that entirely with x-86 if you want to.
    Then that model can be used by the ArmNN on your board to run inferences.

    If you need to link the arm64 Arm NN libraries to an executable or library then that executable/library needs to be compiling for arm64 as well. So you would have to use the cross compiler. I had a similar issue while working on chatbot development services for my company, and if you visit that page you will get to know how handled it.

    Profiling is enabled using the ExternalProfilingOptions inside IRuntime::CreationOptions, which are passed in when Runtime is created.

    Like this for example:

    IRuntime::CreationOptions options;
    options.m_ProfilingOptions.m_EnableProfiling = true;
    options.m_ProfilingOptions.m_TimelineEnabled = true;
    IRuntimePtr runtime(IRuntime::Create(options));

    Some executables calling Arm NN, like ExecuteNetwork, may also have a command line option to do this.
    With ExecuteNetwork it is -a for instance.

Children
No data