RAPIDS
    Preparing search index...

    Class BinningMemoryResource

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • upstreamMemoryResource: MemoryResource

        The MemoryResource to use for allocations larger than any of the bins.

      • OptionalminSizeExponent: number

        The base-2 exponent of the minimum size FixedSizeMemoryResource bin to create (optional).

      • OptionalmaxSizeExponent: number

        The base-2 exponent of the maximum size FixedSizeMemoryResource bin to create (optional).

      Returns BinningMemoryResource

      If minSizeExponent and maxSizeExponent are specified, initializes with one or more FixedSizeMemoryResource bins in the range [2^minSizeExponent, 2^maxSizeExponent].

      Call addBin to add additional bin allocators.

    Properties

    memoryResource: MemoryResource

    The MemoryResource to use for allocations larger than any of the bins.

    supportsGetMemInfo: boolean
    supportsStreams: boolean

    Methods

    • Parameters

      • byteLength: number

        The maximum allocation size in bytes for the created bin

      • OptionalbinResource: MemoryResource

        The resource to use for this bin (optional)

      Returns void

      If specified, uses binResource for allocation for this bin. If not specified, uses a FixedSizeMemoryResource for this bin's allocations.

      Allocations smaller than byteLength and larger than the next smaller bin size will use this fixed-size MemoryResource.

    • Queries the amount of free and total memory for the resource.

      Parameters

      • Optionalstream: number

        the stream whose memory manager we want to retrieve

      Returns [number, number]

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

    • Parameters

      • other: MemoryResource

        The other resource to compare to

      Returns boolean

      true if the two resources are equal, else false

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