This section describes the context management functions of HIP runtime API.
◆ hipDevicePrimaryCtxGetState()
hipError_t hipDevicePrimaryCtxGetState |
( |
hipDevice_t |
dev, |
|
|
unsigned int * |
flags, |
|
|
int * |
active |
|
) |
| |
Get the state of the primary context.
- Parameters
-
[in] | dev | Device to get primary context flags for |
[out] | flags | Pointer to store flags |
[out] | active | Pointer to store context state; 0 = inactive, 1 = active |
- Returns
- hipSuccess
- See also
- hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
◆ hipDevicePrimaryCtxRelease()
hipError_t hipDevicePrimaryCtxRelease |
( |
hipDevice_t |
dev | ) |
|
◆ hipDevicePrimaryCtxReset()
hipError_t hipDevicePrimaryCtxReset |
( |
hipDevice_t |
dev | ) |
|
◆ hipDevicePrimaryCtxRetain()
hipError_t hipDevicePrimaryCtxRetain |
( |
hipCtx_t * |
pctx, |
|
|
hipDevice_t |
dev |
|
) |
| |
Retain the primary context on the GPU.
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
- Parameters
-
[out] | pctx | Returned context handle of the new context |
[in] | dev | Device which primary context is released |
- Returns
- hipSuccess
- See also
- hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
◆ hipDevicePrimaryCtxSetFlags()
hipError_t hipDevicePrimaryCtxSetFlags |
( |
hipDevice_t |
dev, |
|
|
unsigned int |
flags |
|
) |
| |
Set flags for the primary context.
- Parameters
-
[in] | dev | Device for which the primary context flags are set |
[in] | flags | New flags for the device |
- Returns
- hipSuccess, #hipErrorContextAlreadyInUse
- See also
- hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice