Implementation of hipCtxGetDevice

Change-Id: I067572e486323c3aad6f744a2c0c4997c8696af6


[ROCm/clr commit: 5eb889f73c]
This commit is contained in:
Rahul Garg
2016-08-13 01:17:46 +05:30
parent b55d509790
commit a23ea89cae
3 changed files with 17 additions and 1 deletions
+14
View File
@@ -152,3 +152,17 @@ hipError_t hipCtxSetCurrent(hipCtx_t ctx)
return ihipLogStatus(e);
}
hipError_t hipCtxGetDevice(hipDevice_t *device)
{
hipError_t e = hipSuccess;
ihipCtx_t *ctx = ihipGetTlsDefaultCtx();
if(ctx == nullptr) {
e = hipErrorInvalidContext;
}
else {
*device = (ihipDevice_t*)ctx->getDevice();
}
return ihipLogStatus(e);
}