Skip to content

Commit 0cd10f6

Browse files
committed
Merge branch 'main' into review/yang/misalign_access
2 parents 727b3d8 + f404f4d commit 0cd10f6

File tree

77 files changed

+1365
-1104
lines changed

Some content is hidden

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

77 files changed

+1365
-1104
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: Build - Fuzztests on L0 HW - Reusable
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
test_label:
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
fuzztest-build-hw:
16+
name: Build and run fuzz tests on L0 HW
17+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
18+
strategy:
19+
matrix:
20+
build_type: [Debug, Release]
21+
compiler: [{c: clang, cxx: clang++}]
22+
23+
runs-on: 'FUZZTESTS'
24+
# In order to use sanitizers, vm.mmap_rnd_bits=28 must be set in the system,
25+
# otherwise random SEGV at the start of the test occurs.
26+
# Alternatively, clang 18.1.0 onwards with fixed sanitizers behavior can be used,
27+
# if available.
28+
# TODO: Remove this advice once clang 18.1.0 is available in the system (like ie. as an apt package).
29+
30+
steps:
31+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
32+
33+
- name: Install pip packages
34+
run: pip install -r third_party/requirements.txt
35+
36+
- name: Download DPC++
37+
run: |
38+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
39+
mkdir dpcpp_compiler
40+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
41+
42+
- name: Build level zero with gcc
43+
run: |
44+
git clone -b v1.17.6 --depth=1 https://github.com/oneapi-src/level-zero.git ${{github.workspace}}/level-zero
45+
cd ${{github.workspace}}/level-zero
46+
cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
47+
cmake --build build -j $(nproc)
48+
49+
- name: Configure CMake
50+
run: >
51+
cmake
52+
-B${{github.workspace}}/build
53+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
54+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
55+
-DUR_ENABLE_TRACING=ON
56+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
57+
-DUR_BUILD_TESTS=ON
58+
-DUR_USE_ASAN=ON
59+
-DUR_USE_UBSAN=ON
60+
-DUR_BUILD_ADAPTER_L0=ON
61+
-DUR_LEVEL_ZERO_LOADER_LIBRARY=${{github.workspace}}/level-zero/build/lib/libze_loader.so
62+
-DUR_LEVEL_ZERO_INCLUDE_DIR=${{github.workspace}}/level-zero/include/
63+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
64+
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
65+
66+
- name: Build
67+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
68+
69+
- name: Fuzz test
70+
working-directory: ${{github.workspace}}/build
71+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "${{inputs.test_label}}" --verbose
72+
73+
- name: Get information about platform
74+
if: ${{ always() }}
75+
run: .github/scripts/get_system_info.sh

.github/workflows/cmake.yml

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -116,51 +116,12 @@ jobs:
116116
working-directory: ${{github.workspace}}/build
117117
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
118118

119-
fuzztest-build:
120-
name: Build and run quick fuzztest scenarios
121-
strategy:
122-
matrix:
123-
build_type: [Debug, Release]
124-
compiler: [{c: clang, cxx: clang++}]
125-
126-
runs-on: 'ubuntu-22.04'
127-
128-
steps:
129-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
130-
131-
- name: Install pip packages
132-
run: pip install -r third_party/requirements.txt
133-
134-
- name: Download DPC++
135-
run: |
136-
sudo apt install libncurses5
137-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
138-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
139-
140-
- name: Setup DPC++
141-
run: |
142-
source ${{github.workspace}}/dpcpp_compiler/startup.sh
143-
144-
- name: Configure CMake
145-
run: >
146-
cmake
147-
-B${{github.workspace}}/build
148-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
149-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
150-
-DUR_ENABLE_TRACING=ON
151-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
152-
-DUR_BUILD_TESTS=ON
153-
-DUR_USE_ASAN=ON
154-
-DUR_USE_UBSAN=ON
155-
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
156-
157-
- name: Build
158-
run: cmake --build ${{github.workspace}}/build -j $(nproc)
159-
160-
- name: Fuzz test
161-
working-directory: ${{github.workspace}}/build
162-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short" --verbose
163-
119+
fuzztest:
120+
name: Fuzz tests short
121+
uses: ./.github/workflows/build-fuzz-reusable.yml
122+
with:
123+
test_label: "fuzz-short"
124+
164125
level-zero:
165126
name: Level Zero
166127
uses: ./.github/workflows/build-hw-reusable.yml
@@ -231,9 +192,6 @@ jobs:
231192
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
232193
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
233194
compiler: {c: clang-cl, cxx: clang-cl}
234-
# TODO: testing is flaky on windows-2022 in Release mode
235-
- os: 'windows-2022'
236-
build_type: Release
237195

