Skip to content

Commit be94ad3

Browse files
committed
Merge branch 'main' into asan-shadow-scale-4
2 parents 4f8886c + 5083f4f commit be94ad3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3171
-297
lines changed

cmake/match.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def check_status(input_lines, match_lines):
6363
class Tag(Enum):
6464
OPT = "{{OPT}}" # makes the line optional
6565
IGNORE = "{{IGNORE}}" # ignores all input until next match or end of input file
66+
COMMENT = "#" # comment - line ignored
6667

6768

6869
## @brief main function for the match file processing script
@@ -76,7 +77,15 @@ def main():
7677

7778
with open(input_file, 'r') as input, open(match_file, 'r') as match:
7879
input_lines = input.readlines()
79-
match_lines = match.readlines()
80+
# Filter out empty lines and comments (lines beginning with the comment
81+
# character, ignoring leading whitespace)
82+
match_lines = list(
83+
filter(
84+
lambda line: line.strip()
85+
and not line.lstrip().startswith(Tag.COMMENT.value),
86+
match.readlines(),
87+
)
88+
)
8089

8190
ignored_lines = []
8291

include/ur_api.h

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ typedef enum ur_function_t {
223223
UR_FUNCTION_COMMAND_BUFFER_GET_INFO_EXP = 221, ///< Enumerator for ::urCommandBufferGetInfoExp
224224
UR_FUNCTION_COMMAND_BUFFER_COMMAND_GET_INFO_EXP = 222, ///< Enumerator for ::urCommandBufferCommandGetInfoExp
225225
UR_FUNCTION_ENQUEUE_TIMESTAMP_RECORDING_EXP = 223, ///< Enumerator for ::urEnqueueTimestampRecordingExp
226+
UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH_CUSTOM_EXP = 224, ///< Enumerator for ::urEnqueueKernelLaunchCustomExp
226227
/// @cond
227228
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
228229
/// @endcond
@@ -8935,6 +8936,133 @@ urEnqueueTimestampRecordingExp(
89358936
///< reports the timestamp recorded when the command is executed on the device.
89368937
);
89378938

8939+
#if !defined(__GNUC__)
8940+
#pragma endregion
8941+
#endif
8942+
// Intel 'oneAPI' Unified Runtime Experimental APIs for (kernel) Launch Properties
8943+
#if !defined(__GNUC__)
8944+
#pragma region launch properties(experimental)
8945+
#endif
8946+
///////////////////////////////////////////////////////////////////////////////
8947+
#ifndef UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP
8948+
/// @brief The extension string that defines support for the Launch Properties
8949+
/// extension, which is returned when querying device extensions.
8950+
#define UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP "ur_exp_launch_properties"
8951+
#endif // UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP
8952+
8953+
///////////////////////////////////////////////////////////////////////////////
8954+
/// @brief Specifies a launch property id
8955+
///
8956+
/// @remarks
8957+
/// _Analogues_
8958+
/// - **CUlaunchAttributeID**
8959+
typedef enum ur_exp_launch_property_id_t {
8960+
UR_EXP_LAUNCH_PROPERTY_ID_IGNORE = 0, ///< The property has no effect
8961+
UR_EXP_LAUNCH_PROPERTY_ID_COOPERATIVE = 1, ///< Whether to launch a cooperative kernel
8962+
UR_EXP_LAUNCH_PROPERTY_ID_CLUSTER_DIMENSION = 2, ///< work-group cluster dimensions
8963+
/// @cond
8964+
UR_EXP_LAUNCH_PROPERTY_ID_FORCE_UINT32 = 0x7fffffff
8965+
/// @endcond
8966+
8967+
} ur_exp_launch_property_id_t;
8968+
8969+
///////////////////////////////////////////////////////////////////////////////
8970+
/// @brief Specifies a launch property value
8971+
///
8972+
/// @remarks
8973+
/// _Analogues_
8974+
/// - **CUlaunchAttributeValue**
8975+
typedef union ur_exp_launch_property_value_t {
8976+
uint32_t clusterDim[3]; ///< [in] dimensions of the cluster (units of work-group) (x, y, z). Each
8977+
///< value must be a divisor of the corresponding global work-size
8978+
///< dimension (in units of work-group).
8979+
int cooperative; ///< [in] non-zero value indicates a cooperative kernel
8980+
8981+
} ur_exp_launch_property_value_t;
8982+
8983+
///////////////////////////////////////////////////////////////////////////////
8984+
/// @brief Kernel launch property
8985+
///
8986+
/// @remarks
8987+
/// _Analogues_
8988+
/// - **cuLaunchAttribute**
8989+
typedef struct ur_exp_launch_property_t {
8990+
ur_exp_launch_property_id_t id; ///< [in] launch property id
8991+
ur_exp_launch_property_value_t value; ///< [in][tagged_by(id)] launch property value
8992+
8993+
} ur_exp_launch_property_t;
8994+
8995+
///////////////////////////////////////////////////////////////////////////////
8996+
/// @brief Launch kernel with custom launch properties
8997+
///
8998+
/// @details
8999+
/// - Launches the kernel using the specified launch properties
9000+
/// - If numPropsInLaunchPropList == 0 then a regular kernel launch is used:
9001+
/// `urEnqueueKernelLaunch`
9002+
/// - Consult the appropriate adapter driver documentation for details of
9003+
/// adapter specific behavior and native error codes that may be returned.
9004+
///
9005+
/// @remarks
9006+
/// _Analogues_
9007+
/// - **cuLaunchKernelEx**
9008+
///
9009+
/// @returns
9010+
/// - ::UR_RESULT_SUCCESS
9011+
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9012+
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9013+
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9014+
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9015+
/// + `NULL == hQueue`
9016+
/// + `NULL == hKernel`
9017+
/// + NULL == hQueue
9018+
/// + NULL == hKernel
9019+
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9020+
/// + `NULL == pGlobalWorkSize`
9021+
/// + `NULL == launchPropList`
9022+
/// + NULL == pGlobalWorkSize
9023+
/// + numPropsInLaunchpropList != 0 && launchPropList == NULL
9024+
/// - ::UR_RESULT_SUCCESS
9025+
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9026+
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9027+
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9028+
/// - ::UR_RESULT_ERROR_INVALID_QUEUE
9029+
/// - ::UR_RESULT_ERROR_INVALID_KERNEL
9030+
/// - ::UR_RESULT_ERROR_INVALID_EVENT
9031+
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
9032+
/// + phEventWaitList == NULL && numEventsInWaitList > 0
9033+
/// + phEventWaitList != NULL && numEventsInWaitList == 0
9034+
/// + If event objects in phEventWaitList are not valid events.
9035+
/// - ::UR_RESULT_ERROR_IN_EVENT_LIST_EXEC_STATUS
9036+
/// + An event in phEventWaitList has ::UR_EVENT_STATUS_ERROR
9037+
/// - ::UR_RESULT_ERROR_INVALID_WORK_DIMENSION
9038+
/// - ::UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE
9039+
/// - ::UR_RESULT_ERROR_INVALID_VALUE
9040+
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
9041+
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
9042+
UR_APIEXPORT ur_result_t UR_APICALL
9043+
urEnqueueKernelLaunchCustomExp(
9044+
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
9045+
ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object
9046+
uint32_t workDim, ///< [in] number of dimensions, from 1 to 3, to specify the global and
9047+
///< work-group work-items
9048+
const size_t *pGlobalWorkSize, ///< [in] pointer to an array of workDim unsigned values that specify the
9049+
///< number of global work-items in workDim that will execute the kernel
9050+
///< function
9051+
const size_t *pLocalWorkSize, ///< [in][optional] pointer to an array of workDim unsigned values that
9052+
///< specify the number of local work-items forming a work-group that will
9053+
///< execute the kernel function. If nullptr, the runtime implementation
9054+
///< will choose the work-group size.
9055+
uint32_t numPropsInLaunchPropList, ///< [in] size of the launch prop list
9056+
const ur_exp_launch_property_t *launchPropList, ///< [in][range(0, numPropsInLaunchPropList)] pointer to a list of launch
9057+
///< properties
9058+
uint32_t numEventsInWaitList, ///< [in] size of the event wait list
9059+
const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
9060+
///< events that must be complete before the kernel execution. If nullptr,
9061+
///< the numEventsInWaitList must be 0, indicating that no wait event.
9062+
ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies this particular
9063+
///< kernel execution instance.
9064+
);
9065+
89389066
#if !defined(__GNUC__)
89399067
#pragma endregion
89409068
#endif
@@ -10629,6 +10757,23 @@ typedef struct ur_enqueue_write_host_pipe_params_t {
1062910757
ur_event_handle_t **pphEvent;
1063010758
} ur_enqueue_write_host_pipe_params_t;
1063110759

10760+
///////////////////////////////////////////////////////////////////////////////
10761+
/// @brief Function parameters for urEnqueueKernelLaunchCustomExp
10762+
/// @details Each entry is a pointer to the parameter passed to the function;
10763+
/// allowing the callback the ability to modify the parameter's value
10764+
typedef struct ur_enqueue_kernel_launch_custom_exp_params_t {
10765+
ur_queue_handle_t *phQueue;
10766+
ur_kernel_handle_t *phKernel;
10767+
uint32_t *pworkDim;
10768+
const size_t **ppGlobalWorkSize;
10769+
const size_t **ppLocalWorkSize;
10770+
uint32_t *pnumPropsInLaunchPropList;
10771+
const ur_exp_launch_property_t **plaunchPropList;
10772+
uint32_t *pnumEventsInWaitList;
10773+
const ur_event_handle_t **pphEventWaitList;
10774+
ur_event_handle_t **pphEvent;
10775+
} ur_enqueue_kernel_launch_custom_exp_params_t;
10776+
1063210777
///////////////////////////////////////////////////////////////////////////////
1063310778
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
1063410779
/// @details Each entry is a pointer to the parameter passed to the function;

include/ur_ddi.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,20 @@ typedef ur_result_t(UR_APICALL *ur_pfnGetEnqueueProcAddrTable_t)(
14351435
ur_api_version_t,
14361436
ur_enqueue_dditable_t *);
14371437

1438+
///////////////////////////////////////////////////////////////////////////////
1439+
/// @brief Function-pointer for urEnqueueKernelLaunchCustomExp
1440+
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueKernelLaunchCustomExp_t)(
1441+
ur_queue_handle_t,
1442+
ur_kernel_handle_t,
1443+
uint32_t,
1444+
const size_t *,
1445+
const size_t *,
1446+
uint32_t,
1447+
const ur_exp_launch_property_t *,
1448+
uint32_t,
1449+
const ur_event_handle_t *,
1450+
ur_event_handle_t *);
1451+
14381452
///////////////////////////////////////////////////////////////////////////////
14391453
/// @brief Function-pointer for urEnqueueCooperativeKernelLaunchExp
14401454
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueCooperativeKernelLaunchExp_t)(
@@ -1460,6 +1474,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueTimestampRecordingExp_t)(
14601474
///////////////////////////////////////////////////////////////////////////////
14611475
/// @brief Table of EnqueueExp functions pointers
14621476
typedef struct ur_enqueue_exp_dditable_t {
1477+
ur_pfnEnqueueKernelLaunchCustomExp_t pfnKernelLaunchCustomExp;
14631478
ur_pfnEnqueueCooperativeKernelLaunchExp_t pfnCooperativeKernelLaunchExp;
14641479
ur_pfnEnqueueTimestampRecordingExp_t pfnTimestampRecordingExp;
14651480
} ur_enqueue_exp_dditable_t;

include/ur_print.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintExpCommandBufferUpdateValueArgDesc(co
10021002
/// - `buff_size < out_size`
10031003
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpCommandBufferUpdateKernelLaunchDesc(const struct ur_exp_command_buffer_update_kernel_launch_desc_t params, char *buffer, const size_t buff_size, size_t *out_size);
10041004

1005+
///////////////////////////////////////////////////////////////////////////////
1006+
/// @brief Print ur_exp_launch_property_id_t enum
1007+
/// @returns
1008+
/// - ::UR_RESULT_SUCCESS
1009+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
1010+
/// - `buff_size < out_size`
1011+
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpLaunchPropertyId(enum ur_exp_launch_property_id_t value, char *buffer, const size_t buff_size, size_t *out_size);
1012+
1013+
///////////////////////////////////////////////////////////////////////////////
1014+
/// @brief Print ur_exp_launch_property_t struct
1015+
/// @returns
1016+
/// - ::UR_RESULT_SUCCESS
1017+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
1018+
/// - `buff_size < out_size`
1019+
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpLaunchProperty(const struct ur_exp_launch_property_t params, char *buffer, const size_t buff_size, size_t *out_size);
1020+
10051021
///////////////////////////////////////////////////////////////////////////////
10061022
/// @brief Print ur_exp_peer_info_t enum
10071023
/// @returns
@@ -1946,6 +1962,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueReadHostPipeParams(const struc
19461962
/// - `buff_size < out_size`
19471963
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueWriteHostPipeParams(const struct ur_enqueue_write_host_pipe_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
19481964

1965+
///////////////////////////////////////////////////////////////////////////////
1966+
/// @brief Print ur_enqueue_kernel_launch_custom_exp_params_t struct
1967+
/// @returns
1968+
/// - ::UR_RESULT_SUCCESS
1969+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
1970+
/// - `buff_size < out_size`
1971+
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);
1972+
19491973
///////////////////////////////////////////////////////////////////////////////
19501974
/// @brief Print ur_enqueue_cooperative_kernel_launch_exp_params_t struct
19511975
/// @returns

0 commit comments

Comments
 (0)