Skip to content

Commit b22a0ae

Browse files
committed
Merge branch 'main' into merge-some-main-changes-into-adapters-third-patch
2 parents 863d230 + a1fbbde commit b22a0ae

File tree

87 files changed

+9175
-6097
lines changed

Some content is hidden

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

87 files changed

+9175
-6097
lines changed

.github/workflows/cmake.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@ jobs:
292292
- name: Install prerequisites
293293
run: python3 -m pip install -r third_party/requirements.txt
294294

295+
- name: Install doxygen
296+
run: |
297+
$WorkingDir = $PWD.Path
298+
Invoke-WebRequest -Uri https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.windows.x64.bin.zip -OutFile "$WorkingDir\doxygen.zip"
299+
Expand-Archive -Path "$WorkingDir\doxygen.zip"
300+
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen"
301+
295302
- name: Configure CMake
296303
run: >
297304
cmake

.github/workflows/e2e_nightly.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: E2E Nightly
2+
3+
on:
4+
schedule:
5+
# Run every day at 23:00 UTC
6+
- cron: '0 23 * * *'
7+
8+
jobs:
9+
e2e-build-hw:
10+
name: Build SYCL, UR, run E2E
11+
strategy:
12+
matrix:
13+
adapter: [
14+
{name: CUDA}
15+
]
16+
build_type: [Release]
17+
compiler: [{c: clang, cxx: clang++}]
18+
19+
runs-on: ${{matrix.adapter.name}}
20+
21+
steps:
22+
# Workspace on self-hosted runners is not cleaned automatically.
23+
# We have to delete the files created outside of using actions.
24+
- name: Cleanup self-hosted workspace
25+
if: always()
26+
run: |
27+
ls -la ./
28+
rm -rf ./* || true
29+
30+
- name: Checkout UR
31+
uses: actions/checkout@v4
32+
with:
33+
ref: adapters
34+
path: ur-repo
35+
36+
- name: Checkout SYCL
37+
uses: actions/checkout@v4
38+
with:
39+
repository: intel/llvm
40+
ref: sycl
41+
path: sycl-repo
42+
43+
- name: Install pip packages
44+
working-directory: ${{github.workspace}}/ur-repo
45+
run: pip install -r third_party/requirements.txt
46+
47+
- name: Configure CMake UR
48+
working-directory: ${{github.workspace}}/ur-repo
49+
run: >
50+
cmake
51+
-B build
52+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
53+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
54+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
55+
-DUR_ENABLE_TRACING=ON
56+
-DUR_DEVELOPER_MODE=ON
57+
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
58+
59+
- name: Build UR
60+
run: LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
61+
cmake --build ${{github.workspace}}/ur-repo/build -j $(nproc)
62+
63+
- name: Set env vars & pre setup
64+
run: |
65+
echo "SYCL_PREFER_UR=1" >> $GITHUB_ENV
66+
echo "CUDA_LIB_PATH=/usr/local/cuda/lib64/stubs" >> $GITHUB_ENV
67+
echo "LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
68+
source /opt/intel/oneapi/setvars.sh
69+
sycl-ls
70+
71+
- name: Configure SYCL
72+
run: >
73+
python3 sycl-repo/buildbot/configure.py
74+
-t ${{matrix.build_type}}
75+
-o ${{github.workspace}}/sycl_build
76+
--cmake-gen "Unix Makefiles"
77+
--ci-defaults --cuda --hip
78+
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
79+
--cmake-opt="-DSYCL_PI_TESTS=OFF"
80+
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
81+
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
82+
83+
- name: Build SYCL
84+
run: cmake --build ${{github.workspace}}/sycl_build
85+
86+
- name: Run check-sycl
87+
# Remove after fixing SYCL test :: abi/layout_handler.cpp
88+
# This issue does not affect further execution of e2e with UR.
89+
continue-on-error: true
90+
run: cmake --build ${{github.workspace}}/sycl_build --target check-sycl
91+
92+
- name: Swap UR loader and adapters
93+
run: |
94+
cp ${{github.workspace}}/ur-repo/build/lib/libur_loader.so* ${{github.workspace}}/sycl_build/lib/
95+
cp ${{github.workspace}}/ur-repo/build/lib/libur_adapter_cuda.so* ${{github.workspace}}/sycl_build/lib/
96+
97+
- name: Set additional env. vars
98+
run: |
99+
echo "${{github.workspace}}/sycl_build/bin" >> $GITHUB_PATH
100+
echo "LD_LIBRARY_PATH=${{github.workspace}}/sycl_build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
101+
102+
# Running (newly built) sycl-ls sets up some extra variables
103+
- name: Setup SYCL variables
104+
run: |
105+
which clang++ sycl-ls
106+
SYCL_PI_TRACE=-1 sycl-ls
107+
108+
- name: Build e2e tests
109+
run: >
110+
cmake
111+
-GNinja
112+
-B ${{github.workspace}}/build-e2e/
113+
-S ${{github.workspace}}/sycl-repo/sycl/test-e2e/
114+
-DSYCL_TEST_E2E_TARGETS="ext_oneapi_cuda:gpu"
115+
-DCMAKE_CXX_COMPILER="$(which clang++)"
116+
-DLLVM_LIT="${{github.workspace}}/sycl-repo/llvm/utils/lit/lit.py"
117+
118+
- name: Run e2e tests
119+
run: ninja -C build-e2e check-sycl-e2e

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ see cmake options for details.
3131
- [Adapter naming convention](#adapter-naming-convention)
3232
- [Source code generation](#source-code-generation)
3333
- [Documentation](#documentation)
34-
34+
6. [Release Process](#release-process)
3535

3636
## Contents of the repo
3737

@@ -182,3 +182,26 @@ Code is generated using included [Python scripts](/scripts/README.md).
182182

183183
Documentation is generated from source code using Sphinx -
184184
see [scripts dir](/scripts/README.md) for details.
185+
186+
## Release Process
187+
188+
Unified Runtime releases are aligned with oneAPI releases. Once all changes
189+
planned for a release have been accepted, the release process is defined as:
190+
191+
1. Create a new release branch based on the [main][main-branch] branch taking
192+
the form `v<major>.<minor>.x` where `x` is a placeholder for the patch
193+
version. This branch will always contain the latest patch version for a given
194+
release.
195+
2. Create a PR to increment the CMake project version on the [main][main-branch]
196+
and merge before accepting any other changes.
197+
3. Create a new tag based on the latest commit on the release branch taking the
198+
form `v<major>.<minor>.<patch>`.
199+
4. Create a [new GitHub release][new-github-release] using the tag created in
200+
the previous step.
201+
* Prior to version 1.0, check the *Set as a pre-release* tick box.
202+
5. Update downstream projects to utilize the release tag. If any issues arise
203+
from integration, apply any necessary hot fixes to `v<major>.<minor>.x`
204+
branch and go back to step 3.
205+
206+
[main-branch]: https://github.com/oneapi-src/unified-runtime/tree/main
207+
[new-github-release]: https://github.com/oneapi-src/unified-runtime/releases/new

include/ur.py

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ class ur_function_v(IntEnum):
202202
KERNEL_SUGGEST_MAX_COOPERATIVE_GROUP_COUNT_EXP = 194## Enumerator for ::urKernelSuggestMaxCooperativeGroupCountExp
203203
COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP = 195 ## Enumerator for ::urCommandBufferAppendUSMPrefetchExp
204204
COMMAND_BUFFER_APPEND_USM_ADVISE_EXP = 196 ## Enumerator for ::urCommandBufferAppendUSMAdviseExp
205+
PROGRAM_BUILD_EXP = 197 ## Enumerator for ::urProgramBuildExp
206+
PROGRAM_COMPILE_EXP = 198 ## Enumerator for ::urProgramCompileExp
207+
PROGRAM_LINK_EXP = 199 ## Enumerator for ::urProgramLinkExp
208+
LOADER_CONFIG_SET_CODE_LOCATION_CALLBACK = 200 ## Enumerator for ::urLoaderConfigSetCodeLocationCallback
205209

206210
class ur_function_t(c_int):
207211
def __str__(self):
@@ -518,6 +522,24 @@ def __str__(self):
518522
return str(ur_loader_config_info_v(self.value))
519523

520524

525+
###############################################################################
526+
## @brief Code location data
527+
class ur_code_location_t(Structure):
528+
_fields_ = [
529+
("functionName", c_char_p), ## [in][out] Function name.
530+
("sourceFile", c_char_p), ## [in][out] Source code file.
531+
("lineNumber", c_ulong), ## [in][out] Source code line number.
532+
("columnNumber", c_ulong) ## [in][out] Source code column number.
533+
]
534+
535+
###############################################################################
536+
## @brief Code location callback with user data.
537+
def ur_code_location_callback_t(user_defined_callback):
538+
@CFUNCTYPE(ur_code_location_t, c_void_p)
539+
def ur_code_location_callback_t_wrapper(pUserData):
540+
return user_defined_callback(pUserData)
541+
return ur_code_location_callback_t_wrapper
542+
521543
###############################################################################
522544
## @brief Supported adapter info
523545
class ur_adapter_info_v(IntEnum):
@@ -2106,10 +2128,10 @@ class ur_event_native_properties_t(Structure):
21062128
###############################################################################
21072129
## @brief Event states for all events.
21082130
class ur_execution_info_v(IntEnum):
2109-
EXECUTION_INFO_COMPLETE = 0 ## Indicates that the event has completed.
2110-
EXECUTION_INFO_RUNNING = 1 ## Indicates that the device has started processing this event.
2111-
EXECUTION_INFO_SUBMITTED = 2 ## Indicates that the event has been submitted by the host to the device.
2112-
EXECUTION_INFO_QUEUED = 3 ## Indicates that the event has been queued, this is the initial state of
2131+
COMPLETE = 0 ## Indicates that the event has completed.
2132+
RUNNING = 1 ## Indicates that the device has started processing this event.
2133+
SUBMITTED = 2 ## Indicates that the event has been submitted by the host to the device.
2134+
QUEUED = 3 ## Indicates that the event has been queued, this is the initial state of
21132135
## events.
21142136

21152137
class ur_execution_info_t(c_int):
@@ -2296,6 +2318,11 @@ class ur_exp_command_buffer_handle_t(c_void_p):
22962318
## which is returned when querying device extensions.
22972319
UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP = "ur_exp_cooperative_kernels"
22982320

2321+
###############################################################################
2322+
## @brief The extension string which defines support for test
2323+
## which is returned when querying device extensions.
2324+
UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP = "ur_exp_multi_device_compile"
2325+
22992326
###############################################################################
23002327
## @brief Supported peer info
23012328
class ur_exp_peer_info_v(IntEnum):
@@ -2612,6 +2639,37 @@ class ur_program_dditable_t(Structure):
26122639
("pfnCreateWithNativeHandle", c_void_p) ## _urProgramCreateWithNativeHandle_t
26132640
]
26142641

2642+
###############################################################################
2643+
## @brief Function-pointer for urProgramBuildExp
2644+
if __use_win_types:
2645+
_urProgramBuildExp_t = WINFUNCTYPE( ur_result_t, ur_program_handle_t, c_ulong, POINTER(ur_device_handle_t), c_char_p )
2646+
else:
2647+
_urProgramBuildExp_t = CFUNCTYPE( ur_result_t, ur_program_handle_t, c_ulong, POINTER(ur_device_handle_t), c_char_p )
2648+
2649+
###############################################################################
2650+
## @brief Function-pointer for urProgramCompileExp
2651+
if __use_win_types:
2652+
_urProgramCompileExp_t = WINFUNCTYPE( ur_result_t, ur_program_handle_t, c_ulong, POINTER(ur_device_handle_t), c_char_p )
2653+
else:
2654+
_urProgramCompileExp_t = CFUNCTYPE( ur_result_t, ur_program_handle_t, c_ulong, POINTER(ur_device_handle_t), c_char_p )
2655+
2656+
###############################################################################
2657+
## @brief Function-pointer for urProgramLinkExp
2658+
if __use_win_types:
2659+
_urProgramLinkExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, c_ulong, POINTER(ur_device_handle_t), c_ulong, POINTER(ur_program_handle_t), c_char_p, POINTER(ur_program_handle_t) )
2660+
else:
2661+
_urProgramLinkExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, c_ulong, POINTER(ur_device_handle_t), c_ulong, POINTER(ur_program_handle_t), c_char_p, POINTER(ur_program_handle_t) )
2662+
2663+
2664+
###############################################################################
2665+
## @brief Table of ProgramExp functions pointers
2666+
class ur_program_exp_dditable_t(Structure):
2667+
_fields_ = [
2668+
("pfnBuildExp", c_void_p), ## _urProgramBuildExp_t
2669+
("pfnCompileExp", c_void_p), ## _urProgramCompileExp_t
2670+
("pfnLinkExp", c_void_p) ## _urProgramLinkExp_t
2671+
]
2672+
26152673
###############################################################################
26162674
## @brief Function-pointer for urKernelCreate
26172675
if __use_win_types:
@@ -3843,6 +3901,7 @@ class ur_dditable_t(Structure):
38433901
("Context", ur_context_dditable_t),
38443902
("Event", ur_event_dditable_t),
38453903
("Program", ur_program_dditable_t),
3904+
("ProgramExp", ur_program_exp_dditable_t),
38463905
("Kernel", ur_kernel_dditable_t),
38473906
("KernelExp", ur_kernel_exp_dditable_t),
38483907
("Sampler", ur_sampler_dditable_t),
@@ -3947,6 +4006,18 @@ def __init__(self, version : ur_api_version_t):
39474006
self.urProgramGetNativeHandle = _urProgramGetNativeHandle_t(self.__dditable.Program.pfnGetNativeHandle)
39484007
self.urProgramCreateWithNativeHandle = _urProgramCreateWithNativeHandle_t(self.__dditable.Program.pfnCreateWithNativeHandle)
39494008

4009+
# call driver to get function pointers
4010+
ProgramExp = ur_program_exp_dditable_t()
4011+
r = ur_result_v(self.__dll.urGetProgramExpProcAddrTable(version, byref(ProgramExp)))
4012+
if r != ur_result_v.SUCCESS:
4013+
raise Exception(r)
4014+
self.__dditable.ProgramExp = ProgramExp
4015+
4016+
# attach function interface to function address
4017+
self.urProgramBuildExp = _urProgramBuildExp_t(self.__dditable.ProgramExp.pfnBuildExp)
4018+
self.urProgramCompileExp = _urProgramCompileExp_t(self.__dditable.ProgramExp.pfnCompileExp)
4019+
self.urProgramLinkExp = _urProgramLinkExp_t(self.__dditable.ProgramExp.pfnLinkExp)
4020+
39504021
# call driver to get function pointers
39514022
Kernel = ur_kernel_dditable_t()
39524023
r = ur_result_v(self.__dll.urGetKernelProcAddrTable(version, byref(Kernel)))

0 commit comments

Comments
 (0)