Added further hipCtxXXX Apis
Change-Id: I286d962a06cee656c1c652b3f6b45078587fbc41
This commit is contained in:
@@ -1070,6 +1070,16 @@ hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
|
|||||||
|
|
||||||
hipError_t hipCtxGetDevice(hipDevice_t *device);
|
hipError_t hipCtxGetDevice(hipDevice_t *device);
|
||||||
|
|
||||||
|
hipError_t hipCtxGetApiVersion (hipCtx_t ctx,int *apiVersion);
|
||||||
|
|
||||||
|
hipError_t hipCtxGetCacheConfig ( hipFuncCache *cacheConfig );
|
||||||
|
|
||||||
|
hipError_t hipCtxSetCacheConfig ( hipFuncCache cacheConfig );
|
||||||
|
|
||||||
|
hipError_t hipCtxSetSharedMemConfig ( hipSharedMemConfig config );
|
||||||
|
|
||||||
|
hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig * pConfig );
|
||||||
|
|
||||||
// TODO-ctx
|
// TODO-ctx
|
||||||
/**
|
/**
|
||||||
* @return hipSuccess, hipErrorInvalidDevice
|
* @return hipSuccess, hipErrorInvalidDevice
|
||||||
|
|||||||
@@ -103,15 +103,19 @@ hipError_t hipCtxDestroy(hipCtx_t ctx)
|
|||||||
hipError_t hipCtxPopCurrent(hipCtx_t* ctx)
|
hipError_t hipCtxPopCurrent(hipCtx_t* ctx)
|
||||||
{
|
{
|
||||||
hipError_t e = hipSuccess;
|
hipError_t e = hipSuccess;
|
||||||
tls_ctxStack.pop();
|
ihipCtx_t* tempCtx;
|
||||||
|
*ctx = ihipGetTlsDefaultCtx();
|
||||||
if(!tls_ctxStack.empty()) {
|
if(!tls_ctxStack.empty()) {
|
||||||
*ctx= tls_ctxStack.top();
|
tls_ctxStack.pop();
|
||||||
|
}
|
||||||
|
if(!tls_ctxStack.empty()) {
|
||||||
|
tempCtx= tls_ctxStack.top();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*ctx = nullptr;
|
tempCtx = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ihipSetTlsDefaultCtx(*ctx); //TOD0 - Shall check for NULL?
|
ihipSetTlsDefaultCtx(tempCtx); //TOD0 - Shall check for NULL?
|
||||||
return ihipLogStatus(e);
|
return ihipLogStatus(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,3 +170,50 @@ hipError_t hipCtxGetDevice(hipDevice_t *device)
|
|||||||
}
|
}
|
||||||
return ihipLogStatus(e);
|
return ihipLogStatus(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hipError_t hipCtxGetApiVersion (hipCtx_t ctx,int *apiVersion)
|
||||||
|
{
|
||||||
|
HIP_INIT_API(apiVersion);
|
||||||
|
|
||||||
|
if (apiVersion) {
|
||||||
|
*apiVersion = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ihipLogStatus(hipSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
hipError_t hipCtxGetCacheConfig ( hipFuncCache *cacheConfig )
|
||||||
|
{
|
||||||
|
HIP_INIT_API(cacheConfig);
|
||||||
|
|
||||||
|
*cacheConfig = hipFuncCachePreferNone;
|
||||||
|
|
||||||
|
return ihipLogStatus(hipSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
hipError_t hipCtxSetCacheConfig ( hipFuncCache cacheConfig )
|
||||||
|
{
|
||||||
|
HIP_INIT_API(cacheConfig);
|
||||||
|
|
||||||
|
// Nop, AMD does not support variable cache configs.
|
||||||
|
|
||||||
|
return ihipLogStatus(hipSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
hipError_t hipCtxSetSharedMemConfig ( hipSharedMemConfig config )
|
||||||
|
{
|
||||||
|
HIP_INIT_API(config);
|
||||||
|
|
||||||
|
// Nop, AMD does not support variable shared mem configs.
|
||||||
|
|
||||||
|
return ihipLogStatus(hipSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig * pConfig )
|
||||||
|
{
|
||||||
|
HIP_INIT_API(pConfig);
|
||||||
|
|
||||||
|
*pConfig = hipSharedMemBankSizeFourByte;
|
||||||
|
|
||||||
|
return ihipLogStatus(hipSuccess);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user