Fix the GPU Memory Tests#213
Conversation
They are failing as we don't allow deallocating unknown memory accesses.
Also fix leak in Sycl::allocate
Throw on attempt to allocate unknown with gpu backends, unless size is 0, previously unknown mapped to device. Unknown is allowed on the deallcoate side as it will cause a runtime lookup of the pointer's attributes. Note that cpu backends ignore MemoryAccess entirely and Omp only supports device.
Look for the right enum value when checking for managed pointers in Hip that caused deallocations of managed pointers to fail if the attributes had to be looked up.
aaf9bc8 to
c83fe4b
Compare
previously it would unconditionally call memset which would presumably segfault
a526bd0 to
af0ee60
Compare
|
@MrBurmark It looks like the disk quota on azure is being exceeded causing the test failures. Maybe adding cleanup to the Docker file will help; specifically, something like this after the last |
I see stuff like |
|
@rhornung67 it appears to be complaining about permissions when doing |
b141969 to
af0ee60
Compare
|
@MrBurmark another thought. You could try switching to a the rocm image we use in RAJA testing: https://github.com/llnl/RAJA/blob/develop/Dockerfile#L105 It may be smaller in size. |
| } | ||
| switch (ma) { | ||
| case MemoryAccess::Device: | ||
| ret = sycl::malloc_device<T>(n, qu); |
There was a problem hiding this comment.
I think these function can return a nullptr if the system cannot satisfy the request. Do we want to leave it up to the user to check on that?
There was a problem hiding this comment.
maybe a SYCL variant of CAMP_HIP_API_INVOKE_AND_CHECK ?
Fixed the memory tests that were failing for the gpu backends.
A notable breaking change introduced here is no longer treating the unknown memory type as device in allocate for the GPU resources.
Removed tests that attempted to allocate non-zero amounts of unknown memory type memory.
Make the behavior when explicitly attempting to allocate unknown memory type memory more consistent, all gpu backends now throw if you attempt to allocate unknown memory type memory. Note that the cpu backends completely ignore memory type.
Fix an issue where the Hip resource failed to recognize managed memory pointers. This caused failures during deallocation when the memory type had to be looked up.
Fix an issue where a failed allocation could result in calling memset on nullptr in the calloc implementation.
Improve unity in code style of allocation and memory functions across resources.