Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CudaMemoryResource

summary

MemoryResource that uses cudaMalloc/Free for allocation/deallocation.

Hierarchy

Index

Constructors

constructor

  • summary

    Constructs a MemoryResource which allocates distinct chunks of CUDA GPU memory.

    Parameters

    • Optional device: number

      The device ordinal on which to allocate memory (optional).

    Returns CudaMemoryResource

Properties

Readonly supportsGetMemInfo

supportsGetMemInfo: boolean
summary

A boolean indicating whether the resource supports the getMemInfo() API.

Readonly supportsStreams

supportsStreams: boolean
summary

A boolean indicating whether the resource supports use of non-null CUDA streams for allocation/deallocation.

Methods

getMemInfo

  • getMemInfo(stream?: number): [number, number]
  • Queries the amount of free and total memory for the resource.

    Parameters

    • Optional stream: number

      the stream whose memory manager we want to retrieve

    Returns [number, number]

    a tuple which contains [free memory, total memory] (in bytes)

isEqual

  • isEqual(other: MemoryResource): boolean
  • summary

    Compare this resource to another.

    remarks

    Two CudaMemoryResource instances always compare equal, because they can each deallocate memory allocated by the other.

    Parameters

    • other: MemoryResource

      The other resource to compare to

    Returns boolean

    true if the two resources are equal, else false