The MemoryResource for the current device
The id of the target device
The current MemoryResource for device deviceId
If not null, the new resource to use for the current device.
The previous MemoryResource for the current device
The id of the target device
If not null, the new MemoryResource to use for device deviceId.
The previous MemoryResource for device deviceId
Get the MemoryResource for the current device.
Returns the MemoryResource set for the current device. The initial resource is a CudaMemoryResource.
The "current device" is the device specified by Device.activeDeviceId.
The returned MemoryResource should only be used with the current CUDA device. Changing the current device (e.g. calling
Device.activate()) and then using the returned resource can result in undefined behavior. The behavior of a MemoryResource is undefined if used while the active CUDA device is a different device from the one that was active when the MemoryResource was created.