Skip to content

Commit 82afd3a

Browse files
committed
Merge branch 'sycl' into llvmspirv_pulldown
2 parents 109efd6 + b570493 commit 82afd3a

File tree

118 files changed

+272
-338
lines changed

Some content is hidden

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

118 files changed

+272
-338
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ buildbot/ @intel/dpcpp-devops-reviewers
103103
devops/ @intel/dpcpp-devops-reviewers
104104

105105
# Kernel fusion JIT compiler
106-
sycl-fusion/ @intel/dpcpp-kernel-fusion-reviewers
106+
sycl-jit/ @intel/dpcpp-kernel-fusion-reviewers
107107
sycl/doc/design/KernelFusionJIT.md @intel/dpcpp-kernel-fusion-reviewers
108108
sycl/doc/extensions/experimental/sycl_ext_codeplay_kernel_fusion.asciidoc @intel/dpcpp-kernel-fusion-reviewers
109109
sycl/include/sycl/ext/codeplay/experimental/fusion_properties.hpp @intel/dpcpp-kernel-fusion-reviewers

.github/workflows/sycl-aws.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,18 @@ on:
1414
# See devops/actions/aws-ec2/action.yml for more details.
1515
description: "JSON string with array of objects with aws-type, runs-on, aws-ami, aws-spot, aws-disk, aws-timebomb, one-job properties"
1616
type: string
17-
required: true
17+
default: '[{"runs-on":"aws_cuda-${{ github.run_id }}-${{ github.run_attempt }}","aws-ami":"ami-01cb0573cb039ab24","aws-type":["g5.2xlarge","g5.4xlarge"],"aws-disk":"/dev/sda1:64","aws-spot":"false"}]'
1818

1919
jobs:
2020
aws:
2121
runs-on: ubuntu-20.04
2222
environment: aws
2323
steps:
24-
- name: Setup script
25-
run: |
26-
mkdir -p ./aws-ec2
27-
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/action.yml -P ./aws-ec2
28-
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/aws-ec2.js -P ./aws-ec2
29-
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/package.json -P ./aws-ec2
30-
npm install ./aws-ec2
31-
- name: Start AWS EC2 runners
32-
uses: ./aws-ec2
24+
- uses: actions/checkout@v4
25+
with:
26+
sparse-checkout: devops/actions/aws-ec2
27+
- run: npm install ./devops/actions/aws-ec2
28+
- uses: ./devops/actions/aws-ec2
3329
with:
3430
mode: ${{ inputs.mode }}
3531
runs-on-list: ${{ inputs.runs-on-list }}

.github/workflows/sycl-detect-changes.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
clang: &clang
3131
- *llvm
3232
- 'clang/**'
33-
sycl_fusion: &sycl-fusion
33+
sycl_jit: &sycl-jit
3434
- *llvm
35-
- 'sycl-fusion/**'
35+
- 'sycl-jit/**'
3636
xptifw: &xptifw
3737
- 'xptifw/**'
3838
libclc: &libclc
@@ -41,7 +41,7 @@ jobs:
4141
- 'libclc/**'
4242
sycl: &sycl
4343
- *clang
44-
- *sycl-fusion
44+
- *sycl-jit
4545
- *llvm_spirv
4646
- *xptifw
4747
- *libclc
@@ -84,7 +84,7 @@ jobs:
8484
return '${{ steps.changes.outputs.changes }}';
8585
}
8686
// Treat everything as changed for huge PRs.
87-
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci", "esimd"];
87+
return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd"];
8888
8989
- run: echo '${{ steps.result.outputs.result }}'
9090

.github/workflows/sycl-linux-precommit-aws.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: E2E on AWS CUDA
22
run-name: E2E on AWS CUDA - ${{ github.event.workflow_run.display_title }}
3+
# Note: This workflow is currently disabled in the Github Actions UI because
4+
# we run CUDA testing on the self-hosted runners.
35
# We have to keep pre-commit AWS CUDA testing in a separate workflow because we
46
# need access to AWS secret and that isn't available on pull_request jobs for
57
# PRs from forks. And github's "require approval for all outside collaborators"

.github/workflows/sycl-linux-precommit.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ jobs:
8181
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
8282
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
8383
target_devices: ext_oneapi_cuda:gpu
84-
- name: AMD/HIP
85-
runner: '["Linux", "amdgpu"]'
86-
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
87-
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
88-
target_devices: ext_oneapi_hip:gpu
8984
- name: Intel
9085
runner: '["Linux", "gen12"]'
9186
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest

.github/workflows/sycl-nightly.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ jobs:
3737
target_devices: ext_oneapi_hip:gpu
3838
tests_selector: e2e
3939

