Skip to content

Commit e27e2de

Browse files
author
Ewan Crawford
committed
Add event update to command-buffers.
Expand the command-buffer experimental feature API so that it can be used to implement [SYCL-Graph dynamic events](reble/llvm#372). This involves extending each command append entry-point to include the following extra parameters: * An output `ur_exp_command_buffer_command_handle_t`. * An Input `ur_event_handle_t` event wait-list of dependent events. * An output `ur_event_handle_t` event that is signaled when the command completes its next execution. TODO - Update APIs For this commit the implementation of these new APIs is stubbed out. Implementing the APIs for at least one adapter and adding new UR CTS tests will be follow-on work.
1 parent 4030080 commit e27e2de

30 files changed

+3496
-629
lines changed

include/ur_api.h

Lines changed: 444 additions & 239 deletions
Large diffs are not rendered by default.

include/ur_ddi.h

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,10 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendKernelLaunchExp_t)(
19211921
const size_t *,
19221922
uint32_t,
19231923
const ur_exp_command_buffer_sync_point_t *,
1924+
uint32_t,
1925+
const ur_event_handle_t *,
19241926
ur_exp_command_buffer_sync_point_t *,
1927+
ur_event_handle_t *,
19251928
ur_exp_command_buffer_command_handle_t *);
19261929

19271930
///////////////////////////////////////////////////////////////////////////////
@@ -1933,7 +1936,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendUSMMemcpyExp_t)(
19331936
size_t,
19341937
uint32_t,
19351938
const ur_exp_command_buffer_sync_point_t *,
1936-
ur_exp_command_buffer_sync_point_t *);
1939+
uint32_t,
1940+
const ur_event_handle_t *,
1941+
ur_exp_command_buffer_sync_point_t *,
1942+
ur_event_handle_t *,
1943+
ur_exp_command_buffer_command_handle_t *);
19371944

19381945
///////////////////////////////////////////////////////////////////////////////
19391946
/// @brief Function-pointer for urCommandBufferAppendUSMFillExp
@@ -1945,7 +1952,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendUSMFillExp_t)(
19451952
size_t,
19461953
uint32_t,
19471954
const ur_exp_command_buffer_sync_point_t *,
1948-
ur_exp_command_buffer_sync_point_t *);
1955+
uint32_t,
1956+
const ur_event_handle_t *,
1957+
ur_exp_command_buffer_sync_point_t *,
1958+
ur_event_handle_t *,
1959+
ur_exp_command_buffer_command_handle_t *);
19491960

19501961
///////////////////////////////////////////////////////////////////////////////
19511962
/// @brief Function-pointer for urCommandBufferAppendMemBufferCopyExp
@@ -1958,7 +1969,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendMemBufferCopyExp_t)(
19581969
size_t,
19591970
uint32_t,
19601971
const ur_exp_command_buffer_sync_point_t *,
1961-
ur_exp_command_buffer_sync_point_t *);
1972+
uint32_t,
1973+
const ur_event_handle_t *,
1974+
ur_exp_command_buffer_sync_point_t *,
1975+
ur_event_handle_t *,
1976+
ur_exp_command_buffer_command_handle_t *);
19621977

19631978
///////////////////////////////////////////////////////////////////////////////
19641979
/// @brief Function-pointer for urCommandBufferAppendMemBufferWriteExp
@@ -1970,7 +1985,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendMemBufferWriteExp_t)(
19701985
const void *,
19711986
uint32_t,
19721987
const ur_exp_command_buffer_sync_point_t *,
1973-
ur_exp_command_buffer_sync_point_t *);
1988+
uint32_t,
1989+
const ur_event_handle_t *,
1990+
ur_exp_command_buffer_sync_point_t *,
1991+
ur_event_handle_t *,
1992+
ur_exp_command_buffer_command_handle_t *);
19741993

19751994
///////////////////////////////////////////////////////////////////////////////
19761995
/// @brief Function-pointer for urCommandBufferAppendMemBufferReadExp
@@ -1982,7 +2001,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendMemBufferReadExp_t)(
19822001
void *,
19832002
uint32_t,
19842003
const ur_exp_command_buffer_sync_point_t *,
1985-
ur_exp_command_buffer_sync_point_t *);
2004+
uint32_t,
2005+
const ur_event_handle_t *,
2006+
ur_exp_command_buffer_sync_point_t *,
2007+
ur_event_handle_t *,
2008+
ur_exp_command_buffer_command_handle_t *);
19862009