238196
build_type: [Debug, Release]
239197
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]

.github/workflows/nightly.yml

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,8 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
long-fuzz-test:
13-
name: Run long fuzz tests
14-
strategy:
15-
matrix:
16-
build_type: [Debug, Release]
17-
compiler: [{c: clang, cxx: clang++}]
18-
19-
runs-on: 'ubuntu-22.04'
20-
21-
steps:
22-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23-
24-
- name: Install pip packages
25-
run: pip install -r third_party/requirements.txt
26-
27-
- name: Download DPC++
28-
run: |
29-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
30-
mkdir dpcpp_compiler
31-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
32-
33-
- name: Configure CMake
34-
run: >
35-
cmake
36-
-B${{github.workspace}}/build
37-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
38-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
39-
-DUR_ENABLE_TRACING=ON
40-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
41-
-DUR_BUILD_TESTS=ON
42-
-DUR_USE_ASAN=ON
43-
-DUR_USE_UBSAN=ON
44-
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
45-
46-
- name: Build
47-
run: >
48-
LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
49-
cmake --build ${{github.workspace}}/build -j $(nproc)
50-
51-
- name: Fuzz long test
52-
working-directory: ${{github.workspace}}/build
53-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-long"
12+
fuzztest:
13+
name: Fuzz tests long
14+
uses: ./.github/workflows/build-fuzz-reusable.yml
15+
with:
16+
test_label: "fuzz-long"

include/ur_api.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ typedef struct ur_queue_handle_t_ *ur_queue_handle_t;
394394

395395
///////////////////////////////////////////////////////////////////////////////
396396
/// @brief Handle of a native object
397-
typedef struct ur_native_handle_t_ *ur_native_handle_t;
397+
typedef uintptr_t ur_native_handle_t;
398398

