Skip to content

Commit d0279af

Browse files
author
Jakub Chlanda
authored
[SYCL] Support UR_DEVICE_INFO_USM_CONTEXT_MEMCPY_SUPPORT_EXP on Cuda (#19267)
This is an optimisation that uses a direct memcopy from host to device.
1 parent abbba55 commit d0279af

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

unified-runtime/source/adapters/cuda/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
11641164
case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP:
11651165
return ReturnValue(false);
11661166
case UR_DEVICE_INFO_USM_CONTEXT_MEMCPY_SUPPORT_EXP:
1167-
return ReturnValue(false);
1167+
return ReturnValue(true);
11681168
case UR_DEVICE_INFO_USE_NATIVE_ASSERT:
11691169
return ReturnValue(true);
11701170
case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP:

unified-runtime/source/adapters/cuda/usm.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,9 @@ urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice,
575575
}
576576

577577
UR_APIEXPORT ur_result_t UR_APICALL urUSMContextMemcpyExp(ur_context_handle_t,
578-
void *, const void *,
579-
size_t) {
580-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
578+
void *pDst,
579+
const void *pSrc,
580+
size_t Size) {
581+
UR_CHECK_ERROR(cuMemcpy((CUdeviceptr)pDst, (CUdeviceptr)pSrc, Size));
582+
return UR_RESULT_SUCCESS;
581583
}

0 commit comments

Comments
 (0)