Skip to content

Commit 4d782f1

Browse files
committed
Merge remote-tracking branch 'origin/main' into add-exact-round-opt
2 parents 8dc3d2b + e4164ec commit 4d782f1

37 files changed

+1071
-21
lines changed

.github/workflows/coverity.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
coverity:
1515
name: Coverity
1616
# run only on upstream; forks don't have token for upstream's cov project
17-
if: github.repository == 'oneapi-src/unified-memory-framework'
17+
if: github.repository == 'oneapi-src/unified-runtime'
1818
runs-on: ubuntu-latest
1919

2020
steps:
@@ -64,18 +64,18 @@ jobs:
6464
if [ -n "$COVERITY_DIR" ]; then
6565
export PATH="$PATH:$COVERITY_DIR/bin"
6666
fi
67-
cov-build --dir ${{github.workspace}}/coverity-files cmake --build ${{github.workspace}}/build --config Release -j$(nproc)
67+
cov-build --dir ${{github.workspace}}/cov-int cmake --build ${{github.workspace}}/build --config Release -j$(nproc)
6868
6969
- name: Create tarball to analyze
70-
run: tar czvf ur-coverity-files.tgz coverity-files
70+
run: tar czvf cov-int_ur.tgz cov-int
7171

7272
- name: Push tarball to scan
7373
run: |
7474
BRANCH_NAME=$(echo ${GITHUB_REF_NAME})
7575
COMMIT_ID=$(echo $GITHUB_SHA)
7676
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
7777
--form email=bb-ur@intel.com \
78-
--form file=@ur-coverity-files.tgz \
78+
--form file=@cov-int_ur.tgz \
7979
--form version="$COMMIT_ID" \
8080
--form description="$BRANCH_NAME:$COMMIT_ID" \
8181
https://scan.coverity.com/builds\?project\=oneapi-src%2Funified-runtime

