Updated context management logic:

1) hipSetDevice sets a flag so that next call to hipCtxGetCurrent returns primary context on current device
2) hipCtxGetCurrent returns primary context on current device if TLS context stack is empty
3) hipCtxPopCurrent falls back to primary context on current device as default
4) hipCtxPushCurrent, hipCtxSetCurrent and hipCtxCreate reset the flag set in hipSetDevice
Šī revīzija ir iekļauta:
Rahul Garg
2017-08-08 07:02:22 +05:30
vecāks 3061e394bf
revīzija c4e9323877
3 mainīti faili ar 24 papildinājumiem un 24 dzēšanām
+1
Parādīt failu
@@ -146,6 +146,7 @@ hipError_t hipSetDevice(int deviceId)
return ihipLogStatus(hipErrorInvalidDevice);
} else {
ihipSetTlsDefaultCtx(ihipGetPrimaryCtx(deviceId));
tls_getPrimaryCtx = true;
return ihipLogStatus(hipSuccess);
}
}