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
+1 -1
View File
@@ -222,7 +222,7 @@ static inline hipError_t hipMalloc ( T** devPtr, size_t size)
// Provide an override to automatically typecast the pointer type from void**, and also provide a default for the flags.
template<class T>
static inline hipError_t hipHostMalloc( T** ptr, size_t size, unsigned int flags = 0)
static inline hipError_t hipHostMalloc( T** ptr, size_t size, unsigned int flags = hipHostMallocDefault)
{
return hipHostMalloc((void**)ptr, size, flags);
}