Initialization

CUDAnative.device!Method
device!(dev::Integer)
device!(dev::CuDevice)

Sets dev as the current active device for the calling host thread. Devices can be specified by integer id, or as a CuDevice (slightly faster).

Although this call is fairly cheap (50-100ns), it is only intended for interactive use, or for initial set-up of the environment. If you need to switch devices on a regular basis, work with contexts instead and call context! directly (5-10ns).

If your library or code needs to perform an action when the active context changes, add a hook using CUDAnative.atcontextswitch.

CUDAnative.device_reset!Function
device_reset!(dev::CuDevice=device())

Reset the CUDA state associated with a device. This call with release the underlying context, at which point any objects allocated in that context will be invalidated.