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..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,15 +110,30 @@ 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; +} + +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(unsupported_ncpu); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; }