Context Management [Deprecated]

Context Management [Deprecated]#

HIP Runtime API Reference: Context Management [Deprecated]
Context Management [Deprecated]
Collaboration diagram for Context Management [Deprecated]:

Functions

hipError_t hipCtxCreate (hipCtx_t *ctx, unsigned int flags, hipDevice_t device)
 Create a context and set it as current/default context [Deprecated].
 
hipError_t hipCtxDestroy (hipCtx_t ctx)
 Destroy a HIP context. [Deprecated].
 
hipError_t hipCtxPopCurrent (hipCtx_t *ctx)
 Pop the current/default context and return the popped context. [Deprecated].
 
hipError_t hipCtxPushCurrent (hipCtx_t ctx)
 Push the context to be set as current/ default context. [Deprecated].
 
hipError_t hipCtxSetCurrent (hipCtx_t ctx)
 Set the passed context as current/default. [Deprecated].
 
hipError_t hipCtxGetCurrent (hipCtx_t *ctx)
 Get the handle of the current/ default context. [Deprecated].
 
hipError_t hipCtxGetDevice (hipDevice_t *device)
 Get the handle of the device associated with current/default context. [Deprecated].
 
hipError_t hipCtxGetApiVersion (hipCtx_t ctx, int *apiVersion)
 Returns the approximate HIP api version. [Deprecated].
 
hipError_t hipCtxGetCacheConfig (hipFuncCache_t *cacheConfig)
 Get Cache configuration for a specific function. [Deprecated].
 
hipError_t hipCtxSetCacheConfig (hipFuncCache_t cacheConfig)
 Set L1/Shared cache partition. [Deprecated].
 
hipError_t hipCtxSetSharedMemConfig (hipSharedMemConfig config)
 Set Shared memory bank configuration.
 
hipError_t hipCtxGetSharedMemConfig (hipSharedMemConfig *pConfig)
 Get Shared memory bank configuration. [Deprecated].
 
hipError_t hipCtxSynchronize (void)
 Blocks until the default context has completed all preceding requested tasks. [Deprecated].
 
hipError_t hipCtxGetFlags (unsigned int *flags)
 Return flags used for creating default context.
 
hipError_t hipCtxEnablePeerAccess (hipCtx_t peerCtx, unsigned int flags)
 Enables direct access to memory allocations in a peer context. [Deprecated].
 
hipError_t hipCtxDisablePeerAccess (hipCtx_t peerCtx)
 Disable direct access from current context's virtual address space to memory allocations physically located on a peer context.Disables direct access to memory allocations in a peer context and unregisters any registered allocations. [Deprecated].
 

Detailed Description

This section describes the deprecated context management functions of HIP runtime API.

Function Documentation

◆ hipCtxCreate()

hipError_t hipCtxCreate ( hipCtx_t ctx,
unsigned int  flags,
hipDevice_t  device 
)

Create a context and set it as current/default context [Deprecated].

Parameters
[out]ctxContext to create
[in]flagsContext creation flags
[in]devicedevice handle
Returns
hipSuccess
See also
hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxDestroy()

hipError_t hipCtxDestroy ( hipCtx_t  ctx)

Destroy a HIP context. [Deprecated].

Parameters
[in]ctxContext to destroy
Returns
hipSuccess, hipErrorInvalidValue
See also
hipCtxCreate, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent,hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxDisablePeerAccess()

hipError_t hipCtxDisablePeerAccess ( hipCtx_t  peerCtx)

Disable direct access from current context's virtual address space to memory allocations physically located on a peer context.Disables direct access to memory allocations in a peer context and unregisters any registered allocations. [Deprecated].

Returns hipErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been enabled from the current device.

Parameters
[in]peerCtxPeer context to be disabled
Returns
hipSuccess, hipErrorPeerAccessNotEnabled
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
PeerToPeer support is experimental.
: This HIP API is deprecated.

◆ hipCtxEnablePeerAccess()

hipError_t hipCtxEnablePeerAccess ( hipCtx_t  peerCtx,
unsigned int  flags 
)

Enables direct access to memory allocations in a peer context. [Deprecated].

