ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

mixed mode CPU + GPU

Open joel-mi opened this issue 9 years ago • 2 comments

We are considering an implementation of Convolution Neural Network in which some layers will run on CPU while other layers will run on GPU As I understand, for running on CPU we need to build the ComputeLibrary with neon=1 and opencl=0, while for GPU we have to set neon=0 and opencl=1 - is this right ? If so, we would need to build 2 different copies of ComputeLibrary, with those 2 different settings; will it then be possible to link those 2 copies together with our code ? Or would we expect double or conflicting definitions ?

joel-mi avatar May 09 '17 07:05 joel-mi

No, you can build a single library with both neon=1 and opencl=1. You can then use the NE* functions to execute code on the CPU and the CL* functions to run on the GPU. To share Tensors between CPU and GPU they need to be CLTensors and when they are used with Neon functions they have to be mapped (and unmapped).

mpflanzer avatar May 09 '17 07:05 mpflanzer

Thanks !

joel-mi avatar May 09 '17 10:05 joel-mi