vibeproj.runtime

GPU/CPU runtime detection and array module selection.

Functions

get_array_module([x])

Return the array module (numpy or cupy) for the given array.

gpu_available(→ bool)

Check if CuPy is available and a GPU is accessible.

to_device(x, xp)

Ensure array x is on the device managed by xp.

Module Contents

vibeproj.runtime.get_array_module(x=None)

Return the array module (numpy or cupy) for the given array.

If x is None or not a CuPy array, returns numpy.

vibeproj.runtime.gpu_available() bool

Check if CuPy is available and a GPU is accessible.

vibeproj.runtime.to_device(x, xp)

Ensure array x is on the device managed by xp.