Forums - Offload to CPU or GPU

2 posts / 0 new
Last post
Offload to CPU or GPU
bnarendar89
Join Date: 21 Jan 19
Posts: 5
Posted: Thu, 2019-04-04 02:14

Hi ,

I have get started with SNPE SDK and able to run the sample app on Device(Tensorflow model).

I request you to know , How could we off load the app to CPU or GPU .

I would like to know , is there any SNPE SDK API's to off load the work from CPU to GPU or vice versa?

Thanks,

Narendar.

 

  • Up0
  • Down0
gesqdn-forum
Join Date: 4 Nov 18
Posts: 184
Posted: Tue, 2019-05-07 08:23

Hi,

We can offload the task from CPU to GPU or vice-versa.

final SNPE.NeuralNetworkBuilder builder = new SNPE.NeuralNetworkBuilder(application)
    .setRuntimeOrder(DSP, GPU, CPU)
    .setModel(new File("<model-path>"));
final NeuralNetwork network = builder.build();
network.release();


The above code snippet from SNPE SDK android example loads and run on the runtime (CPU, GPU, DSP) available using setRuntimeOrder() module. The choice of runtime selected depends on the order provide to setRuntimeOrder().
You can refer the  Configuring a Neural Network instructions section from SNPE Docs for reference.

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.