I have to solve a mathematical problem which can be either dense or sparse for different time values. I would like to use the GPU for the first and the CPU for the second (assuming the switch does not occur too often to make the process inefficient).
AFAIK, ArrayFire can be configured to use both the CPU and the GPU, but this has limitations, e.g. I cannot define a matrix to be used in both configurations.
Is there a way to achieve this approach?
Can a matrix be shared among CPU and GPU, and be processed by one of them at a time?
Can two matrices, with different characteristics, be processed one by the CPU and one by the GPU?