numba-pro

Matplotlib with Numba to try and accelerate code

Matplotlib with Numba to try and accelerate code Question: How could I use numba for the following code to try and accelerate it? When I add @njit before func1 several error returns? Or would there be another way to optimise/accelerate the code to reduce the overall process time as depeding on the number of iterations …

Total answers: 1

Numba "LoweringError" for complex numbers in numpy array

Numba "LoweringError" for complex numbers in numpy array Question: I have to make a calculation using complex arrays, however when using numba to speed up the process I get an error numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend). Here it is a simplified version of my code: import numpy as np from …

Total answers: 2

Python square brackets between function name and arguments: func[…](…)

Python square brackets between function name and arguments: func[…](…) Question: I was learning how to accelerate python computations on GPU from this notebook, where one line confuses me: mandel_kernel[griddim, blockdim](-2.0, 1.0, -1.0, 1.0, d_image, 20) Here, mandel_kernel is a decorated (by cuda.jit) function, griddim and blockdim are tuples of length 2: griddim=(32,16), blockdim=(32,8). Is this …

Total answers: 2