Tweak thread-safe implementation.

introduce LockedAccessor option so destructor does not unlock.
Allows locks to exist across function boundaries, required
for hipLaunchKernel macro which has several unusual requirements.
(including C comppatibility, must use variadic macro, more).


[ROCm/hip commit: 8635863724]
This commit is contained in:
Ben Sander
2016-03-28 21:41:47 -05:00
parent 9e3ac64c54
commit 630ef59d7b
4 changed files with 67 additions and 55 deletions
+2 -2
View File
@@ -363,9 +363,9 @@ hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t s
hipError_t e = hipSuccess;
stream = ihipSyncAndResolveStream(stream);
stream->preKernelCommand();
if (stream) {
stream->lockopen_preKernelCommand();
hc::completion_future cf ;
@@ -389,7 +389,7 @@ hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t s
}
}
stream->postKernelCommand(cf);
stream->lockclose_postKernelCommand(cf);
if (HIP_LAUNCH_BLOCKING) {