import numpy as np
import pyclesperanto_prototype as cle
import timeit
cle.select_device("RTX")
<NVIDIA GeForce RTX 3050 Ti Laptop GPU on Platform: NVIDIA CUDA (1 refs)>
inp = cle.create((1024, 1024, 40))
out = cle.create((1024, 1024, 40))
%timeit cle.add_image_and_scalar(inp, out, scalar = 5)
The slowest run took 10.12 times longer than the fastest. This could mean that an intermediate result is being cached. 2.31 ms ± 1.79 ms per loop (mean ± std. dev. of 7 runs, 1000 loops each)
cle.select_device("cupy")
'cupy backend (experimental)'
inp = cle.create((1024, 1024, 40))
out = cle.create((1024, 1024, 40))
%timeit cle.add_image_and_scalar(inp, out, scalar = 5)
c:\structure\code\pyclesperanto_prototype\pyclesperanto_prototype\_tier0\_cuda_backend.py:31: UserWarning: clesperanto's cupy / CUDA backend is experimental. Please use it with care. The following functions are known to cause issues in the CUDA backend: affine_transform, apply_vector_field, create(uint64), create(int32), create(int64), label_spots, labelled_spots_to_pointlist, resample, scale, spots_to_pointlist warnings.warn("clesperanto's cupy / CUDA backend is experimental. Please use it with care. The following functions are known to cause issues in the CUDA backend:\n" +
The slowest run took 7.37 times longer than the fastest. This could mean that an intermediate result is being cached. 1.23 ms ± 1.02 ms per loop (mean ± std. dev. of 7 runs, 1000 loops each)