include/ur_api.h

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ typedef enum ur_function_t {
230230
UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP = 243, ///< Enumerator for ::urCommandBufferUpdateSignalEventExp
231231
UR_FUNCTION_COMMAND_BUFFER_UPDATE_WAIT_EVENTS_EXP = 244, ///< Enumerator for ::urCommandBufferUpdateWaitEventsExp
232232
UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP = 245, ///< Enumerator for ::urBindlessImagesMapExternalLinearMemoryExp
233+
UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT = 246, ///< Enumerator for ::urEnqueueEventsWaitWithBarrierExt
233234
/// @cond
234235
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
235236
/// @endcond
@@ -288,6 +289,7 @@ typedef enum ur_structure_type_t {
288289
UR_STRUCTURE_TYPE_EXP_SAMPLER_CUBEMAP_PROPERTIES = 0x2006, ///< ::ur_exp_sampler_cubemap_properties_t
289290
UR_STRUCTURE_TYPE_EXP_IMAGE_COPY_REGION = 0x2007, ///< ::ur_exp_image_copy_region_t
290291
UR_STRUCTURE_TYPE_EXP_ENQUEUE_NATIVE_COMMAND_PROPERTIES = 0x3000, ///< ::ur_exp_enqueue_native_command_properties_t
292+
UR_STRUCTURE_TYPE_EXP_ENQUEUE_EXT_PROPERTIES = 0x4000, ///< ::ur_exp_enqueue_ext_properties_t
291293
/// @cond
292294
UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff
293295
/// @endcond
@@ -1702,6 +1704,7 @@ typedef enum ur_device_info_t {
17021704
///< backed 2D sampled image data.
17031705
UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native
17041706
///< work
1707+
UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP = 0x2021, ///< [::ur_bool_t] returns true if the device supports low-power events.
17051708
/// @cond
17061709
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
17071710
/// @endcond
@@ -1727,7 +1730,7 @@ typedef enum ur_device_info_t {
17271730
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
17281731
/// + `NULL == hDevice`
17291732
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1730-
/// + `::UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP < propName`
1733+
/// + `::UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP < propName`
17311734
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
17321735
/// + If `propName` is not supported by the adapter.
17331736
/// - ::UR_RESULT_ERROR_INVALID_SIZE
@@ -5447,13 +5450,17 @@ typedef enum ur_queue_flag_t {
54475450
///< ignore this flag.
54485451
UR_QUEUE_FLAG_SYNC_WITH_DEFAULT_STREAM = UR_BIT(10), ///< Synchronize with the default stream. Only meaningful for CUDA. Other
54495452
///< platforms may ignore this flag.
5453+
UR_QUEUE_FLAG_LOW_POWER_EVENTS_EXP = UR_BIT(11), ///< Hint: use low-power events. Only meaningful for Level Zero, where the
5454+
///< implementation may use interrupt-driven events. May reduce CPU
5455+
///< utilization at the cost of increased event completion latency. Other
5456+
///< platforms may ignore this flag.
54505457
/// @cond
54515458
UR_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff
54525459
/// @endcond
54535460

54545461
} ur_queue_flag_t;
54555462
/// @brief Bit Mask for validating ur_queue_flags_t
5456-
#define UR_QUEUE_FLAGS_MASK 0xfffff800
5463+
#define UR_QUEUE_FLAGS_MASK 0xfffff000
54575464

54585465
///////////////////////////////////////////////////////////////////////////////
54595466
/// @brief Query information about a command queue
@@ -9974,6 +9981,89 @@ urUsmP2PPeerAccessGetInfoExp(
99749981
size_t *pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName.
99759982
);
99769983

9984+
#if !defined(__GNUC__)
9985+
#pragma endregion
9986+
#endif
9987+
// Intel 'oneAPI' Unified Runtime Experimental API for low-power events API
9988+
#if !defined(__GNUC__)
9989+
#pragma region low_power_events_(experimental)
9990+
#endif
9991+
///////////////////////////////////////////////////////////////////////////////
9992+
/// @brief Extended enqueue properties
9993+
typedef uint32_t ur_exp_enqueue_ext_flags_t;
9994+
typedef enum ur_exp_enqueue_ext_flag_t {
9995+
UR_EXP_ENQUEUE_EXT_FLAG_LOW_POWER_EVENTS = UR_BIT(11), ///< Hint: use low-power events. Only meaningful for Level Zero, where the
9996+
///< implementation may use interrupt-driven events. May reduce CPU
9997+
///< utilization at the cost of increased event completion latency. Other
9998+
///< platforms may ignore this flag.
9999+
/// @cond
10000+
UR_EXP_ENQUEUE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff
10001+
/// @endcond
10002+
10003+
} ur_exp_enqueue_ext_flag_t;
10004+
/// @brief Bit Mask for validating ur_exp_enqueue_ext_flags_t
10005+
#define UR_EXP_ENQUEUE_EXT_FLAGS_MASK 0xfffff7ff
10006+
10007+
///////////////////////////////////////////////////////////////////////////////
10008+
/// @brief Extended enqueue properties
10009+
typedef struct ur_exp_enqueue_ext_properties_t {
10010+
ur_structure_type_t stype; ///< [in] type of this structure, must be
10011+
///< ::UR_STRUCTURE_TYPE_EXP_ENQUEUE_EXT_PROPERTIES
10012+
void *pNext; ///< [in,out][optional] pointer to extension-specific structure
10013+
ur_exp_enqueue_ext_flags_t flags; ///< [in] extended enqueue flags
10014+
10015+
} ur_exp_enqueue_ext_properties_t;
10016+
10017+
///////////////////////////////////////////////////////////////////////////////
10018+
/// @brief Enqueue a barrier command which waits a list of events to complete
10019+
/// before it completes, with optional extended properties
10020+
///
10021+
/// @details
10022+
/// - If the event list is empty, it waits for all previously enqueued
10023+
/// commands to complete.
10024+
/// - It blocks command execution - any following commands enqueued after it
10025+
/// do not execute until it completes.
10026+
/// - It returns an event which can be waited on.
10027+
///
10028+
/// @remarks
10029+
/// _Analogues_
10030+
/// - **clEnqueueBarrierWithWaitList**
10031+
///
10032+
/// @returns
10033+
/// - ::UR_RESULT_SUCCESS
10034+
/// - ::UR_RESULT_ERROR_UNINITIALIZED
10035+
/// - ::UR_RESULT_ERROR_DEVICE_LOST
10036+
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
10037+
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
10038+
/// + `NULL == hQueue`
10039+
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
10040+
/// + `NULL != pProperties && ::UR_EXP_ENQUEUE_EXT_FLAGS_MASK & pProperties->flags`
10041+
/// - ::UR_RESULT_ERROR_INVALID_QUEUE
10042+
/// - ::UR_RESULT_ERROR_INVALID_EVENT
10043+
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
10044+
/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
10045+
/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
10046+
/// + If event objects in phEventWaitList are not valid events.
10047+
/// - ::UR_RESULT_ERROR_IN_EVENT_LIST_EXEC_STATUS
10048+
/// + An event in `phEventWaitList` has ::UR_EVENT_STATUS_ERROR.
10049+
/// - ::UR_RESULT_ERROR_INVALID_VALUE
10050+
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
10051+
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
10052+
UR_APIEXPORT ur_result_t UR_APICALL
10053+
urEnqueueEventsWaitWithBarrierExt(
10054+
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
10055+
const ur_exp_enqueue_ext_properties_t *pProperties, ///< [in][optional] pointer to the extended enqueue properties
10056+
uint32_t numEventsInWaitList, ///< [in] size of the event wait list
10057+
const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
10058+
///< events that must be complete before this command can be executed.
10059+
///< If nullptr, the numEventsInWaitList must be 0, indicating that all
10060+
///< previously enqueued commands
10061+
///< must be complete.
10062+
ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies this particular
10063+
///< command instance. If phEventWaitList and phEvent are not NULL, phEvent
10064+
///< must not refer to an element of the phEventWaitList array.
10065+
);
10066+
997710067
#if !defined(__GNUC__)
997810068
#pragma endregion
997910069
#endif
@@ -11450,6 +11540,18 @@ typedef struct ur_enqueue_kernel_launch_custom_exp_params_t {
1145011540
ur_event_handle_t **pphEvent;
1145111541
} ur_enqueue_kernel_launch_custom_exp_params_t;
1145211542

11543+
///////////////////////////////////////////////////////////////////////////////
11544+
/// @brief Function parameters for urEnqueueEventsWaitWithBarrierExt
11545+
/// @details Each entry is a pointer to the parameter passed to the function;
11546+
/// allowing the callback the ability to modify the parameter's value
11547+
typedef struct ur_enqueue_events_wait_with_barrier_ext_params_t {
11548+
ur_queue_handle_t *phQueue;
11549+
const ur_exp_enqueue_ext_properties_t **ppProperties;
11550+
uint32_t *pnumEventsInWaitList;
11551+
const ur_event_handle_t **pphEventWaitList;
11552+
ur_event_handle_t **pphEvent;
11553+
} ur_enqueue_events_wait_with_barrier_ext_params_t;
11554+
1145311555
///////////////////////////////////////////////////////////////////////////////
1145411556
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
1145511557
/// @details Each entry is a pointer to the parameter passed to the function;

include/ur_api_funcs.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ _UR_API(urEnqueueDeviceGlobalVariableWrite)
126126
_UR_API(urEnqueueDeviceGlobalVariableRead)
127127
_UR_API(urEnqueueReadHostPipe)
128128
_UR_API(urEnqueueWriteHostPipe)
129+
_UR_API(urEnqueueEventsWaitWithBarrierExt)
129130
_UR_API(urEnqueueKernelLaunchCustomExp)
130131
_UR_API(urEnqueueCooperativeKernelLaunchExp)
131132
_UR_API(urEnqueueTimestampRecordingExp)

include/ur_ddi.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,15 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueWriteHostPipe_t)(
13981398
const ur_event_handle_t *,
13991399
ur_event_handle_t *);
14001400

1401+
///////////////////////////////////////////////////////////////////////////////
1402+
/// @brief Function-pointer for urEnqueueEventsWaitWithBarrierExt
1403+
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueEventsWaitWithBarrierExt_t)(
1404+
ur_queue_handle_t,
1405+
const ur_exp_enqueue_ext_properties_t *,
1406+
uint32_t,
1407+
const ur_event_handle_t *,
1408+
ur_event_handle_t *);
1409+
14011410
///////////////////////////////////////////////////////////////////////////////
14021411
/// @brief Table of Enqueue functions pointers
14031412
typedef struct ur_enqueue_dditable_t {
@@ -1426,6 +1435,7 @@ typedef struct ur_enqueue_dditable_t {
14261435
ur_pfnEnqueueDeviceGlobalVariableRead_t pfnDeviceGlobalVariableRead;
14271436
ur_pfnEnqueueReadHostPipe_t pfnReadHostPipe;
14281437
ur_pfnEnqueueWriteHostPipe_t pfnWriteHostPipe;
1438+
ur_pfnEnqueueEventsWaitWithBarrierExt_t pfnEventsWaitWithBarrierExt;
14291439
} ur_enqueue_dditable_t;
14301440

14311441
///////////////////////////////////////////////////////////////////////////////

include/ur_print.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintExpLaunchProperty(const struct ur_exp
10581058
/// - `buff_size < out_size`
10591059
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpPeerInfo(enum ur_exp_peer_info_t value, char *buffer, const size_t buff_size, size_t *out_size);
10601060

1061+
///////////////////////////////////////////////////////////////////////////////
1062+
/// @brief Print ur_exp_enqueue_ext_flag_t enum
1063+
/// @returns
1064+
/// - ::UR_RESULT_SUCCESS
1065+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
1066+
/// - `buff_size < out_size`
1067+
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpEnqueueExtFlags(enum ur_exp_enqueue_ext_flag_t value, char *buffer, const size_t buff_size, size_t *out_size);
1068+
1069+
///////////////////////////////////////////////////////////////////////////////
1070+
/// @brief Print ur_exp_enqueue_ext_properties_t struct
1071+
/// @returns
1072+
/// - ::UR_RESULT_SUCCESS
1073+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
1074+
/// - `buff_size < out_size`
1075+
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpEnqueueExtProperties(const struct ur_exp_enqueue_ext_properties_t params, char *buffer, const size_t buff_size, size_t *out_size);
1076+
10611077
///////////////////////////////////////////////////////////////////////////////
10621078
/// @brief Print ur_exp_enqueue_native_command_flag_t enum
10631079
/// @returns
@@ -2034,6 +2050,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueWriteHostPipeParams(const stru
20342050
/// - `buff_size < out_size`
20352051
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);
20362052

2053+
///////////////////////////////////////////////////////////////////////////////
2054+
/// @brief Print ur_enqueue_events_wait_with_barrier_ext_params_t struct
2055+
/// @returns
2056+
/// - ::UR_RESULT_SUCCESS
2057+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
2058+
/// - `buff_size < out_size`
2059+
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);
2060+
20372061
///////////////////////////////////////////////////////////////////////////////
20382062
/// @brief Print ur_enqueue_cooperative_kernel_launch_exp_params_t struct
20392063
/// @returns

0 commit comments

Comments
 (0)