Skip to content

Commit bc9d8a4

Browse files
hdelankswiecicki
authored andcommitted
Add initial spec for async alloc entry points
First basic work in progress spec.
1 parent 0ea47d7 commit bc9d8a4

30 files changed

+3082
-4
lines changed

include/ur_api.h

+225-1
Large diffs are not rendered by default.

include/ur_api_funcs.def

+4
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ _UR_API(urEnqueueReadHostPipe)
128128
_UR_API(urEnqueueWriteHostPipe)
129129
_UR_API(urEnqueueEventsWaitWithBarrierExt)
130130
_UR_API(urEnqueueKernelLaunchCustomExp)
131+
_UR_API(urEnqueueUSMDeviceAllocExp)
132+
_UR_API(urEnqueueUSMSharedAllocExp)
133+
_UR_API(urEnqueueUSMHostAllocExp)
134+
_UR_API(urEnqueueUSMFreeExp)
131135
_UR_API(urEnqueueCooperativeKernelLaunchExp)
132136
_UR_API(urEnqueueTimestampRecordingExp)
133137
_UR_API(urEnqueueNativeCommandExp)

include/ur_ddi.h

+50
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,52 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueKernelLaunchCustomExp_t)(
14731473
const ur_event_handle_t *,
14741474
ur_event_handle_t *);
14751475

