Skip to content

Commit 6a3fec0

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into fix_external_import_function_call
2 parents f18bb38 + f15e86b commit 6a3fec0

File tree

50 files changed

+539
-156
lines changed

Some content is hidden

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

50 files changed

+539
-156
lines changed

.github/workflows/sycl-post-commit.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ jobs:
103103
&& success()
104104
&& github.repository == 'intel/llvm'
105105
uses: ./.github/workflows/sycl-windows-build.yml
106-
106+
with:
107+
compiler: icx
108+
build_configure_extra_args: --cmake-opt=-DCMAKE_C_FLAGS="/clang:-Wno-nonportable-include-path /clang:-Wno-cast-function-type-mismatch" --cmake-opt=-DCMAKE_CXX_FLAGS="/clang:-Wno-nonportable-include-path /clang:-Wno-cast-function-type-mismatch" --cmake-opt="-DCMAKE_EXE_LINKER_FLAGS=/manifest:no" --cmake-opt="-DCMAKE_MODULE_LINKER_FLAGS=/manifest:no" --cmake-opt="-DCMAKE_SHARED_LINKER_FLAGS=/manifest:no"
109+
build_cache_suffix: icx
110+
107111
e2e-win:
108112
needs: build-win
109113
# Continue if build was successful.
@@ -117,6 +121,7 @@ jobs:
117121
runner: '["Windows","gen12"]'
118122
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
119123
extra_lit_opts: --param gpu-intel-gen12=True
124+
compiler: icx
120125

121126
macos_default:
122127
name: macOS

.github/workflows/sycl-windows-build.yml

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
build_ref:
1111
type: string
1212
required: false
13+
build_configure_extra_args:
14+
type: string
15+
required: false
1316
changes:
1417
type: string
1518
description: 'Filter matches for the changed files in the PR'
@@ -22,6 +25,10 @@ on:
2225
description: 'Artifacts retention period'
2326
type: string
2427
default: 3
28+
compiler:
29+
type: string
30+
required: false
31+
default: "cl"
2532

2633
outputs:
2734
build_conclusion:
@@ -41,6 +48,9 @@ on:
4148
type: choice
4249
options:
4350
- "default"
51+
build_configure_extra_args:
52+
type: string
53+
required: false
4454
artifact_archive_name:
4555
type: choice
4656
options:
@@ -50,6 +60,12 @@ on:
5060
type: choice
5161
options:
5262
- 3
63+
compiler:
64+
type: choice
65+
options:
66+
- cl
67+
- icx
68+
5369
permissions: read-all
5470

