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


[ROCm/hip commit: 3e84cf4aba]
此提交包含在:
Rahul Garg committed 2017-08-08 07:02:22 +05:30
1 父節點 f88f99276a
當前提交 8d254a7113
3 file changed
+24 -24

No files matched your search

+1
查看文件
@@ -146,6 +146,7 @@ hipError_t hipSetDevice(int deviceId)
return ihipLogStatus(hipErrorInvalidDevice);
} else {
ihipSetTlsDefaultCtx(ihipGetPrimaryCtx(deviceId));
tls_getPrimaryCtx = true;
return ihipLogStatus(hipSuccess);
}
}