Skip to content

Commit

Permalink
Add initial spec for async alloc entry points
Browse files Browse the repository at this point in the history
First basic work in progress spec.
  • Loading branch information
hdelan authored and kswiecicki committed Nov 12, 2024
1 parent 2eae687 commit 697d6f7
Show file tree
Hide file tree
Showing 30 changed files with 3,082 additions and 4 deletions.
226 changes: 225 additions & 1 deletion include/ur_api.h

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions include/ur_api_funcs.def
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ _UR_API(urEnqueueDeviceGlobalVariableRead)
_UR_API(urEnqueueReadHostPipe)
_UR_API(urEnqueueWriteHostPipe)
_UR_API(urEnqueueKernelLaunchCustomExp)
_UR_API(urEnqueueUSMDeviceAllocExp)
_UR_API(urEnqueueUSMSharedAllocExp)
_UR_API(urEnqueueUSMHostAllocExp)
_UR_API(urEnqueueUSMFreeExp)
_UR_API(urEnqueueCooperativeKernelLaunchExp)
_UR_API(urEnqueueTimestampRecordingExp)
_UR_API(urEnqueueNativeCommandExp)
Expand Down
50 changes: 50 additions & 0 deletions include/ur_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,52 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueKernelLaunchCustomExp_t)(
const ur_event_handle_t *,
ur_event_handle_t *);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for urEnqueueUSMDeviceAllocExp
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMDeviceAllocExp_t)(
ur_queue_handle_t,
ur_usm_pool_handle_t,
const size_t,
const ur_exp_enqueue_usm_alloc_properties_t *,
uint32_t,
const ur_event_handle_t *,
void **,
ur_event_handle_t *);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for urEnqueueUSMSharedAllocExp
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMSharedAllocExp_t)(
ur_queue_handle_t,
ur_usm_pool_handle_t,
const size_t,
const ur_exp_enqueue_usm_alloc_properties_t *,
uint32_t,
const ur_event_handle_t *,
void **,
ur_event_handle_t *);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for urEnqueueUSMHostAllocExp
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMHostAllocExp_t)(
ur_queue_handle_t,
ur_usm_pool_handle_t,
const size_t,
const ur_exp_enqueue_usm_alloc_properties_t *,
uint32_t,
const ur_event_handle_t *,
void **,
ur_event_handle_t *);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for urEnqueueUSMFreeExp
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueUSMFreeExp_t)(
ur_queue_handle_t,
ur_usm_pool_handle_t,
void *,
uint32_t,
const ur_event_handle_t *,
ur_event_handle_t *);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for urEnqueueCooperativeKernelLaunchExp
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueCooperativeKernelLaunchExp_t)(
Expand Down Expand Up @@ -1502,6 +1548,10 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueNativeCommandExp_t)(
/// @brief Table of EnqueueExp functions pointers
typedef struct ur_enqueue_exp_dditable_t {
ur_pfnEnqueueKernelLaunchCustomExp_t pfnKernelLaunchCustomExp;
ur_pfnEnqueueUSMDeviceAllocExp_t pfnUSMDeviceAllocExp;
ur_pfnEnqueueUSMSharedAllocExp_t pfnUSMSharedAllocExp;
ur_pfnEnqueueUSMHostAllocExp_t pfnUSMHostAllocExp;
ur_pfnEnqueueUSMFreeExp_t pfnUSMFreeExp;
ur_pfnEnqueueCooperativeKernelLaunchExp_t pfnCooperativeKernelLaunchExp;
ur_pfnEnqueueTimestampRecordingExp_t pfnTimestampRecordingExp;
ur_pfnEnqueueNativeCommandExp_t pfnNativeCommandExp;
Expand Down
48 changes: 48 additions & 0 deletions include/ur_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintMapFlags(enum ur_map_flag_t value, ch
/// - `buff_size < out_size`
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);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_exp_enqueue_usm_alloc_flag_t enum
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_INVALID_SIZE
/// - `buff_size < out_size`
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);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_exp_enqueue_usm_alloc_properties_t struct
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_INVALID_SIZE
/// - `buff_size < out_size`
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);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_exp_image_copy_flag_t enum
/// @returns
Expand Down Expand Up @@ -2034,6 +2050,38 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueWriteHostPipeParams(const stru
/// - `buff_size < out_size`
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueKernelLaunchCustomExpParams(const struct ur_enqueue_kernel_launch_custom_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_enqueue_usm_device_alloc_exp_params_t struct
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_INVALID_SIZE
/// - `buff_size < out_size`
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);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_enqueue_usm_shared_alloc_exp_params_t struct
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_INVALID_SIZE
/// - `buff_size < out_size`
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);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_enqueue_usm_host_alloc_exp_params_t struct
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_INVALID_SIZE
/// - `buff_size < out_size`
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);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_enqueue_usm_free_exp_params_t struct
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_INVALID_SIZE
/// - `buff_size < out_size`
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);

///////////////////////////////////////////////////////////////////////////////
/// @brief Print ur_enqueue_cooperative_kernel_launch_exp_params_t struct
/// @returns
Expand Down
Loading

0 comments on commit 697d6f7

Please sign in to comment.