40-
- name: NVIDIA/CUDA
41-
runner: '["Linux", "cuda"]'
42-
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
43-
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
44-
target_devices: ext_oneapi_cuda:gpu
45-
tests_selector: e2e
46-
4740
- name: Intel L0 GPU
4841
runner: '["Linux", "gen12"]'
4942
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
@@ -135,6 +128,39 @@ jobs:
135128
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
136129
extra_lit_opts: --param gpu-intel-gen12=True
137130

131+
cuda-aws-start:
132+
needs: [ubuntu2204_build]
133+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
134+
uses: ./.github/workflows/sycl-aws.yml
135+
secrets: inherit
136+
with:
137+
mode: start
138+
139+
cuda-run-tests:
140+
needs: [ubuntu2204_build, cuda-aws-start]
141+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
142+
uses: ./.github/workflows/sycl-linux-run-tests.yml
143+
with:
144+
name: CUDA E2E
145+
runner: '["aws_cuda-${{ github.run_id }}-${{ github.run_attempt }}"]'
146+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
147+
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
148+
target_devices: ext_oneapi_cuda:gpu
149+
ref: ${{ github.sha }}
150+
merge_ref: ''
151+
152+
sycl_toolchain_artifact: sycl_linux_default
153+
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
154+
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
155+
156+
cuda-aws-stop:
157+
needs: [cuda-aws-start, cuda-run-tests]
158+
if: always()
159+
uses: ./.github/workflows/sycl-aws.yml
160+
secrets: inherit
161+
with:
162+
mode: stop
163+
138164
nightly_build_upload:
139165
name: Nightly Build Upload
140166
if: ${{ github.ref_name == 'sycl' }}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ jobs:
5656
- name: Intel Arc A-Series Graphics with Level Zero
5757
runner: '["Linux", "arc"]'
5858
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
59+
- name: AMD/HIP
60+
runner: '["Linux", "amdgpu"]'
61+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
62+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
63+
target_devices: ext_oneapi_hip:gpu
5964
# Performance tests below. Specifics:
6065
# - only run performance tests (use LIT_FILTER env)
6166
# - ask llvm-lit to show all the output, even for PASS (-a)

buildbot/configure.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def do_configure(args):
3131
libclc_amd_target_names = ";amdgcn--amdhsa"
3232
libclc_nvidia_target_names = ";nvptx64--nvidiacl"
3333

34-
sycl_enable_fusion = "OFF"
35-
if not args.disable_fusion:
36-
llvm_external_projects += ";sycl-fusion"
37-
sycl_enable_fusion = "ON"
34+
sycl_enable_jit = "OFF"
35+
if not args.disable_jit:
36+
llvm_external_projects += ";sycl-jit"
37+
sycl_enable_jit = "ON"
3838

