Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ManagedMemoryResource

summary

MemoryResource that uses cudaMallocManaged/Free for allocation/deallocation.

Hierarchy

Index

Constructors

constructor

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