Skip to content

Commit 2974c52

Browse files
authored
Merge pull request #1193 from npmiller/managed-alloc
[HIP] Support managed allocations in USM free
2 parents 8c604b0 + 9c68768 commit 2974c52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/adapters/hip/usm.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ USMFreeImpl([[maybe_unused]] ur_context_handle_t hContext, void *pMem) {
7878
#else
7979
const auto Type = hipPointerAttributeType.memoryType;
8080
#endif
81-
UR_ASSERT(Type == hipMemoryTypeDevice || Type == hipMemoryTypeHost,
81+
UR_ASSERT(Type == hipMemoryTypeDevice || Type == hipMemoryTypeHost ||
82+
Type == hipMemoryTypeManaged,
8283
UR_RESULT_ERROR_INVALID_MEM_OBJECT);
83-
if (Type == hipMemoryTypeDevice) {
84+
if (Type == hipMemoryTypeDevice || Type == hipMemoryTypeManaged) {
8485
UR_CHECK_ERROR(hipFree(pMem));
8586
}
8687
if (Type == hipMemoryTypeHost) {

0 commit comments

Comments
 (0)