Skip to content

Commit

Permalink
[EXP][CMD-BUFFER] Command-buffer additional function definitions for …
Browse files Browse the repository at this point in the history
…buffer read and write
  • Loading branch information
mfrancepillois committed Jun 22, 2023
1 parent 65b8cb4 commit fb3ab63
Show file tree
Hide file tree
Showing 12 changed files with 2,112 additions and 0 deletions.
40 changes: 40 additions & 0 deletions include/ur.py
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,10 @@ class ur_function_v(IntEnum):
COMMAND_BUFFER_RETAIN_EXP = 121 ## Enumerator for ::urCommandBufferRetainExp
COMMAND_BUFFER_RELEASE_EXP = 122 ## Enumerator for ::urCommandBufferReleaseExp
COMMAND_BUFFER_FINALIZE_EXP = 123 ## Enumerator for ::urCommandBufferFinalizeExp
COMMAND_BUFFER_APPEND_MEMBUFFER_WRITE_EXP = 124 ## Enumerator for ::urCommandBufferAppendMembufferWriteExp
COMMAND_BUFFER_APPEND_KERNEL_LAUNCH_EXP = 125 ## Enumerator for ::urCommandBufferAppendKernelLaunchExp
COMMAND_BUFFER_APPEND_MEMBUFFER_READ_EXP = 126 ## Enumerator for ::urCommandBufferAppendMembufferReadExp
COMMAND_BUFFER_APPEND_MEMBUFFER_WRITE_RECT_EXP = 127## Enumerator for ::urCommandBufferAppendMembufferWriteRectExp
COMMAND_BUFFER_ENQUEUE_EXP = 128 ## Enumerator for ::urCommandBufferEnqueueExp
COMMAND_BUFFER_APPEND_MEMCPY_USM_EXP = 129 ## Enumerator for ::urCommandBufferAppendMemcpyUSMExp
COMMAND_BUFFER_APPEND_MEMBUFFER_COPY_EXP = 130 ## Enumerator for ::urCommandBufferAppendMembufferCopyExp
Expand Down Expand Up @@ -1981,6 +1984,7 @@ class ur_function_v(IntEnum):
USM_P2P_ENABLE_PEER_ACCESS_EXP = 165 ## Enumerator for ::urUsmP2PEnablePeerAccessExp
USM_P2P_DISABLE_PEER_ACCESS_EXP = 166 ## Enumerator for ::urUsmP2PDisablePeerAccessExp
USM_P2P_PEER_ACCESS_GET_INFO_EXP = 167 ## Enumerator for ::urUsmP2PPeerAccessGetInfoExp
COMMAND_BUFFER_APPEND_MEMBUFFER_READ_RECT_EXP = 168 ## Enumerator for ::urCommandBufferAppendMembufferReadRectExp

class ur_function_t(c_int):
def __str__(self):
Expand Down Expand Up @@ -3289,13 +3293,41 @@ class ur_usm_exp_dditable_t(Structure):
else:
_urCommandBufferAppendMembufferCopyExp_t = CFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, c_size_t, c_size_t, c_size_t, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )

###############################################################################
## @brief Function-pointer for urCommandBufferAppendMembufferWriteExp
if __use_win_types:
_urCommandBufferAppendMembufferWriteExp_t = WINFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )
else:
_urCommandBufferAppendMembufferWriteExp_t = CFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )

###############################################################################
## @brief Function-pointer for urCommandBufferAppendMembufferReadExp
if __use_win_types:
_urCommandBufferAppendMembufferReadExp_t = WINFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )
else:
_urCommandBufferAppendMembufferReadExp_t = CFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )

###############################################################################
## @brief Function-pointer for urCommandBufferAppendMembufferCopyRectExp
if __use_win_types:
_urCommandBufferAppendMembufferCopyRectExp_t = WINFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, c_size_t, c_size_t, c_size_t, c_size_t, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )
else:
_urCommandBufferAppendMembufferCopyRectExp_t = CFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, c_size_t, c_size_t, c_size_t, c_size_t, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )

