Cooperative parallel memory allocation
AssigneeNVIDIA Corporation
InventorHarold Carter Edwards
Life of this patent
Estimating the term…
Abstract
Apparatuses, systems, and techniques to perform multi-threaded memory allocation in parallel by one or more software programs being performed on a parallel processing unit (PPU), such as a graphics processing unit (GPU), or any other processing unit capable of supporting multi-threaded software execution. In at least one embodiment, one or more software programs expressed in part by code using an application programming interface for parallel computing, such as CUDA, perform allocation, search, and deallocation of memory efficiently and in parallel on a GPU.
Claims42
One or more processors comprising:
- circuitry to exclusively allocate two or more memory portions to two or more software threads independently in parallel by:
- searching one or more memory blocks of a tree data structure for a block having at least a number of allocable bins corresponding to an amount of memory to be used by a software thread;
- in response to determining that a candidate memory block has at least the number of allocable bins, locking the candidate memory block by incrementing a reference count stored in a parent memory block of the candidate memory block;
- and
- updating a state value stored in the parent memory block to indicate that the candidate memory block is allocated to the software thread.
A system, comprising:
- one or more processors to exclusively allocate two or more memory portions to two or more software threads independently in parallel by:
- searching one or more memory blocks of a tree data structure for a block having at least a number of allocable bins corresponding to an amount of memory to be used by a software thread;
- in response to determining that a candidate memory block has at least the number of allocable bins, locking the candidate memory block by incrementing a reference count stored in a parent memory block of the candidate memory block;
- and
- updating a state value stored in the parent memory block to indicate that the candidate memory block is allocated to the software thread.
A non-transitory machine-readable medium having stored thereon an application programming interface (API), which if performed at least in part by one or more processors, cause the one or more processors to at least:
- exclusively allocate, by the API, two or more memory portions to two or more software threads independently in parallel by:
- searching one or more memory blocks of a tree data structure for a block having at least a number of allocable bins corresponding to an amount of memory to be used by a software thread;
- in response to determining that a candidate memory block has at least the number of allocable bins, locking the candidate memory block by incrementing a reference count stored in a parent memory block of the candidate memory block;
- and
- updating a state value stored in the parent memory block to indicate that the candidate memory block is allocated to the software thread.
A method, comprising:
- exclusively allocating two or more memory portions to two or more software threads independently in parallel by:
- searching one or more memory blocks of a tree data structure for a block having at least a number of allocable bins corresponding to an amount of memory to be used by a software thread;
- in response to determining that a candidate memory block has at least the number of allocable bins, locking the candidate memory block by incrementing a reference count stored in a parent memory block of the candidate memory block;
- and
- updating a state value stored in the parent memory block to indicate that the candidate memory block is allocated to the software thread.
Dependencies are inferred from the claim text.