Memory which already allocated on peer device will be mapped into the address space of the current device. In addition, all future memory allocations on peerDeviceId will be mapped into the address space of the current device when the memory is allocated. The peer memory remains accessible from the current device until a call to hipDeviceDisablePeerAccess or hipDeviceReset.

Parameters
[in]peerCtxPeer context
[in]flagsflags, need to set as 0
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue, hipErrorPeerAccessAlreadyEnabled
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
PeerToPeer support is experimental.
: This HIP API is deprecated.

◆ hipCtxGetApiVersion()

hipError_t hipCtxGetApiVersion ( hipCtx_t  ctx,
int *  apiVersion 
)

Returns the approximate HIP api version. [Deprecated].

Parameters
[in]ctxContext to check
[out]apiVersion
Returns
hipSuccess
Warning
The HIP feature set does not correspond to an exact CUDA SDK api revision. This function always set *apiVersion to 4 as an approximation though HIP supports some features which were introduced in later CUDA SDK revisions. HIP apps code should not rely on the api revision number here and should use arch feature flags to test device capabilities or conditional compilation.
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetDevice, hipCtxGetFlags, hipCtxPopCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxGetCacheConfig()

hipError_t hipCtxGetCacheConfig ( hipFuncCache_t cacheConfig)

Get Cache configuration for a specific function. [Deprecated].

Parameters
[out]cacheConfigCache configuration
Returns
hipSuccess
Warning
AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures.
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxGetCurrent()

hipError_t hipCtxGetCurrent ( hipCtx_t ctx)

Get the handle of the current/ default context. [Deprecated].

Parameters
[out]ctx
Returns
hipSuccess, hipErrorInvalidContext
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetDevice, hipCtxGetFlags, hipCtxPopCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxGetDevice()

hipError_t hipCtxGetDevice ( hipDevice_t device)

Get the handle of the device associated with current/default context. [Deprecated].

Parameters
[out]device
Returns
hipSuccess, hipErrorInvalidContext
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize
Warning
: This HIP API is deprecated.

◆ hipCtxGetFlags()

hipError_t hipCtxGetFlags ( unsigned int *  flags)

Return flags used for creating default context.

Parameters
[out]flagsPointer of flags
Returns
hipSuccess
See also
hipCtxCreate, hipCtxDestroy, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxGetSharedMemConfig()

hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig pConfig)

Get Shared memory bank configuration. [Deprecated].

Parameters
[out]pConfigPointer of shared memory configuration
Returns
hipSuccess
Warning
AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures.
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxPopCurrent()

hipError_t hipCtxPopCurrent ( hipCtx_t ctx)

Pop the current/default context and return the popped context. [Deprecated].

Parameters
[out]ctx
Returns
hipSuccess, hipErrorInvalidContext
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxSetCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxPushCurrent()

hipError_t hipCtxPushCurrent ( hipCtx_t  ctx)

Push the context to be set as current/ default context. [Deprecated].

Parameters
[in]ctx
Returns
hipSuccess, hipErrorInvalidContext
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxSetCacheConfig()

hipError_t hipCtxSetCacheConfig ( hipFuncCache_t  cacheConfig)

Set L1/Shared cache partition. [Deprecated].

Parameters
[in]cacheConfigCache configuration to set
Returns
hipSuccess
Warning
AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures.
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxSetCurrent()

hipError_t hipCtxSetCurrent ( hipCtx_t  ctx)

Set the passed context as current/default. [Deprecated].

Parameters
[in]ctx
Returns
hipSuccess, hipErrorInvalidContext
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxSetSharedMemConfig()

hipError_t hipCtxSetSharedMemConfig ( hipSharedMemConfig  config)

Set Shared memory bank configuration.

Parameters
[in]configShared memory configuration to set
Returns
hipSuccess
Warning
AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures.
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice
Warning
: This HIP API is deprecated.

◆ hipCtxSynchronize()

hipError_t hipCtxSynchronize ( void  )

Blocks until the default context has completed all preceding requested tasks. [Deprecated].

Returns
hipSuccess
Warning
This function waits for all streams on the default context to complete execution, and then returns.
See also
hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxGetDevice
Warning
: This HIP API is deprecated.