Skip to content

Commit

Permalink
Add OpenCL fill stubs and fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensuo authored and mfrancepillois committed Dec 1, 2023
1 parent 118f696 commit 6047a34
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 18 deletions.
42 changes: 35 additions & 7 deletions source/adapters/opencl/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp(
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] void *pDst, [[maybe_unused]] const void *pSrc,
[[maybe_unused]] size_t size,
Expand All @@ -79,7 +79,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp(
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp(
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_mem_handle_t hSrcMem,
[[maybe_unused]] ur_mem_handle_t hDstMem, [[maybe_unused]] size_t srcOffset,
Expand All @@ -94,7 +94,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp(
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyRectExp(
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_mem_handle_t hSrcMem,
[[maybe_unused]] ur_mem_handle_t hDstMem,
Expand All @@ -114,7 +114,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyRectExp(
}

UR_APIEXPORT
ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteExp(
ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_mem_handle_t hBuffer, [[maybe_unused]] size_t offset,
[[maybe_unused]] size_t size, [[maybe_unused]] const void *pSrc,
Expand All @@ -129,7 +129,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteExp(
}

UR_APIEXPORT
ur_result_t UR_APICALL urCommandBufferAppendMembufferReadExp(
ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_mem_handle_t hBuffer, [[maybe_unused]] size_t offset,
[[maybe_unused]] size_t size, [[maybe_unused]] void *pDst,
Expand All @@ -144,7 +144,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferReadExp(
}

UR_APIEXPORT
ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteRectExp(
ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_mem_handle_t hBuffer,
[[maybe_unused]] ur_rect_offset_t bufferOffset,
Expand All @@ -165,7 +165,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteRectExp(
}

UR_APIEXPORT
ur_result_t UR_APICALL urCommandBufferAppendMembufferReadRectExp(
ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_mem_handle_t hBuffer,
[[maybe_unused]] ur_rect_offset_t bufferOffset,
Expand All @@ -185,6 +185,34 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferReadRectExp(
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_mem_handle_t hBuffer,
[[maybe_unused]] const void *pPattern, [[maybe_unused]] size_t PatternSize,
[[maybe_unused]] size_t Offset, [[maybe_unused]] size_t Size,
[[maybe_unused]] uint32_t NumSyncPointsInWaitList,
[[maybe_unused]] const ur_exp_command_buffer_sync_point_t
*pSyncPointWaitList,
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
cl_adapter::die("Experimental Command-buffer feature is not "
"implemented for OpenCL adapter.");
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] void *pPtr, [[maybe_unused]] const void *pPattern,
[[maybe_unused]] size_t PatternSize, [[maybe_unused]] size_t Size,
[[maybe_unused]] uint32_t NumSyncPointsInWaitList,
[[maybe_unused]] const ur_exp_command_buffer_sync_point_t
*pSyncPointWaitList,
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {

cl_adapter::die("Experimental Command-buffer feature is not "
"implemented for OpenCL adapter.");
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
[[maybe_unused]] ur_queue_handle_t hQueue,
Expand Down
24 changes: 13 additions & 11 deletions source/adapters/opencl/ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,19 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetCommandBufferExpProcAddrTable(
pDdiTable->pfnReleaseExp = urCommandBufferReleaseExp;
pDdiTable->pfnFinalizeExp = urCommandBufferFinalizeExp;
pDdiTable->pfnAppendKernelLaunchExp = urCommandBufferAppendKernelLaunchExp;
pDdiTable->pfnAppendMemcpyUSMExp = urCommandBufferAppendMemcpyUSMExp;
pDdiTable->pfnAppendMembufferCopyExp = urCommandBufferAppendMembufferCopyExp;
pDdiTable->pfnAppendMembufferCopyRectExp =
urCommandBufferAppendMembufferCopyRectExp;
pDdiTable->pfnAppendMembufferReadExp = urCommandBufferAppendMembufferReadExp;
pDdiTable->pfnAppendMembufferReadRectExp =
urCommandBufferAppendMembufferReadRectExp;
pDdiTable->pfnAppendMembufferWriteExp =
urCommandBufferAppendMembufferWriteExp;
pDdiTable->pfnAppendMembufferWriteRectExp =
urCommandBufferAppendMembufferWriteRectExp;
pDdiTable->pfnAppendUSMMemcpyExp = urCommandBufferAppendUSMMemcpyExp;
pDdiTable->pfnAppendUSMFillExp = urCommandBufferAppendUSMFillExp;
pDdiTable->pfnAppendMemBufferCopyExp = urCommandBufferAppendMemBufferCopyExp;
pDdiTable->pfnAppendMemBufferCopyRectExp =
urCommandBufferAppendMemBufferCopyRectExp;
pDdiTable->pfnAppendMemBufferReadExp = urCommandBufferAppendMemBufferReadExp;
pDdiTable->pfnAppendMemBufferReadRectExp =
urCommandBufferAppendMemBufferReadRectExp;
pDdiTable->pfnAppendMemBufferWriteExp =
urCommandBufferAppendMemBufferWriteExp;
pDdiTable->pfnAppendMemBufferWriteRectExp =
urCommandBufferAppendMemBufferWriteRectExp;
pDdiTable->pfnAppendMemBufferFillExp = urCommandBufferAppendMemBufferFillExp;
pDdiTable->pfnEnqueueExp = urCommandBufferEnqueueExp;

return retVal;
Expand Down

0 comments on commit 6047a34

Please sign in to comment.