mandelbrot_benchmark.backends package

Submodules

mandelbrot_benchmark.backends.jax module

mandelbrot_benchmark.backends.jax.mandelbrot_jax(c: Tensor) Tensor[source]

JAX implementation of the Mandelbrot set.

Parameters:

c (torch.Tensor) – Input array of complex numbers.

Returns:

Output array of integers representing the Mandelbrot set.

Return type:

torch.Tensor

mandelbrot_benchmark.backends.numba module

mandelbrot_benchmark.backends.numba.mandelbrot_numba(c: Any) Any[source]

Numba implementation of the Mandelbrot set.

Parameters:

c (Any) – Input array of complex numbers.

Returns:

Output array of integers representing the Mandelbrot set.

Return type:

Any

mandelbrot_benchmark.backends.taichi module

mandelbrot_benchmark.backends.taichi.mandebrot_taichi(c: Any) Any[source]

Taichi implementation of the Mandelbrot set.

Since Taichi does not support complex numbers directly, internally the input is stacked as a +1D array with real and imaginary parts.

Taichi’s from_numpy() and to_numpy() are !!NOT!! zero-copy, so we pass non-Taichi arrays directly to the kernel. (See “Note” in https://docs.taichi-lang.org/docs/external)

See also

https

//docs.taichi-lang.org/docs/external

mandelbrot_benchmark.backends.torch module

mandelbrot_benchmark.backends.torch.mandelbrot_torch(c: Any) Any[source]

Pure Python implementation of the Mandelbrot set.

mandelbrot_benchmark.backends.warp module

mandelbrot_benchmark.backends.warp.mandelbrot_warp(c: Tensor) Tensor[source]

Warp implementation of the Mandelbrot set.

Warp converts external arrays to its own format zero-copy, therefore we do not need to worry about it.

See also

https

//nvidia.github.io/warp/modules/interoperability.html