warp.get_device_allocator#

warp.get_device_allocator(device)[source]#

Get the current effective memory allocator for a device.

For CUDA devices, returns the custom allocator if one has been set via set_device_allocator() or set_cuda_allocator(), otherwise returns the device’s current built-in allocator.

For CPU devices, returns the default host memory allocator.

Parameters:

device (Device | str | None) – The device to query.

Returns:

The current allocator for the device.

Return type:

Allocator