Skip to content

Commit 1ca4949

Browse files
authored
Merge branch 'main' into yc/new-api-suggestgroupsize
2 parents 5b8a529 + 24f7d66 commit 1ca4949

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
@@ -3449,7 +3449,7 @@ urUSMHostAlloc(
34493449
ur_context_handle_t hContext, ///< [in] handle of the context object
34503450
const ur_usm_desc_t *pUSMDesc, ///< [in][optional] USM memory allocation descriptor
34513451
ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
3452-
size_t size, ///< [in] size in bytes of the USM memory object to be allocated
3452+
size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
34533453
void **ppMem ///< [out] pointer to USM host memory object
34543454
);
34553455

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

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

@@ -4077,6 +4077,8 @@ typedef struct ur_program_properties_t {
40774077
///
40784078
/// @details
40794079
/// - The application may call this function from simultaneous threads.
4080+
/// - The adapter may (but is not required to) perform validation of the
4081+
/// provided module during this call.
40804082
///
40814083
/// @remarks
40824084
/// _Analogues_
@@ -4117,6 +4119,10 @@ urProgramCreateWithIL(
41174119
/// - Following a successful call to this entry point, `phProgram` will
41184120
/// contain a binary of type ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or
41194121
/// ::UR_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`.
4122+
/// - The device specified by `hDevice` must be device associated with
4123+
/// context.
4124+
/// - The adapter may (but is not required to) perform validation of the
4125+
/// provided module during this call.
41204126
///
41214127
/// @remarks
41224128
/// _Analogues_
@@ -8017,6 +8023,9 @@ typedef struct ur_exp_command_buffer_desc_t {
80178023
///< ::UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC
80188024
const void *pNext; ///< [in][optional] pointer to extension-specific structure
80198025
ur_bool_t isUpdatable; ///< [in] Commands in a finalized command-buffer can be updated.
8026+
ur_bool_t isInOrder; ///< [in] Commands in a command-buffer may be executed in-order without
8027+
///< explicit dependencies.
8028+
ur_bool_t enableProfiling; ///< [in] Command-buffer profiling is enabled.
80208029

80218030
} ur_exp_command_buffer_desc_t;
80228031

@@ -8221,7 +8230,8 @@ urCommandBufferAppendKernelLaunchExp(
82218230
const size_t *pGlobalWorkSize, ///< [in] Global work size to use when executing kernel.
82228231
const size_t *pLocalWorkSize, ///< [in][optional] Local work size to use when executing kernel.
82238232
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8224-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8233+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8234+
///< be ignored if command-buffer is in-order.
82258235
ur_exp_command_buffer_sync_point_t *pSyncPoint, ///< [out][optional] Sync point associated with this command.
82268236
ur_exp_command_buffer_command_handle_t *phCommand ///< [out][optional] Handle to this command.
82278237
);
@@ -8257,7 +8267,8 @@ urCommandBufferAppendUSMMemcpyExp(
82578267
const void *pSrc, ///< [in] The data to be copied.
82588268
size_t size, ///< [in] The number of bytes to copy.
82598269
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8260-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8270+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8271+
///< be ignored if command-buffer is in-order.
82618272
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
82628273
);
82638274

@@ -8296,7 +8307,8 @@ urCommandBufferAppendUSMFillExp(
82968307
size_t patternSize, ///< [in] size in bytes of the pattern.
82978308
size_t size, ///< [in] fill size in bytes, must be a multiple of patternSize.
82988309
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8299-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8310+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8311+
///< be ignored if command-buffer is in-order.
83008312
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
83018313
);
83028314

@@ -8329,7 +8341,8 @@ urCommandBufferAppendMemBufferCopyExp(
83298341
size_t dstOffset, ///< [in] Offset into the destination memory
83308342
size_t size, ///< [in] The number of bytes to be copied.
83318343
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8332-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8344+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8345+
///< be ignored if command-buffer is in-order.
83338346
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
83348347
);
83358348

@@ -8362,7 +8375,8 @@ urCommandBufferAppendMemBufferWriteExp(
83628375
size_t size, ///< [in] Size in bytes of data being written.
83638376
const void *pSrc, ///< [in] Pointer to host memory where data is to be written from.
83648377
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8365-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8378+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8379+
///< be ignored if command-buffer is in-order.
83668380
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
83678381
);
83688382

@@ -8395,7 +8409,8 @@ urCommandBufferAppendMemBufferReadExp(
83958409
size_t size, ///< [in] Size in bytes of data being written.
83968410
void *pDst, ///< [in] Pointer to host memory where data is to be written to.
83978411
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8398-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8412+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8413+
///< be ignored if command-buffer is in-order.
83998414
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
84008415
);
84018416

@@ -8432,7 +8447,8 @@ urCommandBufferAppendMemBufferCopyRectExp(
84328447
size_t dstRowPitch, ///< [in] Row pitch of the destination memory.
84338448
size_t dstSlicePitch, ///< [in] Slice pitch of the destination memory.
84348449
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8435-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8450+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8451+
///< be ignored if command-buffer is in-order.
84368452
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
84378453
);
84388454

@@ -8473,7 +8489,8 @@ urCommandBufferAppendMemBufferWriteRectExp(
84738489
///< pointed to by pSrc.
84748490
void *pSrc, ///< [in] Pointer to host memory where data is to be written from.
84758491
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8476-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8492+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8493+
///< be ignored if command-buffer is in-order.
84778494
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
84788495
);
84798496

@@ -8513,7 +8530,8 @@ urCommandBufferAppendMemBufferReadRectExp(
85138530
///< pointed to by pDst.
85148531
void *pDst, ///< [in] Pointer to host memory where data is to be read into.
85158532
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8516-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8533+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8534+
///< be ignored if command-buffer is in-order.
85178535
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] Sync point associated with this command.
85188536
);
85198537

@@ -8549,7 +8567,8 @@ urCommandBufferAppendMemBufferFillExp(
85498567
size_t offset, ///< [in] offset into the buffer.
85508568
size_t size, ///< [in] fill size in bytes, must be a multiple of patternSize.
85518569
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8552-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8570+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8571+
///< be ignored if command-buffer is in-order.
85538572
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
85548573
);
85558574

@@ -8590,7 +8609,8 @@ urCommandBufferAppendUSMPrefetchExp(
85908609
size_t size, ///< [in] size in bytes to be fetched.
85918610
ur_usm_migration_flags_t flags, ///< [in] USM prefetch flags
85928611
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8593-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8612+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8613+
///< be ignored if command-buffer is in-order.
85948614
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
85958615
);
85968616

@@ -8631,7 +8651,8 @@ urCommandBufferAppendUSMAdviseExp(
86318651
size_t size, ///< [in] size in bytes to be advised.
86328652
ur_usm_advice_flags_t advice, ///< [in] USM memory advice
86338653
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8634-
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8654+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
8655+
///< be ignored if command-buffer is in-order.
86358656
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
86368657
);
86378658

include/ur_print.hpp

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

95009500
os << (params.isUpdatable);
95019501

9502+
os << ", ";
9503+
os << ".isInOrder = ";
9504+
9505+
os << (params.isInOrder);
9506+
9507+
os << ", ";
9508+
os << ".enableProfiling = ";
9509+
9510+
os << (params.enableProfiling);
9511+
95029512
os << "}";
95039513
return os;
95049514
}

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)