Feature gpu for 0.2.4

The code of “Solving your first problem with Bempp” cannot run under bempp 0.2.4.
The error it causes:

RuntimeError: Could not find suitable OpenCL CPU driver.

I read the code of bempp 0.2.4 and found that it does not support gpu, but earlier versions (e.g. 0.2.1) support gpu. I changed the device_type='cpu' in the source code to device_type='gpu' and it can run successfully. Is this safe? When is the latest version of bempp expected to support gpu? How can I use GPU to speed up my calculations now? Thank you!


all our OpenCL compute kernels can run on CPUs and GPUs. The question is performance. For dense matrix assembly CPUs are most of the time faster due to memory transfer overhead onto the device. For domain potential operators the picture looks different. Here, GPU codes are often faster. You can find details at: https://discovery.ucl.ac.uk/id/eprint/10129932/1/main.pdf

Best wishes


Thank you so much for replying, I got it.

I also have question about GPU support in current version (0.2.4)
I am on Windows and AMD CPU, so there is no official OpenCL CPU driver. There is no readily available pocl driver for Windows as well (I’ve tried to build one from source, but after a day of headache I gave up).
But I have NVIDIA GPU, so I would like to try it instead of Numba for better performance. Anyway when I set in my code:
And operator keywords:
assembler=“dense”, device_interface=“opencl”
I get error:
Could not find suitable OpenCL CPU driver.
(If I don’t pass keywords, no errors, but it seems that calculation is performed with Numba on CPU. GPU is not loaded at all)
I’ve tried to edit source code as hellojxt proposed, but I get another errors. Sorry, I am new to Python (worked mostly in Matlab previously), so I am afraid to break the code.
May be it is easier to setup Linux on my computer to get pocl working. But I anticipate another problems with that due to no experience with Linux at all.
Would be nice to get some information on all this…

PS: Anyway even with Numba BEMpp gives tremendous speed comparing to other BEM libraries I’ve tried so far. But you always want faster when it comes to such stuff… =)