|
| 1 | +//===--------- command_buffer.cpp - NativeCPU Adapter ---------------------===// |
| 2 | +// |
| 3 | +// Copyright (C) 2023 Intel Corporation |
| 4 | +// |
| 5 | +// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM |
| 6 | +// Exceptions. See LICENSE.TXT |
| 7 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 8 | +// |
| 9 | +//===----------------------------------------------------------------------===// |
| 10 | + |
| 11 | +#include "common.hpp" |
| 12 | + |
| 13 | +/// Stub implementations of UR experimental feature command-buffers |
| 14 | +/// Taken almost unchanged from another adapter. Perhaps going forward |
| 15 | +/// these stubs could be defined in core UR as the default which would |
| 16 | +/// reduce code duplication. Adapters could then "override" these defaults. |
| 17 | +/// Issue raised for this comment in |
| 18 | +/// https://github.com/oneapi-src/unified-runtime/issues/1064 |
| 19 | + |
| 20 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp( |
| 21 | + ur_context_handle_t, ur_device_handle_t, |
| 22 | + const ur_exp_command_buffer_desc_t *, ur_exp_command_buffer_handle_t *) { |
| 23 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 24 | + "implemented for the NativeCPU adapter."); |
| 25 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 26 | +} |
| 27 | + |
| 28 | +UR_APIEXPORT ur_result_t UR_APICALL |
| 29 | +urCommandBufferRetainExp(ur_exp_command_buffer_handle_t) { |
| 30 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 31 | + "implemented for the NativeCPU adapter."); |
| 32 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 33 | +} |
| 34 | + |
| 35 | +UR_APIEXPORT ur_result_t UR_APICALL |
| 36 | +urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t) { |
| 37 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 38 | + "implemented for the NativeCPU adapter."); |
| 39 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 40 | +} |
| 41 | + |
| 42 | +UR_APIEXPORT ur_result_t UR_APICALL |
| 43 | +urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t) { |
| 44 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 45 | + "implemented for the NativeCPU adapter."); |
| 46 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 47 | +} |
| 48 | + |
| 49 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( |
| 50 | + ur_exp_command_buffer_handle_t, ur_kernel_handle_t, uint32_t, |
| 51 | + const size_t *, const size_t *, const size_t *, uint32_t, |
| 52 | + const ur_exp_command_buffer_sync_point_t *, |
| 53 | + ur_exp_command_buffer_sync_point_t *) { |
| 54 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 55 | + "implemented for the NativeCPU adapter."); |
| 56 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 57 | +} |
| 58 | + |
| 59 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp( |
| 60 | + ur_exp_command_buffer_handle_t, void *, const void *, size_t, uint32_t, |
| 61 | + const ur_exp_command_buffer_sync_point_t *, |
| 62 | + ur_exp_command_buffer_sync_point_t *) { |
| 63 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 64 | + "implemented for the NativeCPU adapter."); |
| 65 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 66 | +} |
| 67 | + |
| 68 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp( |
| 69 | + ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, size_t, |
| 70 | + size_t, size_t, uint32_t, const ur_exp_command_buffer_sync_point_t *, |
| 71 | + ur_exp_command_buffer_sync_point_t *) { |
| 72 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 73 | + "implemented for the NativeCPU adapter."); |
| 74 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 75 | +} |
| 76 | + |
| 77 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyRectExp( |
| 78 | + ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, |
| 79 | + ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, size_t, size_t, |
| 80 | + size_t, size_t, uint32_t, const ur_exp_command_buffer_sync_point_t *, |
| 81 | + ur_exp_command_buffer_sync_point_t *) { |
| 82 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 83 | + "implemented for the NativeCPU adapter."); |
| 84 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 85 | +} |
| 86 | + |
| 87 | +UR_APIEXPORT |
| 88 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteExp( |
| 89 | + ur_exp_command_buffer_handle_t, ur_mem_handle_t, size_t, size_t, |
| 90 | + const void *, uint32_t, const ur_exp_command_buffer_sync_point_t *, |
| 91 | + ur_exp_command_buffer_sync_point_t *) { |
| 92 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 93 | + "implemented for the NativeCPU adapter."); |
| 94 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 95 | +} |
| 96 | + |
| 97 | +UR_APIEXPORT |
| 98 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferReadExp( |
| 99 | + ur_exp_command_buffer_handle_t, ur_mem_handle_t, size_t, size_t, void *, |
| 100 | + uint32_t, const ur_exp_command_buffer_sync_point_t *, |
| 101 | + ur_exp_command_buffer_sync_point_t *) { |
| 102 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 103 | + "implemented for the NativeCPU adapter."); |
| 104 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 105 | +} |
| 106 | + |
| 107 | +UR_APIEXPORT |
| 108 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteRectExp( |
| 109 | + ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, |
| 110 | + ur_rect_offset_t, ur_rect_region_t, size_t, size_t, size_t, size_t, void *, |
| 111 | + uint32_t, const ur_exp_command_buffer_sync_point_t *, |
| 112 | + ur_exp_command_buffer_sync_point_t *) { |
| 113 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 114 | + "implemented for the NativeCPU adapter."); |
| 115 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 116 | +} |
| 117 | + |
| 118 | +UR_APIEXPORT |
| 119 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferReadRectExp( |
| 120 | + ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, |
| 121 | + ur_rect_offset_t, ur_rect_region_t, size_t, size_t, size_t, size_t, void *, |
| 122 | + uint32_t, const ur_exp_command_buffer_sync_point_t *, |
| 123 | + ur_exp_command_buffer_sync_point_t *) { |
| 124 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 125 | + "implemented for the NativeCPU adapter."); |
| 126 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 127 | +} |
| 128 | + |
| 129 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp( |
| 130 | + ur_exp_command_buffer_handle_t, ur_queue_handle_t, uint32_t, |
| 131 | + const ur_event_handle_t *, ur_event_handle_t *) { |
| 132 | + detail::ur::die("Experimental Command-buffer feature is not " |
| 133 | + "implemented for the NativeCPU adapter."); |
| 134 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 135 | +} |
0 commit comments