1476+
///////////////////////////////////////////////////////////////////////////////
1477+
/// @brief Function-pointer for urEnqueueUSMDeviceAllocExp
1478+
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMDeviceAllocExp_t)(
1479+
ur_queue_handle_t,
1480+
ur_usm_pool_handle_t,
1481+
const size_t,
1482+
const ur_exp_enqueue_usm_alloc_properties_t *,
1483+
uint32_t,
1484+
const ur_event_handle_t *,
1485+
void **,
1486+
ur_event_handle_t *);
1487+
1488+
///////////////////////////////////////////////////////////////////////////////
1489+
/// @brief Function-pointer for urEnqueueUSMSharedAllocExp
1490+
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMSharedAllocExp_t)(
1491+
ur_queue_handle_t,
1492+
ur_usm_pool_handle_t,
1493+
const size_t,
1494+
const ur_exp_enqueue_usm_alloc_properties_t *,
1495+
uint32_t,
1496+
const ur_event_handle_t *,
1497+
void **,
1498+
ur_event_handle_t *);
1499+
1500+
///////////////////////////////////////////////////////////////////////////////
1501+
/// @brief Function-pointer for urEnqueueUSMHostAllocExp
1502+
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMHostAllocExp_t)(
1503+
ur_queue_handle_t,
1504+
ur_usm_pool_handle_t,
1505+
const size_t,
1506+
const ur_exp_enqueue_usm_alloc_properties_t *,
1507+
uint32_t,
1508+
const ur_event_handle_t *,
1509+
void **,
1510+
ur_event_handle_t *);
1511+
1512+
///////////////////////////////////////////////////////////////////////////////
1513+
/// @brief Function-pointer for urEnqueueUSMFreeExp
1514+
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMFreeExp_t)(
1515+
ur_queue_handle_t,
1516+
ur_usm_pool_handle_t,
1517+
void *,
1518+
uint32_t,
1519+
const ur_event_handle_t *,
1520+
ur_event_handle_t *);
1521+
14761522
///////////////////////////////////////////////////////////////////////////////
14771523
/// @brief Function-pointer for urEnqueueCooperativeKernelLaunchExp
14781524
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueCooperativeKernelLaunchExp_t)(
@@ -1512,6 +1558,10 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueNativeCommandExp_t)(
15121558
/// @brief Table of EnqueueExp functions pointers
15131559
typedef struct ur_enqueue_exp_dditable_t {
15141560
ur_pfnEnqueueKernelLaunchCustomExp_t pfnKernelLaunchCustomExp;
1561+
ur_pfnEnqueueUSMDeviceAllocExp_t pfnUSMDeviceAllocExp;
1562+
ur_pfnEnqueueUSMSharedAllocExp_t pfnUSMSharedAllocExp;
1563+
ur_pfnEnqueueUSMHostAllocExp_t pfnUSMHostAllocExp;
1564+
ur_pfnEnqueueUSMFreeExp_t pfnUSMFreeExp;
15151565
ur_pfnEnqueueCooperativeKernelLaunchExp_t pfnCooperativeKernelLaunchExp;
15161566
ur_pfnEnqueueTimestampRecordingExp_t pfnTimestampRecordingExp;
15171567
ur_pfnEnqueueNativeCommandExp_t pfnNativeCommandExp;

include/ur_print.h

+48
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintMapFlags(enum ur_map_flag_t value, ch
874874
/// - `buff_size < out_size`
875875
UR_APIEXPORT ur_result_t UR_APICALL urPrintUsmMigrationFlags(enum ur_usm_migration_flag_t value, char *buffer, const size_t buff_size, size_t *out_size);
876876

877+
///////////////////////////////////////////////////////////////////////////////
878+
/// @brief Print ur_exp_enqueue_usm_alloc_flag_t enum
879+
/// @returns
880+
/// - ::UR_RESULT_SUCCESS
881+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
882+
/// - `buff_size < out_size`
883+
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpEnqueueUsmAllocFlags(enum ur_exp_enqueue_usm_alloc_flag_t value, char *buffer, const size_t buff_size, size_t *out_size);
884+
885+
///////////////////////////////////////////////////////////////////////////////
886+
/// @brief Print ur_exp_enqueue_usm_alloc_properties_t struct
887+
/// @returns
888+
/// - ::UR_RESULT_SUCCESS
889+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
890+
/// - `buff_size < out_size`
891+
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpEnqueueUsmAllocProperties(const struct ur_exp_enqueue_usm_alloc_properties_t params, char *buffer, const size_t buff_size, size_t *out_size);
892+
877893
///////////////////////////////////////////////////////////////////////////////
878894
/// @brief Print ur_exp_image_copy_flag_t enum
879895
/// @returns
@@ -2058,6 +2074,38 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueKernelLaunchCustomExpParams(co
20582074
/// - `buff_size < out_size`
20592075
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueEventsWaitWithBarrierExtParams(const struct ur_enqueue_events_wait_with_barrier_ext_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
20602076

2077+
///////////////////////////////////////////////////////////////////////////////
2078+
/// @brief Print ur_enqueue_usm_device_alloc_exp_params_t struct
2079+
/// @returns
2080+
/// - ::UR_RESULT_SUCCESS
2081+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
2082+
/// - `buff_size < out_size`
2083+
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueUsmDeviceAllocExpParams(const struct ur_enqueue_usm_device_alloc_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
2084+
2085+
///////////////////////////////////////////////////////////////////////////////
2086+
/// @brief Print ur_enqueue_usm_shared_alloc_exp_params_t struct
2087+
/// @returns
2088+
/// - ::UR_RESULT_SUCCESS
2089+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
2090+
/// - `buff_size < out_size`
2091+
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueUsmSharedAllocExpParams(const struct ur_enqueue_usm_shared_alloc_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
2092+
2093+
///////////////////////////////////////////////////////////////////////////////
2094+
/// @brief Print ur_enqueue_usm_host_alloc_exp_params_t struct
2095+
/// @returns
2096+
/// - ::UR_RESULT_SUCCESS
2097+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
2098+
/// - `buff_size < out_size`
2099+
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueUsmHostAllocExpParams(const struct ur_enqueue_usm_host_alloc_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
2100+
2101+
///////////////////////////////////////////////////////////////////////////////
2102+
/// @brief Print ur_enqueue_usm_free_exp_params_t struct
2103+
/// @returns
2104+
/// - ::UR_RESULT_SUCCESS
2105+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
2106+
/// - `buff_size < out_size`
2107+
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueUsmFreeExpParams(const struct ur_enqueue_usm_free_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
2108+
20612109
///////////////////////////////////////////////////////////////////////////////
20622110
/// @brief Print ur_enqueue_cooperative_kernel_launch_exp_params_t struct
20632111
/// @returns

0 commit comments

Comments
 (0)