Added support for hipCtxSynchronize and hipCtxGetFlags,modified hipDeviceSynchronize
Change-Id: If7bac667a262fa8c0cb3dc93e97f2534855acd07
This commit is contained in:
@@ -648,6 +648,7 @@ extern void ihipInit();
|
||||
extern const char *ihipErrorString(hipError_t);
|
||||
extern ihipCtx_t *ihipGetTlsDefaultCtx();
|
||||
extern void ihipSetTlsDefaultCtx(ihipCtx_t *ctx);
|
||||
extern hipError_t ihipSynchronize(void);
|
||||
|
||||
extern ihipDevice_t *ihipGetDevice(int);
|
||||
ihipCtx_t * ihipGetPrimaryCtx(unsigned deviceIndex);
|
||||
|
||||
@@ -1086,6 +1086,11 @@ hipError_t hipCtxSetSharedMemConfig ( hipSharedMemConfig config );
|
||||
|
||||
hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig * pConfig );
|
||||
|
||||
hipError_t hipCtxSynchronize ( void );
|
||||
|
||||
hipError_t hipCtxGetFlags ( unsigned int* flags );
|
||||
|
||||
|
||||
// TODO-ctx
|
||||
/**
|
||||
* @return hipSuccess, hipErrorInvalidDevice
|
||||
|
||||
+15
-1
@@ -216,4 +216,18 @@ hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig * pConfig )
|
||||
*pConfig = hipSharedMemBankSizeFourByte;
|
||||
|
||||
return ihipLogStatus(hipSuccess);
|
||||
}
|
||||
}
|
||||
|
||||
hipError_t hipCtxSynchronize ( void )
|
||||
{
|
||||
return ihipSynchronize(); //TODP Shall check validity of ctx?
|
||||
}
|
||||
|
||||
hipError_t hipCtxGetFlags ( unsigned int* flags )
|
||||
{
|
||||
hipError_t e = hipSuccess;
|
||||
ihipCtx_t* tempCtx;
|
||||
tempCtx = ihipGetTlsDefaultCtx();
|
||||
*flags = tempCtx->_ctxFlags;
|
||||
return ihipLogStatus(e);
|
||||
}
|
||||
|
||||
@@ -160,11 +160,7 @@ hipError_t hipSetDevice(int deviceId)
|
||||
*/
|
||||
hipError_t hipDeviceSynchronize(void)
|
||||
{
|
||||
HIP_INIT_API();
|
||||
|
||||
ihipGetTlsDefaultCtx()->locked_waitAllStreams(); // ignores non-blocking streams, this waits for all activity to finish.
|
||||
|
||||
return ihipLogStatus(hipSuccess);
|
||||
return ihipSynchronize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -158,7 +158,14 @@ ihipCtx_t *ihipGetTlsDefaultCtx()
|
||||
return tls_defaultCtx;
|
||||
}
|
||||
|
||||
hipError_t ihipSynchronize(void)
|
||||
{
|
||||
HIP_INIT_API();
|
||||
|
||||
ihipGetTlsDefaultCtx()->locked_waitAllStreams(); // ignores non-blocking streams, this waits for all activity to finish.
|
||||
|
||||
return ihipLogStatus(hipSuccess);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
// ihipSignal_t:
|
||||
|
||||
Reference in New Issue
Block a user