From 8016f8b3f5d954f924eaa34634a3f930151e176d Mon Sep 17 00:00:00 2001 From: "pietro.ghiglio" Date: Mon, 18 Sep 2023 10:21:53 +0100 Subject: [PATCH 1/2] [SYCL][NATIVECPU] Empty impl for urCommandBufferAppendUSMMemcpyExp --- .../ur/adapters/native_cpu/command_buffer.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp index 8631bd91a3393..37951044e701d 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp @@ -129,3 +129,21 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp( "implemented for the NativeCPU adapter."); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } + +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( + ur_exp_command_buffer_handle_t hCommandBuffer, void *pDst, const void *pSrc, + size_t size, uint32_t numSyncPointsInWaitList, + const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, + ur_exp_command_buffer_sync_point_t *pSyncPoint) { + (void)hCommandBuffer; + (void)pDst; + (void)pSrc; + (void)size; + (void)numSyncPointsInWaitList; + (void)pSyncPointWaitList; + (void)pSyncPoint; + + detail::ur::die("Experimental Command-buffer feature is not " + "implemented for the NativeCPU adapter."); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} From 81b139f2266fdbe5d79363965237f8b62653e5dd Mon Sep 17 00:00:00 2001 From: "pietro.ghiglio" Date: Mon, 18 Sep 2023 12:34:16 +0100 Subject: [PATCH 2/2] change error message --- .../ur/adapters/native_cpu/command_buffer.cpp | 46 ++++++++----------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp index 37951044e701d..cb7a62d768bba 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp @@ -13,32 +13,32 @@ /// these stubs could be defined in core UR as the default which would /// reduce code duplication. Adapters could then "override" these defaults. +static const char unsupported_ncpu[] = + "Experimental Command-buffer feature is not " + "implemented for the NativeCPU adapter yet."; + UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp( ur_context_handle_t, ur_device_handle_t, const ur_exp_command_buffer_desc_t *, ur_exp_command_buffer_handle_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferRetainExp(ur_exp_command_buffer_handle_t) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -47,8 +47,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( const size_t *, const size_t *, const size_t *, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -56,8 +55,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp( ur_exp_command_buffer_handle_t, void *, const void *, size_t, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -65,8 +63,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, size_t, size_t, size_t, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -75,8 +72,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, size_t, size_t, size_t, size_t, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -85,8 +81,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( ur_exp_command_buffer_handle_t, ur_mem_handle_t, size_t, size_t, const void *, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -95,8 +90,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( ur_exp_command_buffer_handle_t, ur_mem_handle_t, size_t, size_t, void *, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -106,8 +100,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( ur_rect_offset_t, ur_rect_region_t, size_t, size_t, size_t, size_t, void *, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -117,16 +110,14 @@ ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( ur_rect_offset_t, ur_rect_region_t, size_t, size_t, size_t, size_t, void *, uint32_t, const ur_exp_command_buffer_sync_point_t *, ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp( ur_exp_command_buffer_handle_t, ur_queue_handle_t, uint32_t, const ur_event_handle_t *, ur_event_handle_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -143,7 +134,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( (void)pSyncPointWaitList; (void)pSyncPoint; - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); + detail::ur::die(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; }