19872010
///////////////////////////////////////////////////////////////////////////////
19882011
/// @brief Function-pointer for urCommandBufferAppendMemBufferCopyRectExp
@@ -1999,7 +2022,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendMemBufferCopyRectExp_t)
19992022
size_t,
20002023
uint32_t,
20012024
const ur_exp_command_buffer_sync_point_t *,
2002-
ur_exp_command_buffer_sync_point_t *);
2025+
uint32_t,
2026+
const ur_event_handle_t *,
2027+
ur_exp_command_buffer_sync_point_t *,
2028+
ur_event_handle_t *,
2029+
ur_exp_command_buffer_command_handle_t *);
20032030

20042031
///////////////////////////////////////////////////////////////////////////////
20052032
/// @brief Function-pointer for urCommandBufferAppendMemBufferWriteRectExp
@@ -2016,7 +2043,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendMemBufferWriteRectExp_t
20162043
void *,
20172044
uint32_t,
20182045
const ur_exp_command_buffer_sync_point_t *,
2019-
ur_exp_command_buffer_sync_point_t *);
2046+
uint32_t,
2047+
const ur_event_handle_t *,
2048+
ur_exp_command_buffer_sync_point_t *,
2049+
ur_event_handle_t *,
2050+
ur_exp_command_buffer_command_handle_t *);
20202051

20212052
///////////////////////////////////////////////////////////////////////////////
20222053
/// @brief Function-pointer for urCommandBufferAppendMemBufferReadRectExp
@@ -2033,7 +2064,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendMemBufferReadRectExp_t)
20332064
void *,
20342065
uint32_t,
20352066
const ur_exp_command_buffer_sync_point_t *,
2036-
ur_exp_command_buffer_sync_point_t *);
2067+
uint32_t,
2068+
const ur_event_handle_t *,
2069+
ur_exp_command_buffer_sync_point_t *,
2070+
ur_event_handle_t *,
2071+
ur_exp_command_buffer_command_handle_t *);
20372072

20382073
///////////////////////////////////////////////////////////////////////////////
20392074
/// @brief Function-pointer for urCommandBufferAppendMemBufferFillExp
@@ -2046,7 +2081,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendMemBufferFillExp_t)(
20462081
size_t,
20472082
uint32_t,
20482083
const ur_exp_command_buffer_sync_point_t *,
2049-
ur_exp_command_buffer_sync_point_t *);
2084+
uint32_t,
2085+
const ur_event_handle_t *,
2086+
ur_exp_command_buffer_sync_point_t *,
2087+
ur_event_handle_t *,
2088+
ur_exp_command_buffer_command_handle_t *);
20502089

20512090
///////////////////////////////////////////////////////////////////////////////
20522091
/// @brief Function-pointer for urCommandBufferAppendUSMPrefetchExp
@@ -2057,7 +2096,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendUSMPrefetchExp_t)(
20572096
ur_usm_migration_flags_t,
20582097
uint32_t,
20592098
const ur_exp_command_buffer_sync_point_t *,
2060-
ur_exp_command_buffer_sync_point_t *);
2099+
uint32_t,
2100+
const ur_event_handle_t *,
2101+
ur_exp_command_buffer_sync_point_t *,
2102+
ur_event_handle_t *,
2103+
ur_exp_command_buffer_command_handle_t *);
20612104

20622105
///////////////////////////////////////////////////////////////////////////////
20632106
/// @brief Function-pointer for urCommandBufferAppendUSMAdviseExp
@@ -2068,7 +2111,11 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendUSMAdviseExp_t)(
20682111
ur_usm_advice_flags_t,
20692112
uint32_t,
20702113
const ur_exp_command_buffer_sync_point_t *,
2071-
ur_exp_command_buffer_sync_point_t *);
2114+
uint32_t,
2115+
const ur_event_handle_t *,
2116+
ur_exp_command_buffer_sync_point_t *,
2117+
ur_event_handle_t *,
2118+
ur_exp_command_buffer_command_handle_t *);
20722119

20732120
///////////////////////////////////////////////////////////////////////////////
20742121
/// @brief Function-pointer for urCommandBufferEnqueueExp

0 commit comments

Comments
 (0)