|
| 1 | +//===--------- command_buffer.cpp - OpenCL Adapter ---------------------===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===-----------------------------------------------------------------===// |
| 8 | + |
| 9 | +#include "command_buffer.hpp" |
| 10 | +#include "common.hpp" |
| 11 | + |
| 12 | +/// Stub implementations of UR experimental feature command-buffers |
| 13 | + |
| 14 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp( |
| 15 | + [[maybe_unused]] ur_context_handle_t hContext, |
| 16 | + [[maybe_unused]] ur_device_handle_t hDevice, |
| 17 | + [[maybe_unused]] const ur_exp_command_buffer_desc_t *pCommandBufferDesc, |
| 18 | + [[maybe_unused]] ur_exp_command_buffer_handle_t *phCommandBuffer) { |
| 19 | + |
| 20 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 21 | + "implemented for OpenCL adapter."); |
| 22 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 23 | +} |
| 24 | + |
| 25 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferRetainExp( |
| 26 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer) { |
| 27 | + |
| 28 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 29 | + "implemented for OpenCL adapter."); |
| 30 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 31 | +} |
| 32 | + |
| 33 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferReleaseExp( |
| 34 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer) { |
| 35 | + |
| 36 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 37 | + "implemented for OpenCL adapter."); |
| 38 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 39 | +} |
| 40 | + |
| 41 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferFinalizeExp( |
| 42 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer) { |
| 43 | + |
| 44 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 45 | + "implemented for OpenCL adapter."); |
| 46 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 47 | +} |
| 48 | + |
| 49 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( |
| 50 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 51 | + [[maybe_unused]] ur_kernel_handle_t hKernel, |
| 52 | + [[maybe_unused]] uint32_t workDim, |
| 53 | + [[maybe_unused]] const size_t *pGlobalWorkOffset, |
| 54 | + [[maybe_unused]] const size_t *pGlobalWorkSize, |
| 55 | + [[maybe_unused]] const size_t *pLocalWorkSize, |
| 56 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 57 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 58 | + *pSyncPointWaitList, |
| 59 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 60 | + |
| 61 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 62 | + "implemented for OpenCL adapter."); |
| 63 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 64 | +} |
| 65 | + |
| 66 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp( |
| 67 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 68 | + [[maybe_unused]] void *pDst, [[maybe_unused]] const void *pSrc, |
| 69 | + [[maybe_unused]] size_t size, |
| 70 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 71 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 72 | + *pSyncPointWaitList, |
| 73 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 74 | + |
| 75 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 76 | + "implemented for OpenCL adapter."); |
| 77 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 78 | +} |
| 79 | + |
| 80 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp( |
| 81 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 82 | + [[maybe_unused]] ur_mem_handle_t hSrcMem, |
| 83 | + [[maybe_unused]] ur_mem_handle_t hDstMem, [[maybe_unused]] size_t srcOffset, |
| 84 | + [[maybe_unused]] size_t dstOffset, [[maybe_unused]] size_t size, |
| 85 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 86 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 87 | + *pSyncPointWaitList, |
| 88 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 89 | + |
| 90 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 91 | + "implemented for OpenCL adapter."); |
| 92 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 93 | +} |
| 94 | + |
| 95 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyRectExp( |
| 96 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 97 | + [[maybe_unused]] ur_mem_handle_t hSrcMem, |
| 98 | + [[maybe_unused]] ur_mem_handle_t hDstMem, |
| 99 | + [[maybe_unused]] ur_rect_offset_t srcOrigin, |
| 100 | + [[maybe_unused]] ur_rect_offset_t dstOrigin, |
| 101 | + [[maybe_unused]] ur_rect_region_t region, |
| 102 | + [[maybe_unused]] size_t srcRowPitch, [[maybe_unused]] size_t srcSlicePitch, |
| 103 | + [[maybe_unused]] size_t dstRowPitch, [[maybe_unused]] size_t dstSlicePitch, |
| 104 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 105 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 106 | + *pSyncPointWaitList, |
| 107 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 108 | + |
| 109 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 110 | + "implemented for OpenCL adapter."); |
| 111 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 112 | +} |
| 113 | + |
| 114 | +UR_APIEXPORT |
| 115 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteExp( |
| 116 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 117 | + [[maybe_unused]] ur_mem_handle_t hBuffer, [[maybe_unused]] size_t offset, |
| 118 | + [[maybe_unused]] size_t size, [[maybe_unused]] const void *pSrc, |
| 119 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 120 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 121 | + *pSyncPointWaitList, |
| 122 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 123 | + |
| 124 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 125 | + "implemented for OpenCL adapter."); |
| 126 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 127 | +} |
| 128 | + |
| 129 | +UR_APIEXPORT |
| 130 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferReadExp( |
| 131 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 132 | + [[maybe_unused]] ur_mem_handle_t hBuffer, [[maybe_unused]] size_t offset, |
| 133 | + [[maybe_unused]] size_t size, [[maybe_unused]] void *pDst, |
| 134 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 135 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 136 | + *pSyncPointWaitList, |
| 137 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 138 | + |
| 139 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 140 | + "implemented for OpenCL adapter."); |
| 141 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 142 | +} |
| 143 | + |
| 144 | +UR_APIEXPORT |
| 145 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteRectExp( |
| 146 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 147 | + [[maybe_unused]] ur_mem_handle_t hBuffer, |
| 148 | + [[maybe_unused]] ur_rect_offset_t bufferOffset, |
| 149 | + [[maybe_unused]] ur_rect_offset_t hostOffset, |
| 150 | + [[maybe_unused]] ur_rect_region_t region, |
| 151 | + [[maybe_unused]] size_t bufferRowPitch, |
| 152 | + [[maybe_unused]] size_t bufferSlicePitch, |
| 153 | + [[maybe_unused]] size_t hostRowPitch, |
| 154 | + [[maybe_unused]] size_t hostSlicePitch, [[maybe_unused]] void *pSrc, |
| 155 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 156 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 157 | + *pSyncPointWaitList, |
| 158 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 159 | + |
| 160 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 161 | + "implemented for OpenCL adapter."); |
| 162 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 163 | +} |
| 164 | + |
| 165 | +UR_APIEXPORT |
| 166 | +ur_result_t UR_APICALL urCommandBufferAppendMembufferReadRectExp( |
| 167 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 168 | + [[maybe_unused]] ur_mem_handle_t hBuffer, |
| 169 | + [[maybe_unused]] ur_rect_offset_t bufferOffset, |
| 170 | + [[maybe_unused]] ur_rect_offset_t hostOffset, |
| 171 | + [[maybe_unused]] ur_rect_region_t region, |
| 172 | + [[maybe_unused]] size_t bufferRowPitch, |
| 173 | + [[maybe_unused]] size_t bufferSlicePitch, |
| 174 | + [[maybe_unused]] size_t hostRowPitch, |
| 175 | + [[maybe_unused]] size_t hostSlicePitch, [[maybe_unused]] void *pDst, |
| 176 | + [[maybe_unused]] uint32_t numSyncPointsInWaitList, |
| 177 | + [[maybe_unused]] const ur_exp_command_buffer_sync_point_t |
| 178 | + *pSyncPointWaitList, |
| 179 | + [[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) { |
| 180 | + |
| 181 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 182 | + "implemented for OpenCL adapter."); |
| 183 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 184 | +} |
| 185 | + |
| 186 | +UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp( |
| 187 | + [[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer, |
| 188 | + [[maybe_unused]] ur_queue_handle_t hQueue, |
| 189 | + [[maybe_unused]] uint32_t numEventsInWaitList, |
| 190 | + [[maybe_unused]] const ur_event_handle_t *phEventWaitList, |
| 191 | + [[maybe_unused]] ur_event_handle_t *phEvent) { |
| 192 | + |
| 193 | + cl_adapter::die("Experimental Command-buffer feature is not " |
| 194 | + "implemented for OpenCL adapter."); |
| 195 | + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; |
| 196 | +} |
0 commit comments