Skip to content

Commit 58f6851

Browse files
Merge branch 'main' into steffen/composite_devices_not_supported_and_empty
2 parents e5baa6f + 3077fd4 commit 58f6851

Some content is hidden

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

60 files changed

+1699
-757
lines changed

.github/workflows/e2e_core.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,23 @@ jobs:
178178
id: tests
179179
run: ninja -C build-e2e check-sycl-e2e
180180

181-
- name: Add comment to PR
182-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
183-
if: ${{ always() }}
184-
with:
185-
script: |
186-
const adapter = '${{ matrix.adapter.name }}';
187-
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
188-
const test_status = '${{ steps.tests.outcome }}';
189-
const job_status = '${{ job.status }}';
190-
const body = `E2E ${adapter} build:\n${url}\nJob status: ${job_status}. Test status: ${test_status}`;
191-
192-
github.rest.issues.createComment({
193-
issue_number: context.issue.number,
194-
owner: context.repo.owner,
195-
repo: context.repo.repo,
196-
body: body
197-
})
181+
# FIXME: Requires pull-request: write permissions but this is only granted
182+
# on pull requests from forks if using pull_request_target workflow
183+
# trigger but not the pull_request trigger..
184+
# - name: Add comment to PR
185+
# uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
186+
# if: ${{ always() }}
187+
# with:
188+
# script: |
189+
# const adapter = '${{ matrix.adapter.name }}';
190+
# const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
191+
# const test_status = '${{ steps.tests.outcome }}';
192+
# const job_status = '${{ job.status }}';
193+
# const body = `E2E ${adapter} build:\n${url}\nJob status: ${job_status}. Test status: ${test_status}`;
194+
195+
# github.rest.issues.createComment({
196+
# issue_number: context.issue.number,
197+
# owner: context.repo.owner,
198+
# repo: context.repo.repo,
199+
# body: body
200+
# })

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(CMAKE_CXX_STANDARD 17)
2525
set(CMAKE_CXX_STANDARD_REQUIRED YES)
2626

2727
# Build Options
28+
option(UR_BUILD_EXAMPLES "Build example applications." ON)
2829
option(UR_BUILD_TESTS "Build unit tests." ON)
2930
option(UR_BUILD_TOOLS "build ur tools" ON)
3031
option(UR_FORMAT_CPP_STYLE "format code style of C++ sources" OFF)
@@ -258,7 +259,9 @@ install(
258259
EXPORT ${PROJECT_NAME}-targets)
259260

260261
add_subdirectory(source)
261-
add_subdirectory(examples)
262+
if(UR_BUILD_EXAMPLES)
263+
add_subdirectory(examples)
264+
endif()
262265
if(UR_BUILD_TESTS)
263266
add_subdirectory(test)
264267
endif()

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ List of options provided by CMake:
118118

119119
| Name | Description | Values | Default |
120120
| - | - | - | - |
121+
| UR_BUILD_EXAMPLES | Build example applications | ON/OFF | ON |
121122
| UR_BUILD_TESTS | Build the tests | ON/OFF | ON |
122123
| UR_BUILD_TOOLS | Build tools | ON/OFF | ON |
123124
| UR_FORMAT_CPP_STYLE | Format code style | ON/OFF | OFF |

include/ur_api.h

Lines changed: 72 additions & 53 deletions
Large diffs are not rendered by default.

