Skip to content

Commit

Permalink
Merge pull request #1193 from npmiller/managed-alloc
Browse files Browse the repository at this point in the history
[HIP] Support managed allocations in USM free
  • Loading branch information
kbenzie committed Feb 2, 2024
2 parents 8c604b0 + 9c68768 commit 2974c52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/adapters/hip/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ USMFreeImpl([[maybe_unused]] ur_context_handle_t hContext, void *pMem) {
#else
const auto Type = hipPointerAttributeType.memoryType;
#endif
UR_ASSERT(Type == hipMemoryTypeDevice || Type == hipMemoryTypeHost,
UR_ASSERT(Type == hipMemoryTypeDevice || Type == hipMemoryTypeHost ||
Type == hipMemoryTypeManaged,
UR_RESULT_ERROR_INVALID_MEM_OBJECT);
if (Type == hipMemoryTypeDevice) {
if (Type == hipMemoryTypeDevice || Type == hipMemoryTypeManaged) {
UR_CHECK_ERROR(hipFree(pMem));
}
if (Type == hipMemoryTypeHost) {
Expand Down

0 comments on commit 2974c52

Please sign in to comment.