5571
jobs:
@@ -61,37 +77,43 @@ jobs:
6177
outputs:
6278
build_conclusion: ${{ steps.build.conclusion }}
6379
steps:
80+
- uses: actions/checkout@v4
81+
with:
82+
path: src
83+
ref: ${{ inputs.build_ref || github.sha }}
84+
fetch-depth: 1
6485
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
6586
with:
6687
arch: amd64
88+
- name: Setup oneAPI env
89+
uses: ./src/devops/actions/setup_windows_oneapi_env
90+
if: ${{ always() && !cancelled() && inputs.compiler == 'icx' }}
6791
- name: Set env
6892
run: |
6993
git config --system core.longpaths true
7094
git config --global core.autocrlf false
7195
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
72-
echo "SCCACHE_DIR=D:\github\_work\cache\${{ inputs.build_cache_suffix }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
73-
- uses: actions/checkout@v4
74-
with:
75-
path: src
76-
ref: ${{ inputs.build_ref || github.sha }}
77-
fetch-depth: 1
96+
echo "CCACHE_DIR=D:\github\_work\cache\${{ inputs.build_cache_suffix }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
97+
echo "CCACHE_MAXSIZE=10G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
7898
- name: Register cleanup after job is finished
7999
uses: ./src/devops/actions/cleanup
80100
- name: Configure
81101
shell: cmd
102+
env:
103+
ARGS: ${{ inputs.build_configure_extra_args }}
82104
# TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83
83105
run: |
84106
mkdir build
85107
mkdir install
86108
IF NOT EXIST D:\github\_work\cache MKDIR D:\github\_work\cache
87109
IF NOT EXIST D:\github\_work\cache\${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
88110
python.exe src/buildbot/configure.py -o build ^
89-
--ci-defaults ^
90-
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
91-
--cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^
111+
--ci-defaults %ARGS% ^
112+
--cmake-opt="-DCMAKE_C_COMPILER=${{inputs.compiler}}" ^
113+
--cmake-opt="-DCMAKE_CXX_COMPILER=${{inputs.compiler}}" ^
92114
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
93-
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^
94-
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^
115+
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache" ^
116+
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=ccache" ^
95117
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" ^
96118
--cmake-opt="-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV"
97119
- name: Build
@@ -101,16 +123,24 @@ jobs:
101123
cmake --build build --target sycl-toolchain
102124
- name: check-llvm
103125
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
126+
shell: bash
104127
run: |
128+
if [[ ${{inputs.compiler}} == 'icx' ]]; then
129+
export LIT_FILTER="SYCL"
130+
fi
105131
cmake --build build --target check-llvm
106132
- name: check-clang
107133
if: always() && !cancelled() && contains(inputs.changes, 'clang')
108134
run: |
109135
cmake --build build --target check-clang
110136
- name: check-sycl
111137
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
138+
shell: bash
112139
run: |
113-
cmake --build build --target check-sycl
140+
if [[ ${{inputs.compiler}} == 'icx' ]]; then
141+
export LIT_FILTER_OUT="host_tanpi_double_accuracy"
142+
fi
143+
cmake --build build --target check-sycl
114144
- name: check-sycl-unittests
115145
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
116146
run: |

.github/workflows/sycl-windows-run-tests.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ on:
3333
default: '{}'
3434
required: False
3535

36+
compiler:
37+
type: string
38+
required: false
39+
default: "cl"
40+
3641
permissions: read-all
3742

3843
jobs:
@@ -42,20 +47,23 @@ jobs:
4247
environment: WindowsCILock
4348
env: ${{ fromJSON(inputs.env) }}
4449
steps:
50+
# TODO: use cached_checkout
51+
- uses: actions/checkout@v4
52+
with:
53+
persist-credentials: false
54+
ref: ${{ inputs.ref || github.sha }}
55+
path: llvm
4556
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
4657
with:
4758
arch: amd64
59+
- name: Setup oneAPI env
60+
uses: ./llvm/devops/actions/setup_windows_oneapi_env
61+
if: ${{ always() && !cancelled() && inputs.compiler == 'icx' }}
4862
- name: Set env
4963
run: |
5064
git config --system core.longpaths true
5165
git config --global core.autocrlf false
5266
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
53-
# TODO: use cached_checkout
54-
- uses: actions/checkout@v4
55-
with:
56-
persist-credentials: false
57-
ref: ${{ inputs.ref || github.sha }}
58-
path: llvm
5967
- name: Register cleanup after job is finished
6068
uses: ./llvm/devops/actions/cleanup
6169
- name: Download compiler toolchain
@@ -84,6 +92,9 @@ jobs:
8492
shell: bash
8593
run: |
8694
# Run E2E tests.
95+
if [[ ${{inputs.compiler}} == 'icx' ]]; then
96+
export LIT_FILTER_OUT="compile_on_win_with_mdd"
97+
fi
8798
export LIT_OPTS="-v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests ${{ inputs.extra_lit_opts }}"
8899
cmake --build build-e2e --target check-sycl-e2e
89100
- name: Detect hung tests
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Windows setup oneAPI env
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Setup oneAPI env
7+
shell: powershell
8+
run: |
9+
$batchFilePath = "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
10+
11+
$githubEnvFilePath = $env:GITHUB_ENV
12+
13+
$envBefore = Get-ChildItem Env: | ForEach-Object { "$($_.Name)=$($_.Value)" }
14+
15+
$envVars = & cmd.exe /c "call `"$batchFilePath`" && set" | Out-String
16+
17+
$envAfter = $envVars -split "`r`n" | Where-Object { $_ -match "^(.*?)=(.*)$" }
18+
19+
foreach ($envVar in $envAfter) {
20+
if ($envVar -match "^(.*?)=(.*)$") {
21+
$name = $matches[1]
22+
$value = $matches[2]
23+
$envBeforeVar = $envBefore | Where-Object { $_ -like "$name=*" }
24+
if (-not $envBeforeVar -or $envBeforeVar -ne "$name=$value") {
25+
Add-Content -Path $githubEnvFilePath -Value "$name=$value"
26+
}
27+
}
28+
}

sycl/include/sycl/ext/oneapi/experimental/enqueue_functions.hpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,27 @@ template <typename LCRangeT, typename LCPropertiesT> struct LaunchConfigAccess {
8989
}
9090
};
9191

92-
template <typename CommandGroupFunc>
93-
void submit_impl(queue &Q, CommandGroupFunc &&CGF,
92+
template <typename CommandGroupFunc, typename PropertiesT>
93+
void submit_impl(queue &Q, PropertiesT Props, CommandGroupFunc &&CGF,
9494
const sycl::detail::code_location &CodeLoc) {
95-
Q.submit_without_event(std::forward<CommandGroupFunc>(CGF), CodeLoc);
95+
Q.submit_without_event(Props, std::forward<CommandGroupFunc>(CGF), CodeLoc);
96+
}
97+
98+
template <typename CommandGroupFunc, typename PropertiesT>
99+
event submit_with_event_impl(queue &Q, PropertiesT Props,
100+
CommandGroupFunc &&CGF,
101+
const sycl::detail::code_location &CodeLoc) {
102+
return Q.submit_with_event(Props, std::forward<CommandGroupFunc>(CGF),
103+
nullptr, CodeLoc);
96104
}
97105
} // namespace detail
98106

99107
template <typename CommandGroupFunc, typename PropertiesT>
100108
void submit(queue Q, PropertiesT Props, CommandGroupFunc &&CGF,
101109
const sycl::detail::code_location &CodeLoc =
102110
sycl::detail::code_location::current()) {
103-
std::ignore = Props;
104111
sycl::ext::oneapi::experimental::detail::submit_impl(
105-
Q, std::forward<CommandGroupFunc>(CGF), CodeLoc);
112+
Q, Props, std::forward<CommandGroupFunc>(CGF), CodeLoc);
106113
}
107114

108115
template <typename CommandGroupFunc>
@@ -116,8 +123,8 @@ template <typename CommandGroupFunc, typename PropertiesT>
116123
event submit_with_event(queue Q, PropertiesT Props, CommandGroupFunc &&CGF,
117124
const sycl::detail::code_location &CodeLoc =
118125
sycl::detail::code_location::current()) {
119-
std::ignore = Props;
120-
return Q.submit(std::forward<CommandGroupFunc>(CGF), CodeLoc);
126+
return sycl::ext::oneapi::experimental::detail::submit_with_event_impl(
127+
Q, Props, std::forward<CommandGroupFunc>(CGF), CodeLoc);
121128
}
122129

123130
template <typename CommandGroupFunc>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//==-- cluster_group_prop.hpp --- SYCL extension for event mode property ---==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#pragma once
10+
11+
#include <sycl/ext/oneapi/properties/property.hpp>
12+
13+
namespace sycl {
14+
inline namespace _V1 {
15+
namespace ext::oneapi::experimental {
16+
17+
enum class event_mode_enum { none, low_power };
18+
19+
struct event_mode
20+
: detail::run_time_property_key<event_mode, detail::PropKind::EventMode> {
21+
event_mode(event_mode_enum mode) : value(mode) {}
22+
23+
event_mode_enum value;
24+
};
25+
26+
using event_mode_key = event_mode;
27+
28+
inline bool operator==(const event_mode &lhs, const event_mode &rhs) {
29+
return lhs.value == rhs.value;
30+
}
31+
inline bool operator!=(const event_mode &lhs, const event_mode &rhs) {
32+
return !(lhs == rhs);
33+
}
34+
35+
} // namespace ext::oneapi::experimental
36+
} // namespace _V1
37+
} // namespace sycl

sycl/include/sycl/ext/oneapi/properties/property.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ enum PropKind : uint32_t {
223223
InitializeToIdentity = 78,
224224
WorkGroupScratchSize = 79,
225225
Restrict = 80,
226+
EventMode = 81,
226227
// PropKindSize must always be the last value.
227-
PropKindSize = 81,
228+
PropKindSize = 82,
228229
};
229230

230231
template <typename PropertyT> struct PropertyToKind {

0 commit comments

Comments
 (0)