Skip to content

Commit cf13442

Browse files
Merge branch 'main' into steffen/record_event
2 parents ecb6a82 + 24f7d66 commit cf13442

Some content is hidden

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

66 files changed

+1575
-510
lines changed

.github/workflows/e2e_core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
# Remove after fixing SYCL test :: abi/layout_handler.cpp
139139
# This issue does not affect further execution of e2e with UR.
140140
continue-on-error: true
141-
run: cmake --build ${{github.workspace}}/sycl_build --target check-sycl
141+
run: cmake --build ${{github.workspace}}/sycl_build --target check-sycl -j6
142142

143143
- name: Set additional env. vars
144144
run: |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Build and test](https://github.com/oneapi-src/unified-runtime/actions/workflows/cmake.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/cmake.yml)
44
[![E2E Cuda](https://github.com/oneapi-src/unified-runtime/actions/workflows/e2e_cuda.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/e2e_cuda.yml)
5+
[![E2E OpenCL](https://github.com/oneapi-src/unified-runtime/actions/workflows/e2e_opencl.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/e2e_opencl.yml)
56
[![CodeQL](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml)
67
[![Bandit](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml)
78
[![Coverity](https://scan.coverity.com/projects/28213/badge.svg)](https://scan.coverity.com/projects/oneapi-src-unified-runtime)

include/ur_api.h

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,7 +3450,7 @@ urUSMHostAlloc(
34503450
ur_context_handle_t hContext, ///< [in] handle of the context object
34513451
const ur_usm_desc_t *pUSMDesc, ///< [in][optional] USM memory allocation descriptor
34523452
ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
3453-
size_t size, ///< [in] size in bytes of the USM memory object to be allocated
3453+
size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
34543454
void **ppMem ///< [out] pointer to USM host memory object
34553455
);
34563456

@@ -3498,7 +3498,7 @@ urUSMDeviceAlloc(
34983498
ur_device_handle_t hDevice, ///< [in] handle of the device object
34993499
const ur_usm_desc_t *pUSMDesc, ///< [in][optional] USM memory allocation descriptor
35003500
ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
3501-
size_t size, ///< [in] size in bytes of the USM memory object to be allocated
3501+
size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
35023502
void **ppMem ///< [out] pointer to USM device memory object
35033503
);
35043504

@@ -3547,7 +3547,7 @@ urUSMSharedAlloc(
35473547
ur_device_handle_t hDevice, ///< [in] handle of the device object
35483548
const ur_usm_desc_t *pUSMDesc, ///< [in][optional] Pointer to USM memory allocation descriptor.
35493549
ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
3550-
size_t size, ///< [in] size in bytes of the USM memory object to be allocated
3550+
size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
35513551
void **ppMem ///< [out] pointer to USM shared memory object
35523552
);
35533553

@@ -4078,6 +4078,8 @@ typedef struct ur_program_properties_t {
40784078
///
40794079
/// @details
40804080
/// - The application may call this function from simultaneous threads.
4081+
/// - The adapter may (but is not required to) perform validation of the
4082+
/// provided module during this call.
40814083
///
40824084
/// @remarks
40834085
/// _Analogues_
@@ -4118,6 +4120,10 @@ urProgramCreateWithIL(
41184120
/// - Following a successful call to this entry point, `phProgram` will
41194121
/// contain a binary of type ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or
41204122
/// ::UR_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`.
4123+
/// - The device specified by `hDevice` must be device associated with
4124+
/// context.
4125+
/// - The adapter may (but is not required to) perform validation of the
4126+
/// provided module during this call.
41214127
///
41224128
/// @remarks
41234129
/// _Analogues_
@@ -7982,6 +7988,9 @@ typedef struct ur_exp_command_buffer_desc_t {
79827988
///< ::UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC
79837989
const void *pNext; ///< [in][optional] pointer to extension-specific structure
79847990
ur_bool_t isUpdatable; ///< [in] Commands in a finalized command-buffer can be updated.
7991+
ur_bool_t isInOrder; ///< [in] Commands in a command-buffer may be executed in-order without
7992+
///< explicit dependencies.
7993+
ur_bool_t enableProfiling; ///< [in] Command-buffer profiling is enabled.
79857994

79867995
} ur_exp_command_buffer_desc_t;
79877996

@@ -8186,7 +8195,8 @@ urCommandBufferAppendKernelLaunchExp(
81868195
const size_t *pGlobalWorkSize, ///< [in] Global work size to use when executing kernel.
81878196
const size_t *pLocalWorkSize, ///< [in][optional] Local work size to use when executing kernel.
81888197
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8189-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8198+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8199+
///< be ignored if command-buffer is in-order.
81908200
ur_exp_command_buffer_sync_point_t *pSyncPoint, ///< [out][optional] Sync point associated with this command.
81918201
ur_exp_command_buffer_command_handle_t *phCommand ///< [out][optional] Handle to this command.
81928202
);
@@ -8222,7 +8232,8 @@ urCommandBufferAppendUSMMemcpyExp(
82228232
const void *pSrc, ///< [in] The data to be copied.
82238233
size_t size, ///< [in] The number of bytes to copy.
82248234
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8225-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8235+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8236+
///< be ignored if command-buffer is in-order.
82268237
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
82278238
);
82288239

@@ -8261,7 +8272,8 @@ urCommandBufferAppendUSMFillExp(
82618272
size_t patternSize, ///< [in] size in bytes of the pattern.
82628273
size_t size, ///< [in] fill size in bytes, must be a multiple of patternSize.
82638274
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8264-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8275+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8276+
///< be ignored if command-buffer is in-order.
82658277
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
82668278
);
82678279

@@ -8294,7 +8306,8 @@ urCommandBufferAppendMemBufferCopyExp(
82948306
size_t dstOffset, ///< [in] Offset into the destination memory
82958307
size_t size, ///< [in] The number of bytes to be copied.
82968308
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8297-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8309+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8310+
///< be ignored if command-buffer is in-order.
82988311
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
82998312
);
83008313

@@ -8327,7 +8340,8 @@ urCommandBufferAppendMemBufferWriteExp(
83278340
size_t size, ///< [in] Size in bytes of data being written.
83288341
const void *pSrc, ///< [in] Pointer to host memory where data is to be written from.
83298342
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8330-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8343+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8344+
///< be ignored if command-buffer is in-order.
83318345
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
83328346
);
83338347

@@ -8360,7 +8374,8 @@ urCommandBufferAppendMemBufferReadExp(
83608374
size_t size, ///< [in] Size in bytes of data being written.
83618375
void *pDst, ///< [in] Pointer to host memory where data is to be written to.
83628376
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8363-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8377+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8378+
///< be ignored if command-buffer is in-order.
83648379
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
83658380
);
83668381

@@ -8397,7 +8412,8 @@ urCommandBufferAppendMemBufferCopyRectExp(
83978412
size_t dstRowPitch, ///< [in] Row pitch of the destination memory.
83988413
size_t dstSlicePitch, ///< [in] Slice pitch of the destination memory.
83998414
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8400-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8415+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8416+
///< be ignored if command-buffer is in-order.
84018417
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
84028418
);
84038419

@@ -8438,7 +8454,8 @@ urCommandBufferAppendMemBufferWriteRectExp(
84388454
///< pointed to by pSrc.
84398455
void *pSrc, ///< [in] Pointer to host memory where data is to be written from.
84408456
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8441-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8457+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8458+
///< be ignored if command-buffer is in-order.
84428459
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
84438460
);
84448461

@@ -8478,7 +8495,8 @@ urCommandBufferAppendMemBufferReadRectExp(
84788495
///< pointed to by pDst.
84798496
void *pDst, ///< [in] Pointer to host memory where data is to be read into.
84808497
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8481-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8498+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8499+
///< be ignored if command-buffer is in-order.
84828500
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
84838501
);
84848502

@@ -8514,7 +8532,8 @@ urCommandBufferAppendMemBufferFillExp(
85148532
size_t offset, ///< [in] offset into the buffer.
85158533
size_t size, ///< [in] fill size in bytes, must be a multiple of patternSize.
85168534
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8517-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8535+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8536+
///< be ignored if command-buffer is in-order.
85188537
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
85198538
);
85208539

@@ -8555,7 +8574,8 @@ urCommandBufferAppendUSMPrefetchExp(
85558574
size_t size, ///< [in] size in bytes to be fetched.
85568575
ur_usm_migration_flags_t flags, ///< [in] USM prefetch flags
85578576
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8558-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8577+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8578+
///< be ignored if command-buffer is in-order.
85598579
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
85608580
);
85618581

@@ -8596,7 +8616,8 @@ urCommandBufferAppendUSMAdviseExp(
85968616
size_t size, ///< [in] size in bytes to be advised.
85978617
ur_usm_advice_flags_t advice, ///< [in] USM memory advice
85988618
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8599-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8619+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8620+
///< be ignored if command-buffer is in-order.
86008621
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
86018622
);
86028623

include/ur_print.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9517,6 +9517,16 @@ inline std::ostream &operator<<(std::ostream &os, const struct ur_exp_command_bu
95179517

95189518
os << (params.isUpdatable);
95199519

9520+
os << ", ";
9521+
os << ".isInOrder = ";
9522+
9523+
os << (params.isInOrder);
9524+
9525+
os << ", ";
9526+
os << ".enableProfiling = ";
9527+
9528+
os << (params.enableProfiling);
9529+
95209530
os << "}";
95219531
return os;
95229532
}

scripts/core/EXP-COMMAND-BUFFER.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,13 @@ Command-Buffer Creation
7777
Command-Buffers are tied to a specific ${x}_context_handle_t and
7878
${x}_device_handle_t. ${x}CommandBufferCreateExp optionally takes a descriptor
7979
to provide additional properties for how the command-buffer should be
80-
constructed. The only unique member defined in ${x}_exp_command_buffer_desc_t
81-
is ``isUpdatable``, which should be set to ``true`` to support :ref:`updating
80+
constructed. The members defined in ${x}_exp_command_buffer_desc_t are:
81+
* ``isUpdatable``, which should be set to ``true`` to support :ref:`updating
8282
command-buffer commands`.
83+
* ``isInOrder``, which should be set to ``true`` to enable commands enqueued to
84+
a command-buffer to be executed in an in-order fashion where possible.
85+
* ``enableProfiling``, which should be set to ``true`` to enable profiling of
86+
the command-buffer.
8387

8488
Command-buffers are reference counted and can be retained and released by
8589
calling ${x}CommandBufferRetainExp and ${x}CommandBufferReleaseExp respectively.
@@ -123,7 +127,8 @@ Sync-Points
123127
A sync-point is a value which represents a command inside of a command-buffer
124128
which is returned from command-buffer append function calls. These can be
125129
optionally passed to these functions to define execution dependencies on other
126-
commands within the command-buffer.
130+
commands within the command-buffer. Sync-points passed to functions may be
131+
ignored if the command-buffer was created in-order.
127132

128133
Sync-points are unique and valid for use only within the command-buffer they
129134
were obtained from.

0 commit comments

Comments
 (0)