include/ur_print.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,9 +1454,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value) {
14541454
case UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
14551455
os << "UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR";
14561456
break;
1457-
case UR_RESULT_ERROR_IMAGE_FORMAT_NOT_SUPPORTED:
1458-
os << "UR_RESULT_ERROR_IMAGE_FORMAT_NOT_SUPPORTED";
1459-
break;
14601457
case UR_RESULT_ERROR_MEM_OBJECT_ALLOCATION_FAILURE:
14611458
os << "UR_RESULT_ERROR_MEM_OBJECT_ALLOCATION_FAILURE";
14621459
break;
@@ -5466,9 +5463,6 @@ inline ur_result_t printFlag<ur_mem_flag_t>(std::ostream &os, uint32_t flag) {
54665463
/// std::ostream &
54675464
inline std::ostream &operator<<(std::ostream &os, enum ur_mem_type_t value) {
54685465
switch (value) {
5469-
case UR_MEM_TYPE_BUFFER:
5470-
os << "UR_MEM_TYPE_BUFFER";
5471-
break;
54725466
case UR_MEM_TYPE_IMAGE2D:
54735467
os << "UR_MEM_TYPE_IMAGE2D";
54745468
break;
@@ -5484,9 +5478,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_mem_type_t value) {
54845478
case UR_MEM_TYPE_IMAGE1D_ARRAY:
54855479
os << "UR_MEM_TYPE_IMAGE1D_ARRAY";
54865480
break;
5487-
case UR_MEM_TYPE_IMAGE1D_BUFFER:
5488-
os << "UR_MEM_TYPE_IMAGE1D_BUFFER";
5489-
break;
54905481
case UR_MEM_TYPE_IMAGE_CUBEMAP_EXP:
54915482
os << "UR_MEM_TYPE_IMAGE_CUBEMAP_EXP";
54925483
break;

scripts/core/EXP-BINDLESS-IMAGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Runtime:
5050
* Sampled images
5151
* Unsampled images
5252
* Mipmaps
53+
* Image arrays
5354
* Cubemaps
5455
* USM backed images
5556

@@ -207,6 +208,8 @@ Changelog
207208
+------------------------------------------------------------------------+
208209
| 11.0 | Added device queries for sampled image fetch capabilities. |
209210
+----------+-------------------------------------------------------------+
211+
| 12.0 | Added image arrays to list of supported bindless images |
212+
+----------+-------------------------------------------------------------+
210213

211214
Contributors
212215
--------------------------------------------------------------------------------

scripts/core/PROG.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,39 @@ native handle to a driver handle. For example, OpenCL platform
277277
may expose an extension ${x}ProgramCreateWithNativeHandle to retrieve
278278
a cl_program.
279279

280+
Memory
281+
======
282+
283+
UR Mem Handles
284+
--------------
285+
286+
A ${x}_mem_handle_t can represent an untyped memory buffer object, created by
287+
${x}MemBufferCreate, or a memory image object, created by ${x}MemImageCreate.
288+
A ${x}_mem_handle_t manages the internal allocation and deallocation of native
289+
memory objects across all devices in a ${x}_context_handle_t. A
290+
${x}_mem_handle_t may only be used by queues that share the same
291+
${x}_context_handle_t.
292+
293+
If multiple queues in the same ${x}_context_handle_t use the same
294+
${x}_mem_handle_t across dependent commands, a dependency must be defined by the
295+
user using the enqueue entry point's phEventWaitList parameter. Provided that
296+
dependencies are explicitly passed to UR entry points, a UR adapter will manage
297+
memory migration of native memory objects across all devices in a context, if
298+
memory migration is indeed necessary in the backend API.
299+
300+
.. parsed-literal::
301+
302+
// Q1 and Q2 are both in hContext
303+
${x}_mem_handle_t hBuffer;
304+
${x}MemBufferCreate(hContext,,,,&hBuffer);
305+
${x}EnqueueMemBufferWrite(Q1, hBuffer,,,,,,, &outEv);
306+
${x}EnqueueMemBufferRead(Q2, hBuffer,,,,, 1, &outEv /*phEventWaitList*/, );
307+
308+
As such, the buffer written to in ${x}EnqueueMemBufferWrite can be
309+
successfully read using ${x}EnqueueMemBufferRead from another queue in the same
310+
context, since the event associated with the write operation has been passed as
311+
a dependency to the read operation.
312+
280313
Memory Pooling
281314
----------------------------------
282315

scripts/core/common.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ etors:
205205
desc: "Invalid image size"
206206
- name: ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR
207207
desc: "Invalid image format descriptor"
208-
- name: ERROR_IMAGE_FORMAT_NOT_SUPPORTED
209-
desc: "Image format not supported"
210208
- name: ERROR_MEM_OBJECT_ALLOCATION_FAILURE
211209
desc: "Memory object allocation failure"
212210
- name: ERROR_INVALID_PROGRAM_EXECUTABLE

scripts/core/exp-bindless-images.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ returns:
387387
- $X_RESULT_ERROR_INVALID_CONTEXT
388388
- $X_RESULT_ERROR_INVALID_VALUE
389389
- $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
390-
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`"
390+
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`"
391391
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
392392
- $X_RESULT_ERROR_INVALID_OPERATION
393393
--- #--------------------------------------------------------------------------
@@ -442,7 +442,7 @@ returns:
442442
- $X_RESULT_ERROR_INVALID_CONTEXT
443443
- $X_RESULT_ERROR_INVALID_VALUE
444444
- $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
445-
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`"
445+
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`"
446446
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
447447
- $X_RESULT_ERROR_INVALID_OPERATION
448448
--- #--------------------------------------------------------------------------
@@ -479,7 +479,7 @@ returns:
479479
- $X_RESULT_ERROR_INVALID_CONTEXT
480480
- $X_RESULT_ERROR_INVALID_VALUE
481481
- $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
482-
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`"
482+
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`"
483483
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
484484
- $X_RESULT_ERROR_INVALID_SAMPLER
485485
- $X_RESULT_ERROR_INVALID_OPERATION
@@ -542,7 +542,7 @@ returns:
542542
- $X_RESULT_ERROR_INVALID_QUEUE
543543
- $X_RESULT_ERROR_INVALID_VALUE
544544
- $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
545-
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`"
545+
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`"
546546
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
547547
- $X_RESULT_ERROR_INVALID_OPERATION
548548
--- #--------------------------------------------------------------------------
@@ -679,7 +679,7 @@ returns:
679679
- $X_RESULT_ERROR_INVALID_CONTEXT
680680
- $X_RESULT_ERROR_INVALID_VALUE
681681
- $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
682-
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`"
682+
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`"
683683
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
684684
- $X_RESULT_ERROR_INVALID_OPERATION
685685
- $X_RESULT_ERROR_OUT_OF_RESOURCES

scripts/core/exp-command-buffer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ returns:
900900
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
901901
--- #--------------------------------------------------------------------------
902902
type: function
903-
desc: "Update a kernel launch command in a finalized command-buffer."
903+
desc: "Update a kernel launch command in a finalized command-buffer. This entry-point is synchronous and may block if the command-buffer is executing when the entry-point is called."
904904
class: $xCommandBuffer
905905
name: UpdateKernelLaunchExp
906906
params:

0 commit comments

Comments
 (0)