warp.DeviceLike#

warp.DeviceLike = warp.Device | str | None#

Annotation for arguments that Warp resolves to a Device.

A DeviceLike value can be:

  • A Device object, used as is.

  • A device alias, such as "cpu", "cuda:0", or an alias registered with map_cuda_device(). The alias "cuda" refers to the current CUDA device.

  • None, which refers to the default device. Some functions may document a different meaning for None.

get_device() returns the Device that a value refers to. See Devices for the available aliases and how to change the default device.