399399
///////////////////////////////////////////////////////////////////////////////
400400
/// @brief Handle of a Sampler object
@@ -622,7 +622,7 @@ urLoaderConfigRetain(
622622
/// + `NULL == hLoaderConfig`
623623
UR_APIEXPORT ur_result_t UR_APICALL
624624
urLoaderConfigRelease(
625-
ur_loader_config_handle_t hLoaderConfig ///< [in] config handle to release
625+
ur_loader_config_handle_t hLoaderConfig ///< [in][release] config handle to release
626626
);
627627

628628
///////////////////////////////////////////////////////////////////////////////
@@ -845,7 +845,7 @@ urAdapterGet(
845845
/// + `NULL == hAdapter`
846846
UR_APIEXPORT ur_result_t UR_APICALL
847847
urAdapterRelease(
848-
ur_adapter_handle_t hAdapter ///< [in] Adapter handle to release
848+
ur_adapter_handle_t hAdapter ///< [in][release] Adapter handle to release
849849
);
850850

851851
///////////////////////////////////////////////////////////////////////////////
@@ -1764,7 +1764,7 @@ urDeviceRetain(
17641764
/// + `NULL == hDevice`
17651765
UR_APIEXPORT ur_result_t UR_APICALL
17661766
urDeviceRelease(
1767-
ur_device_handle_t hDevice ///< [in] handle of the device to release.
1767+
ur_device_handle_t hDevice ///< [in][release] handle of the device to release.
17681768
);
17691769

17701770
///////////////////////////////////////////////////////////////////////////////
@@ -2271,7 +2271,7 @@ typedef enum ur_context_info_t {
22712271
/// + `NULL == hContext`
22722272
UR_APIEXPORT ur_result_t UR_APICALL
22732273
urContextRelease(
2274-
ur_context_handle_t hContext ///< [in] handle of the context to release.
2274+
ur_context_handle_t hContext ///< [in][release] handle of the context to release.
22752275
);
22762276

22772277
///////////////////////////////////////////////////////////////////////////////
@@ -2761,7 +2761,7 @@ urMemRetain(
27612761
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
27622762
UR_APIEXPORT ur_result_t UR_APICALL
27632763
urMemRelease(
2764-
ur_mem_handle_t hMem ///< [in] handle of the memory object to release
2764+
ur_mem_handle_t hMem ///< [in][release] handle of the memory object to release
27652765
);
27662766

27672767
///////////////////////////////////////////////////////////////////////////////
@@ -3153,7 +3153,7 @@ urSamplerRetain(
31533153
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
31543154
UR_APIEXPORT ur_result_t UR_APICALL
31553155
urSamplerRelease(
3156-
ur_sampler_handle_t hSampler ///< [in] handle of the sampler object to release
3156+
ur_sampler_handle_t hSampler ///< [in][release] handle of the sampler object to release
31573157
);
31583158

31593159
///////////////////////////////////////////////////////////////////////////////
@@ -3712,7 +3712,7 @@ urUSMPoolRetain(
37123712
/// + `NULL == pPool`
37133713
UR_APIEXPORT ur_result_t UR_APICALL
37143714
urUSMPoolRelease(
3715-
ur_usm_pool_handle_t pPool ///< [in] pointer to USM memory pool
3715+
ur_usm_pool_handle_t pPool ///< [in][release] pointer to USM memory pool
37163716
);
37173717

37183718
///////////////////////////////////////////////////////////////////////////////
@@ -4061,7 +4061,7 @@ urPhysicalMemRetain(
40614061
/// + `NULL == hPhysicalMem`
40624062
UR_APIEXPORT ur_result_t UR_APICALL
40634063
urPhysicalMemRelease(
4064-
ur_physical_mem_handle_t hPhysicalMem ///< [in] handle of the physical memory object to release.
4064+
ur_physical_mem_handle_t hPhysicalMem ///< [in][release] handle of the physical memory object to release.
40654065
);
40664066

40674067
#if !defined(__GNUC__)
@@ -4354,7 +4354,7 @@ urProgramRetain(
43544354
/// + `NULL == hProgram`
43554355
UR_APIEXPORT ur_result_t UR_APICALL
43564356
urProgramRelease(
4357-
ur_program_handle_t hProgram ///< [in] handle for the Program to release
4357+
ur_program_handle_t hProgram ///< [in][release] handle for the Program to release
43584358
);
43594359

43604360
///////////////////////////////////////////////////////////////////////////////
@@ -5005,7 +5005,7 @@ urKernelRetain(
50055005
/// + `NULL == hKernel`
50065006
UR_APIEXPORT ur_result_t UR_APICALL
50075007
urKernelRelease(
5008-
ur_kernel_handle_t hKernel ///< [in] handle for the Kernel to release
5008+
ur_kernel_handle_t hKernel ///< [in][release] handle for the Kernel to release
50095009
);
50105010

50115011
///////////////////////////////////////////////////////////////////////////////
@@ -5516,7 +5516,7 @@ urQueueRetain(
55165516
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
55175517
UR_APIEXPORT ur_result_t UR_APICALL
55185518
urQueueRelease(
5519-
ur_queue_handle_t hQueue ///< [in] handle of the queue object to release
5519+
ur_queue_handle_t hQueue ///< [in][release] handle of the queue object to release
55205520
);
55215521

55225522
///////////////////////////////////////////////////////////////////////////////
@@ -5905,7 +5905,7 @@ urEventRetain(
59055905
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
59065906
UR_APIEXPORT ur_result_t UR_APICALL
59075907
urEventRelease(
5908-
ur_event_handle_t hEvent ///< [in] handle of the event object
5908+
ur_event_handle_t hEvent ///< [in][release] handle of the event object
59095909
);
59105910

59115911
///////////////////////////////////////////////////////////////////////////////
@@ -7551,7 +7551,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
75517551
urBindlessImagesUnsampledImageHandleDestroyExp(
75527552
ur_context_handle_t hContext, ///< [in] handle of the context object
75537553
ur_device_handle_t hDevice, ///< [in] handle of the device object
7554-
ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy
7554+
ur_exp_image_handle_t hImage ///< [in][release] pointer to handle of image object to destroy
75557555
);
75567556

75577557
///////////////////////////////////////////////////////////////////////////////
@@ -7576,7 +7576,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
75767576
urBindlessImagesSampledImageHandleDestroyExp(
75777577
ur_context_handle_t hContext, ///< [in] handle of the context object
75787578
ur_device_handle_t hDevice, ///< [in] handle of the device object
7579-
ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy
7579+
ur_exp_image_handle_t hImage ///< [in][release] pointer to handle of image object to destroy
75807580
);
75817581

75827582
///////////////////////////////////////////////////////////////////////////////
@@ -7636,7 +7636,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
76367636
urBindlessImagesImageFreeExp(
76377637
ur_context_handle_t hContext, ///< [in] handle of the context object
76387638
ur_device_handle_t hDevice, ///< [in] handle of the device object
7639-
ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed
7639+
ur_exp_image_mem_handle_t hImageMem ///< [in][release] handle of image memory to be freed
76407640
);
76417641

76427642
///////////////////////////////////////////////////////////////////////////////
@@ -7850,7 +7850,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
78507850
urBindlessImagesMipmapFreeExp(
78517851
ur_context_handle_t hContext, ///< [in] handle of the context object
78527852
ur_device_handle_t hDevice, ///< [in] handle of the device object
7853-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
7853+
ur_exp_image_mem_handle_t hMem ///< [in][release] handle of image memory to be freed
78547854
);
78557855

78567856
///////////////////////////////////////////////////////////////////////////////
@@ -7941,7 +7941,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
79417941
urBindlessImagesReleaseInteropExp(
79427942
ur_context_handle_t hContext, ///< [in] handle of the context object
79437943
ur_device_handle_t hDevice, ///< [in] handle of the device object
7944-
ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed
7944+
ur_exp_interop_mem_handle_t hInteropMem ///< [in][release] handle of interop memory to be freed
79457945
);
79467946

79477947
///////////////////////////////////////////////////////////////////////////////
@@ -7997,7 +7997,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
79977997
urBindlessImagesDestroyExternalSemaphoreExp(
79987998
ur_context_handle_t hContext, ///< [in] handle of the context object
79997999
ur_device_handle_t hDevice, ///< [in] handle of the device object
8000-
ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
8000+
ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
80018001
);
80028002

80038003
///////////////////////////////////////////////////////////////////////////////
@@ -8271,7 +8271,7 @@ urCommandBufferRetainExp(
82718271
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
82728272
UR_APIEXPORT ur_result_t UR_APICALL
82738273
urCommandBufferReleaseExp(
8274-
ur_exp_command_buffer_handle_t hCommandBuffer ///< [in] Handle of the command-buffer object.
8274+
ur_exp_command_buffer_handle_t hCommandBuffer ///< [in][release] Handle of the command-buffer object.
82758275
);
82768276

82778277
///////////////////////////////////////////////////////////////////////////////
@@ -8819,7 +8819,7 @@ urCommandBufferRetainCommandExp(
88198819
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
88208820
UR_APIEXPORT ur_result_t UR_APICALL
88218821
urCommandBufferReleaseCommandExp(
8822-
ur_exp_command_buffer_command_handle_t hCommand ///< [in] Handle of the command-buffer command.
8822+
ur_exp_command_buffer_command_handle_t hCommand ///< [in][release] Handle of the command-buffer command.
88238823
);
88248824

88258825
///////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)