###############################################################################
## @brief Function-pointer for urCommandBufferAppendMembufferWriteRectExp
if __use_win_types:
_urCommandBufferAppendMembufferWriteRectExp_t = WINFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, c_size_t, c_size_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )
else:
_urCommandBufferAppendMembufferWriteRectExp_t = CFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, c_size_t, c_size_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )

###############################################################################
## @brief Function-pointer for urCommandBufferAppendMembufferReadRectExp
if __use_win_types:
_urCommandBufferAppendMembufferReadRectExp_t = WINFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, c_size_t, c_size_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )
else:
_urCommandBufferAppendMembufferReadRectExp_t = CFUNCTYPE( ur_result_t, ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, c_size_t, c_size_t, c_size_t, c_size_t, c_void_p, c_ulong, POINTER(ur_exp_command_buffer_sync_point_t), POINTER(ur_exp_command_buffer_sync_point_t) )

###############################################################################
## @brief Function-pointer for urCommandBufferEnqueueExp
if __use_win_types:
Expand All @@ -3315,7 +3347,11 @@ class ur_command_buffer_exp_dditable_t(Structure):
("pfnAppendKernelLaunchExp", c_void_p), ## _urCommandBufferAppendKernelLaunchExp_t
("pfnAppendMemcpyUSMExp", c_void_p), ## _urCommandBufferAppendMemcpyUSMExp_t
("pfnAppendMembufferCopyExp", c_void_p), ## _urCommandBufferAppendMembufferCopyExp_t
("pfnAppendMembufferWriteExp", c_void_p), ## _urCommandBufferAppendMembufferWriteExp_t
("pfnAppendMembufferReadExp", c_void_p), ## _urCommandBufferAppendMembufferReadExp_t
("pfnAppendMembufferCopyRectExp", c_void_p), ## _urCommandBufferAppendMembufferCopyRectExp_t
("pfnAppendMembufferWriteRectExp", c_void_p), ## _urCommandBufferAppendMembufferWriteRectExp_t
("pfnAppendMembufferReadRectExp", c_void_p), ## _urCommandBufferAppendMembufferReadRectExp_t
("pfnEnqueueExp", c_void_p) ## _urCommandBufferEnqueueExp_t
]

Expand Down Expand Up @@ -3817,7 +3853,11 @@ def __init__(self, version : ur_api_version_t):
self.urCommandBufferAppendKernelLaunchExp = _urCommandBufferAppendKernelLaunchExp_t(self.__dditable.CommandBufferExp.pfnAppendKernelLaunchExp)
self.urCommandBufferAppendMemcpyUSMExp = _urCommandBufferAppendMemcpyUSMExp_t(self.__dditable.CommandBufferExp.pfnAppendMemcpyUSMExp)
self.urCommandBufferAppendMembufferCopyExp = _urCommandBufferAppendMembufferCopyExp_t(self.__dditable.CommandBufferExp.pfnAppendMembufferCopyExp)
self.urCommandBufferAppendMembufferWriteExp = _urCommandBufferAppendMembufferWriteExp_t(self.__dditable.CommandBufferExp.pfnAppendMembufferWriteExp)
self.urCommandBufferAppendMembufferReadExp = _urCommandBufferAppendMembufferReadExp_t(self.__dditable.CommandBufferExp.pfnAppendMembufferReadExp)
self.urCommandBufferAppendMembufferCopyRectExp = _urCommandBufferAppendMembufferCopyRectExp_t(self.__dditable.CommandBufferExp.pfnAppendMembufferCopyRectExp)
self.urCommandBufferAppendMembufferWriteRectExp = _urCommandBufferAppendMembufferWriteRectExp_t(self.__dditable.CommandBufferExp.pfnAppendMembufferWriteRectExp)
self.urCommandBufferAppendMembufferReadRectExp = _urCommandBufferAppendMembufferReadRectExp_t(self.__dditable.CommandBufferExp.pfnAppendMembufferReadRectExp)
self.urCommandBufferEnqueueExp = _urCommandBufferEnqueueExp_t(self.__dditable.CommandBufferExp.pfnEnqueueExp)

# call driver to get function pointers
Expand Down
Loading

0 comments on commit fb3ab63

Please sign in to comment.