3939
if args.llvm_external_projects:
4040
llvm_external_projects += ";" + args.llvm_external_projects.replace(",", ";")
@@ -45,7 +45,7 @@ def do_configure(args):
4545
xpti_dir = os.path.join(abs_src_dir, "xpti")
4646
xptifw_dir = os.path.join(abs_src_dir, "xptifw")
4747
libdevice_dir = os.path.join(abs_src_dir, "libdevice")
48-
fusion_dir = os.path.join(abs_src_dir, "sycl-fusion")
48+
jit_dir = os.path.join(abs_src_dir, "sycl-jit")
4949
llvm_targets_to_build = args.host_target
5050
llvm_enable_projects = "clang;" + llvm_external_projects
5151
libclc_build_native = "OFF"
@@ -174,7 +174,7 @@ def do_configure(args):
174174
"-DXPTI_SOURCE_DIR={}".format(xpti_dir),
175175
"-DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR={}".format(xptifw_dir),
176176
"-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR={}".format(libdevice_dir),
177-
"-DLLVM_EXTERNAL_SYCL_FUSION_SOURCE_DIR={}".format(fusion_dir),
177+
"-DLLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR={}".format(jit_dir),
178178
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
179179
"-DSYCL_BUILD_PI_HIP_PLATFORM={}".format(sycl_build_pi_hip_platform),
180180
"-DLLVM_BUILD_TOOLS=ON",
@@ -189,7 +189,7 @@ def do_configure(args):
189189
"-DXPTI_ENABLE_WERROR={}".format(xpti_enable_werror),
190190
"-DSYCL_CLANG_EXTRA_FLAGS={}".format(sycl_clang_extra_flags),
191191
"-DSYCL_ENABLE_PLUGINS={}".format(";".join(set(sycl_enabled_plugins))),
192-
"-DSYCL_ENABLE_KERNEL_FUSION={}".format(sycl_enable_fusion),
192+
"-DSYCL_ENABLE_EXTENSION_JIT={}".format(sycl_enable_jit),
193193
"-DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB={}".format(sycl_preview_lib),
194194
"-DBUG_REPORT_URL=https://github.com/intel/llvm/issues",
195195
]
@@ -379,9 +379,9 @@ def main():
379379
help="Disable building of the SYCL runtime major release preview library",
380380
)
381381
parser.add_argument(
382-
"--disable-fusion",
382+
"--disable-jit",
383383
action="store_true",
384-
help="Disable the kernel fusion JIT compiler",
384+
help="Disable the kernel JIT compiler for AMD and Nvidia",
385385
)
386386
parser.add_argument(
387387
"--add_security_flags",

llvm/lib/SYCLLowerIR/SYCLCreateNVVMAnnotations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ decomposeWGMetadata(const MDNode &Node, const Function &F) {
5555
NDim = getSingleIntMetadata(*NDimMD).value_or(3);
5656
assert(NDim >= 1 && NDim <= 3 && "Invalid work-group dimensionality");
5757

58-
std::array<std::optional<size_t>, 3> Ops;
58+
std::array<std::optional<uint64_t>, 3> Ops;
5959
for (unsigned I = 0, E = std::min(Node.getNumOperands(), NDim); I != E; I++) {
6060
if (auto *C = mdconst::dyn_extract<ConstantInt>(Node.getOperand(I)))
6161
Ops[I] = C->getZExtValue();

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3731,8 +3731,12 @@ void FunctionStackPoisoner::copyArgsPassedByValToAllocas() {
37313731
const Align Alignment =
37323732
DL.getValueOrABITypeAlignment(Arg.getParamAlign(), Ty);
37333733

3734+
unsigned int AS = Triple(F.getParent()->getTargetTriple()).isSPIROrSPIRV()
3735+
? Arg.getType()->getPointerAddressSpace()
3736+
: DL.getAllocaAddrSpace();
3737+
37343738
AllocaInst *AI = IRB.CreateAlloca(
3735-
Ty, nullptr,
3739+
Ty, AS, nullptr,
37363740
(Arg.hasName() ? Arg.getName() : "Arg" + Twine(Arg.getArgNo())) +
37373741
".byval");
37383742
AI->setAlignment(Alignment);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; RUN: opt < %s -passes=asan -asan-instrumentation-with-call-threshold=0 -asan-stack=0 -asan-globals=0 -asan-use-after-return=never -asan-stack-dynamic-alloca=0 -asan-mapping-scale=4 -S | FileCheck %s
2+
3+
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
4+
target triple = "spir64-unknown-unknown"
5+
6+
%struct.Input = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
7+
8+
; Function Attrs: sanitize_address
9+
define spir_func void @test(ptr addrspace(4) byval(%struct.Input) %input) #0 {
10+
entry:
11+
; CHECK: inttoptr i64 %1 to ptr addrspace(4)
12+
ret void
13+
}
14+
15+
attributes #0 = { sanitize_address }

sycl-fusion/CMakeLists.txt renamed to sycl-jit/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ set(SYCL_JIT_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
1010
set(LLVM_SPIRV_INCLUDE_DIRS "${LLVM_MAIN_SRC_DIR}/../llvm-spirv/include")
1111

1212
# Set library-wide warning options.
13-
set(SYCL_FUSION_WARNING_FLAGS -Wall -Wextra)
13+
set(SYCL_JIT_WARNING_FLAGS -Wall -Wextra)
1414

15-
option(SYCL_FUSION_ENABLE_WERROR "Treat all warnings as errors in SYCL kernel fusion library" ON)
16-
if(SYCL_FUSION_ENABLE_WERROR)
17-
list(APPEND SYCL_FUSION_WARNING_FLAGS -Werror)
18-
endif(SYCL_FUSION_ENABLE_WERROR)
15+
option(SYCL_JIT_ENABLE_WERROR "Treat all warnings as errors in SYCL kernel JIT library" ON)
16+
if(SYCL_JIT_ENABLE_WERROR)
17+
list(APPEND SYCL_JIT_WARNING_FLAGS -Werror)
18+
endif(SYCL_JIT_ENABLE_WERROR)
1919

2020
if(WIN32)
21-
message(WARNING "Kernel fusion not yet supported on Windows")
21+
message(WARNING "Kernel JIT not yet supported on Windows")
2222
else(WIN32)
2323
add_subdirectory(common)
2424
add_subdirectory(jit-compiler)
File renamed without changes.

sycl-fusion/common/CMakeLists.txt renamed to sycl-jit/common/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
add_llvm_library(sycl-fusion-common
1+
add_llvm_library(sycl-jit-common
22
lib/NDRangesHelper.cpp
33

44
LINK_COMPONENTS
55
Support
66
)
77

8-
target_compile_options(sycl-fusion-common PRIVATE ${SYCL_FUSION_WARNING_FLAGS})
8+
target_compile_options(sycl-jit-common PRIVATE ${SYCL_JIT_WARNING_FLAGS})
99

1010
# Mark LLVM headers as system headers to ignore warnigns in them. This
1111
# classification remains intact even if the same path is added as a normal
1212
# include path in GCC and Clang.
13-
target_include_directories(sycl-fusion-common
13+
target_include_directories(sycl-jit-common
1414
SYSTEM PRIVATE
1515
${LLVM_MAIN_INCLUDE_DIR}
1616
)
17-
target_include_directories(sycl-fusion-common
17+
target_include_directories(sycl-jit-common
1818
PUBLIC
1919
${CMAKE_CURRENT_SOURCE_DIR}/include
2020
${CMAKE_CURRENT_SOURCE_DIR}/lib
2121
)
2222

23-
add_dependencies(sycl-fusion-common sycl-headers)
23+
add_dependencies(sycl-jit-common sycl-headers)
2424

2525
if (BUILD_SHARED_LIBS)
2626
if(NOT MSVC AND NOT APPLE)
2727
# Manage symbol visibility through the linker to make sure no LLVM symbols
2828
# are exported and confuse the drivers.
2929
set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/ld-version-script.txt")
3030
target_link_libraries(
31-
sycl-fusion-common PRIVATE "-Wl,--version-script=${linker_script}")
32-
set_target_properties(sycl-fusion-common
31+
sycl-jit-common PRIVATE "-Wl,--version-script=${linker_script}")
32+
set_target_properties(sycl-jit-common
3333
PROPERTIES
3434
LINK_DEPENDS
3535
${linker_script})
File renamed without changes.

sycl-fusion/jit-compiler/CMakeLists.txt renamed to sycl-jit/jit-compiler/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
add_llvm_library(sycl-fusion
2+
add_llvm_library(sycl-jit
33
lib/KernelFusion.cpp
44
lib/translation/KernelTranslation.cpp
55
lib/translation/SPIRVLLVMTranslation.cpp
@@ -31,17 +31,17 @@ add_llvm_library(sycl-fusion
3131
${LLVM_TARGETS_TO_BUILD}
3232
)
3333

34-
target_compile_options(sycl-fusion PRIVATE ${SYCL_FUSION_WARNING_FLAGS})
34+
target_compile_options(sycl-jit PRIVATE ${SYCL_JIT_WARNING_FLAGS})
3535

3636
# Mark LLVM and SPIR-V headers as system headers to ignore warnigns in them.
3737
# This classification remains intact even if the same paths are added as normal
3838
# include paths in GCC and Clang.
39-
target_include_directories(sycl-fusion
39+
target_include_directories(sycl-jit
4040
SYSTEM PRIVATE
4141
${LLVM_MAIN_INCLUDE_DIR}
4242
${LLVM_SPIRV_INCLUDE_DIRS}
4343
)
44-
target_include_directories(sycl-fusion
44+
target_include_directories(sycl-jit
4545
PUBLIC
4646
$<INSTALL_INTERFACE:include>
4747
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -52,29 +52,29 @@ target_include_directories(sycl-fusion
5252

5353
find_package(Threads REQUIRED)
5454

55-
target_link_libraries(sycl-fusion
55+
target_link_libraries(sycl-jit
5656
PRIVATE
57-
sycl-fusion-common
57+
sycl-jit-common
5858
LLVMSPIRVLib
59-
SYCLKernelFusionPasses
59+
SYCLKernelJITPasses
6060
${CMAKE_THREAD_LIBS_INIT}
6161
)
6262

63-
add_dependencies(sycl-fusion sycl-headers)
63+
add_dependencies(sycl-jit sycl-headers)
6464

6565
if("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
66-
target_compile_definitions(sycl-fusion PRIVATE FUSION_JIT_SUPPORT_PTX)
66+
target_compile_definitions(sycl-jit PRIVATE JIT_SUPPORT_PTX)
6767
endif()
6868

6969
if("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)
70-
target_compile_definitions(sycl-fusion PRIVATE FUSION_JIT_SUPPORT_AMDGCN)
70+
target_compile_definitions(sycl-jit PRIVATE JIT_SUPPORT_AMDGCN)
7171
endif()
7272

7373
if(NOT MSVC AND NOT APPLE)
7474
# Manage symbol visibility through the linker to make sure no LLVM symbols
7575
# are exported and confuse the drivers.
7676
set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/ld-version-script.txt")
7777
target_link_libraries(
78-
sycl-fusion PRIVATE "-Wl,--version-script=${linker_script}")
79-
set_target_properties(sycl-fusion PROPERTIES LINK_DEPENDS ${linker_script})
78+
sycl-jit PRIVATE "-Wl,--version-script=${linker_script}")
79+
set_target_properties(sycl-jit PROPERTIES LINK_DEPENDS ${linker_script})
8080
endif()

0 commit comments

Comments
 (0)