consolidate thread local storage (#915)

* all thread local access now through single struct

* clean up old commented-out code, more use of GET_TLS()

* fewer calls to GET_TLS by passing tls as a funtion argument

* revert unnecessary change to printf

* fix failing tests due to TLS change

* fix merge conflicts in ihipOccupancyMaxActiveBlocksPerMultiprocessor
Этот коммит содержится в:
Jeff Daily authored and Maneesh Gupta committed 2019-08-05 09:51:02 +00:00
1 родитель bb7cfaf91a
Коммит f337ae1edb
14 files changed
+172 -158

No files matched your search

+3 -3
Просмотреть файл
@@ -136,14 +136,14 @@ hipError_t hipSetDevice(int deviceId) {
return ihipLogStatus(hipErrorInvalidDevice);
} else {
ihipSetTlsDefaultCtx(ihipGetPrimaryCtx(deviceId));
tls_getPrimaryCtx = true;
tls->getPrimaryCtx = true;
return ihipLogStatus(hipSuccess);
}
}
hipError_t hipDeviceSynchronize(void) {
HIP_INIT_SPECIAL_API(hipDeviceSynchronize, TRACE_SYNC);
return ihipLogStatus(ihipSynchronize());
return ihipLogStatus(ihipSynchronize(tls));
}
hipError_t hipDeviceReset(void) {
@@ -171,7 +171,7 @@ hipError_t hipDeviceReset(void) {
}
hipError_t ihipDeviceSetState(void) {
hipError_t ihipDeviceSetState(TlsData *tls) {
hipError_t e = hipErrorInvalidContext;
auto* ctx = ihipGetTlsDefaultCtx();