Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace addon

Index

Type aliases

DeviceBuffer

DeviceBuffer: DeviceBuffer

MemoryResource

MemoryResource: MemoryResource

setPerDeviceResource

setPerDeviceResource: setPerDeviceResource

Variables

DeviceBuffer

DeviceBuffer: typeof DeviceBuffer

MemoryResource

MemoryResource: typeof MemoryResource

_cpp_exports

_cpp_exports: any

per_device_resources

per_device_resources: MemoryResource[]

Functions

getCurrentDeviceResource

  • getCurrentDeviceResource(): MemoryResource

getPerDeviceResource

  • getPerDeviceResource(deviceId: number): MemoryResource
  • summary

    Get the MemoryResource for the specified device.


    Returns the MemoryResource set for the specified device. The initial resource is a CudaMemoryResource.


    deviceId must be in the range [0, Device.numDevices), otherwise behavior is undefined.

    note

    The returned MemoryResource should only be used when CUDA device deviceId is the current device (e.g. set using Device.activate()). 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.

    Parameters

    • deviceId: number

      The id of the target device

    Returns MemoryResource

    The current MemoryResource for device deviceId

setCurrentDeviceResource

  • setCurrentDeviceResource(memoryResource: MemoryResource): MemoryResource
  • summary

    Set the memory resource for the current device.


    If memoryResource is not null, sets the MemoryResource for the current device to memoryResource. If memoryResource is null or undefined, no action is taken.


    The "current device" is the device specified by Device.activeDeviceId.


    The memoryResource must outlive the last use of the resource, otherwise behavior is undefined. It is the caller's responsibility to maintain the lifetime of the memoryResource object.


    note

    The supplied memoryResource must have been created for the current CUDA device. 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.

    Parameters

    • memoryResource: MemoryResource

      If not null, the new resource to use for the current device.

    Returns MemoryResource

    The previous MemoryResource for the current device

setPerDeviceResource

  • setPerDeviceResource(deviceId: number, memoryResource: MemoryResource): MemoryResource
  • summary

    Set the MemoryResource for the specified device.

    If memoryResource is not null, sets the memory resource pointer for the device specified by deviceId to memoryResource. If memoryResource is null or undefined, no action is taken.


    deviceId must be in the range [0, Device.numDevices), otherwise behavior is undefined.


    The memoryResource must outlive the last use of the resource, otherwise behavior is undefined. It is the caller's responsibility to maintain the lifetime of the memoryResource object.

    note

    The supplied memoryResource must have been created for the current CUDA device. 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.

    Parameters

    • deviceId: number

      The id of the target device

    • memoryResource: MemoryResource

      If not null, the new MemoryResource to use for device deviceId.

    Returns MemoryResource

    The previous MemoryResource for device deviceId