Skip to content

Commit 3c66fbe

Browse files
author
Hugh Delaney
committed
Don't remove host allocation funcs
Reinstate accidental removal of host register/allocation funcs.
1 parent def30e8 commit 3c66fbe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/adapters/cuda/memory.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemBufferCreate(
4343
BufferMem::AllocMode AllocMode = BufferMem::AllocMode::Classic;
4444

4545
if ((flags & UR_MEM_FLAG_USE_HOST_POINTER) && EnableUseHostPtr) {
46+
UR_CHECK_ERROR(
47+
cuMemHostRegister(HostPtr, size, CU_MEMHOSTREGISTER_DEVICEMAP));
4648
AllocMode = BufferMem::AllocMode::UseHostPtr;
4749
} else if (flags & UR_MEM_FLAG_ALLOC_HOST_POINTER) {
50+
UR_CHECK_ERROR(cuMemAllocHost(&HostPtr, size));
4851
AllocMode = BufferMem::AllocMode::AllocHostPtr;
4952
} else if (flags & UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER) {
5053
AllocMode = BufferMem::AllocMode::CopyIn;

0 commit comments

Comments
 (0)