Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/sycl' into rtc-devglobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jopperm committed Jan 16, 2025
2 parents e96e7e0 + a3c95ff commit 5c529aa
Show file tree
Hide file tree
Showing 222 changed files with 3,352 additions and 2,024 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
with:
name: Build e2e tests
runner: '["Linux", "build"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps
image_options: -u 1001
ref: ${{ github.sha }}
merge_ref: ''
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/sycl-rel-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
build_cache_root: "/__w/"
build_artifact_suffix: default
build_configure_extra_args: '--hip --cuda'
build_image: ghcr.io/intel/llvm/ubuntu2204_build:latest
merge_ref: ''
build_ref: sycl-rel-6_0_0

Expand Down Expand Up @@ -118,8 +119,8 @@ jobs:
if: ${{ github.repository == 'intel/llvm' && needs.check_for_new_commits.outputs.is_new_commit != 'false' }}
uses: ./.github/workflows/sycl-windows-build.yml
with:
ref: sycl-rel-6_0_0
merge_ref: ''
build_ref: sycl-rel-6_0_0

# We upload both Linux/Windows build via Github's "Releases"
# functionality, make sure Linux/Windows names follow the same pattern.
Expand All @@ -139,6 +140,7 @@ jobs:
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
extra_lit_opts: --param gpu-intel-gen12=True
ref: sycl-rel-6_0_0
merge_ref: ''

cuda-aws-start:
needs: [ubuntu2204_build]
Expand All @@ -156,7 +158,7 @@ jobs:
with:
name: CUDA E2E
runner: '["aws_cuda-${{ github.run_id }}-${{ github.run_attempt }}"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
target_devices: cuda:gpu
ref: sycl-rel-6_0_0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sycl-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
type: string
required: false
default: "default"
build_ref:
type: string
required: false
build_configure_extra_args:
type: string
required: false
Expand All @@ -18,6 +15,9 @@ on:
description: 'Filter matches for the changed files in the PR'
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
required: false
ref:
type: string
required: False
merge_ref:
description: |
Commit-ish to merge post-checkout if non-empty. Must be reachable from
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- uses: ./devops/actions/cached_checkout
with:
path: src
ref: ${{ inputs.build_ref || github.sha }}
ref: ${{ inputs.ref || github.sha }}
merge_ref: ${{ inputs.merge_ref }}
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
- name: Configure
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/sycl-windows-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ on:
ref:
type: string
required: False
merge_ref:
description: |
Commit-ish to merge post-checkout if non-empty. Must be reachable from
the default_branch input paramter.
type: string
default: 'FETCH_HEAD'
required: False

sycl_toolchain_artifact:
type: string
Expand Down Expand Up @@ -68,7 +75,8 @@ jobs:
- uses: ./devops/actions/cached_checkout
with:
path: llvm
ref: ${{ inputs.build_ref || github.sha }}
ref: ${{ inputs.ref || github.sha }}
merge_ref: ${{ inputs.merge_ref }}
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
- name: Download compiler toolchain
uses: actions/download-artifact@v4
Expand Down
39 changes: 11 additions & 28 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10706,38 +10706,21 @@ static void getSPIRVBackendOpts(const llvm::opt::ArgList &TCArgs,
ArgStringList &BackendArgs) {
BackendArgs.push_back(TCArgs.MakeArgString("-filetype=obj"));
BackendArgs.push_back(
TCArgs.MakeArgString("-mtriple=spirv64-unknown-unknown"));
// TODO: Optimization level is currently forced to -O0 due to some testing
// issues. Update optimization level after testing issues are resolved.
BackendArgs.push_back(TCArgs.MakeArgString("-O0"));
TCArgs.MakeArgString("-mtriple=spirv64v1.6-unknown-unknown"));
BackendArgs.push_back(
TCArgs.MakeArgString("--avoid-spirv-capabilities=Shader"));
BackendArgs.push_back(
TCArgs.MakeArgString("--translator-compatibility-mode"));

// TODO: There is some overlap between the lists of extensions in SPIR-V
// backend and SPIR-V Trnaslator). We will try to combine them when SPIR-V
// backdn is ready.
std::string ExtArg("--spirv-ext=");
std::string DefaultExtArg =
"+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max"
",+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls"
",+SPV_KHR_expect_assume,+SPV_KHR_linkonce_odr";
std::string INTELExtArg = ",+SPV_INTEL_subgroups,+SPV_INTEL_function_pointers"
",+SPV_INTEL_arbitrary_precision_integers"
",+SPV_INTEL_variable_length_array";
ExtArg = ExtArg + DefaultExtArg + INTELExtArg;

// Other args
ExtArg += ",+SPV_INTEL_bfloat16_conversion"
",+SPV_KHR_uniform_group_instructions"
",+SPV_INTEL_optnone"
",+SPV_KHR_subgroup_rotate"
",+SPV_INTEL_usm_storage_classes"
",+SPV_EXT_shader_atomic_float16_add"
",+SPV_KHR_bit_instructions";

BackendArgs.push_back(TCArgs.MakeArgString(ExtArg));
// TODO: A list of SPIR-V extensions that are supported by the SPIR-V backend
// is growing. Let's postpone the decision on which extensions to enable until
// - the list is stable, and
// - we decide on a mapping of user requested extensions into backend's ones.
// Meanwhile we enable all the SPIR-V backend extensions.
BackendArgs.push_back(TCArgs.MakeArgString("--spirv-ext=all"));
// TODO:
// - handle -Xspirv-translator option to avoid "argument unused during
// compilation" error
// - handle --spirv-ext=+<extension> and --spirv-ext=-<extension> options
}

// Utility function to gather all llvm-spirv options.
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/sycl-linker-wrapper-image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ int main() {
// CHECK-DAG: @SYCL_PropSetName.3 = internal unnamed_addr constant [25 x i8] c"SYCL/device requirements\00"
// CHECK-DAG: @SYCL_PropSetName.4 = internal unnamed_addr constant [22 x i8] c"SYCL/kernel param opt\00"
// CHECK-DAG: @__sycl_offload_prop_sets_arr.5 = internal constant [3 x %_pi_device_binary_property_set_struct] [%_pi_device_binary_property_set_struct { ptr @SYCL_PropSetName, ptr @__sycl_offload_prop_sets_arr, ptr getelementptr ([1 x %_pi_device_binary_property_struct], ptr @__sycl_offload_prop_sets_arr, i64 0, i64 1) }, %_pi_device_binary_property_set_struct { ptr @SYCL_PropSetName.3, ptr @__sycl_offload_prop_sets_arr.2, ptr getelementptr ([1 x %_pi_device_binary_property_struct], ptr @__sycl_offload_prop_sets_arr.2, i64 0, i64 1) }, %_pi_device_binary_property_set_struct { ptr @SYCL_PropSetName.4, ptr null, ptr null }]
// CHECK-DAG: @.sycl_offloading.0.data = internal unnamed_addr constant [772 x i8]
// CHECK-DAG: @.sycl_offloading.0.data = internal unnamed_addr constant [912 x i8]
// CHECK-DAG: @__sycl_offload_entry_name = internal unnamed_addr constant [25 x i8] c"_ZTSZ4mainE11fake_kernel\00"
// CHECK-DAG: @__sycl_offload_entries_arr = internal constant [1 x %struct.__tgt_offload_entry] [%struct.__tgt_offload_entry { ptr null, ptr @__sycl_offload_entry_name, i64 0, i32 0, i32 0 }]
// CHECK-DAG: @.sycl_offloading.0.info = internal local_unnamed_addr constant [2 x i64] [i64 ptrtoint (ptr @.sycl_offloading.0.data to i64), i64 772], section ".tgtimg", align 16
// CHECK-DAG: @.sycl_offloading.0.info = internal local_unnamed_addr constant [2 x i64] [i64 ptrtoint (ptr @.sycl_offloading.0.data to i64), i64 912], section ".tgtimg", align 16
// CHECK-DAG: @llvm.used = appending global [1 x ptr] [ptr @.sycl_offloading.0.info], section "llvm.metadata"
// CHECK-DAG: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__sycl.tgt_device_image] [%__sycl.tgt_device_image { i16 2, i8 4, i8 0, ptr @.sycl_offloading.target.0, ptr @.sycl_offloading.opts.compile.0, ptr @.sycl_offloading.opts.link.0, ptr null, ptr null, ptr @.sycl_offloading.0.data, ptr getelementptr ([772 x i8], ptr @.sycl_offloading.0.data, i64 0, i64 772), ptr @__sycl_offload_entries_arr, ptr getelementptr ([1 x %struct.__tgt_offload_entry], ptr @__sycl_offload_entries_arr, i64 0, i64 1), ptr @__sycl_offload_prop_sets_arr.5, ptr getelementptr ([3 x %_pi_device_binary_property_set_struct], ptr @__sycl_offload_prop_sets_arr.5, i64 0, i64 3) }]
// CHECK-DAG: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__sycl.tgt_device_image] [%__sycl.tgt_device_image { i16 2, i8 4, i8 0, ptr @.sycl_offloading.target.0, ptr @.sycl_offloading.opts.compile.0, ptr @.sycl_offloading.opts.link.0, ptr null, ptr null, ptr @.sycl_offloading.0.data, ptr getelementptr ([912 x i8], ptr @.sycl_offloading.0.data, i64 0, i64 912), ptr @__sycl_offload_entries_arr, ptr getelementptr ([1 x %struct.__tgt_offload_entry], ptr @__sycl_offload_entries_arr, i64 0, i64 1), ptr @__sycl_offload_prop_sets_arr.5, ptr getelementptr ([3 x %_pi_device_binary_property_set_struct], ptr @__sycl_offload_prop_sets_arr.5, i64 0, i64 3) }]
// CHECK-DAG: @.sycl_offloading.descriptor = internal constant %__sycl.tgt_bin_desc { i16 1, i16 1, ptr @.sycl_offloading.device_images, ptr null, ptr null }
// CHECK-DAG: @llvm.global_ctors = {{.*}} { i32 1, ptr @sycl.descriptor_reg, ptr null }]
// CHECK-DAG: @llvm.global_dtors = {{.*}} { i32 1, ptr @sycl.descriptor_unreg, ptr null }]
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/sycl-spirv-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
///
// RUN: %clangxx -fsycl -fsycl-use-spirv-backend-for-spirv-gen -### %s 2>&1 | FileCheck %s

// CHECK: llc{{.*}} "-filetype=obj" "-mtriple=spirv64-unknown-unknown" "-O0" "--avoid-spirv-capabilities=Shader" "--translator-compatibility-mode" "--spirv-ext=
// CHECK: llc{{.*}} "-filetype=obj" "-mtriple=spirv64{{[^-]*}}-unknown-unknown" "--avoid-spirv-capabilities=Shader" "--translator-compatibility-mode" "--spirv-ext=
4 changes: 1 addition & 3 deletions devops/bandit.config
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
# B317 : xml_bad_sax
# B318 : xml_bad_minidom
# B319 : xml_bad_pulldom
# B320 : xml_bad_etree
# B321 : ftplib
# B323 : unverified_context
# B324 : hashlib_new_insecure_functions
Expand All @@ -53,7 +52,6 @@
# B407 : import_xml_expat
# B408 : import_xml_minidom
# B409 : import_xml_pulldom
# B410 : import_lxml
# B411 : import_xmlrpclib
# B412 : import_httpoxy
# B413 : import_pycrypto
Expand Down Expand Up @@ -83,7 +81,7 @@
# IPAS Required Checkers. Do not disable these
# Additional checkers may be added if desired
tests:
[ 'B301', 'B302', 'B303', 'B304', 'B305', 'B306', 'B308', 'B310', 'B311', 'B312', 'B313', 'B314', 'B315', 'B316', 'B317', 'B318', 'B319', 'B320', 'B321', 'B323', 'B324', 'B401', 'B402', 'B403', 'B404', 'B405', 'B406', 'B407', 'B408', 'B409', 'B410', 'B411', 'B412', 'B413']
[ 'B301', 'B302', 'B303', 'B304', 'B305', 'B306', 'B308', 'B310', 'B311', 'B312', 'B313', 'B314', 'B315', 'B316', 'B317', 'B318', 'B319', 'B321', 'B323', 'B324', 'B401', 'B402', 'B403', 'B404', 'B405', 'B406', 'B407', 'B408', 'B409', 'B411', 'B412', 'B413']

# (optional) list skipped test IDs here, eg '[B101, B406]':
# The following checkers are not required but be added to tests list if desired
Expand Down
7 changes: 7 additions & 0 deletions devops/containers/ubuntu2404_base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ USER root
COPY scripts/install_build_tools.sh /install.sh
RUN /install.sh

# libzstd-dev installed by default on Ubuntu 24.04 is not compiled with -fPIC flag.
# This causes linking errors when building SYCL runtime.
# Bug: https://github.com/intel/llvm/issues/15935
# Workaround: build zstd from sources with -fPIC flag.
COPY scripts/build_zstd_1_5_6_ub24.sh /build_zstd_1_5_6_ub24.sh
RUN /build_zstd_1_5_6_ub24.sh

COPY scripts/create-sycl-user.sh /user-setup.sh
RUN /user-setup.sh

Expand Down
7 changes: 7 additions & 0 deletions devops/containers/ubuntu2404_build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ USER root
COPY scripts/install_build_tools.sh /install.sh
RUN /install.sh

# libzstd-dev installed by default on Ubuntu 24.04 is not compiled with -fPIC flag.
# This causes linking errors when building SYCL runtime.
# Bug: https://github.com/intel/llvm/issues/15935
# Workaround: build zstd from sources with -fPIC flag.
COPY scripts/build_zstd_1_5_6_ub24.sh /build_zstd_1_5_6_ub24.sh
RUN /build_zstd_1_5_6_ub24.sh

SHELL ["/bin/bash", "-ec"]

# Make the directory if it doesn't exist yet.
Expand Down
8 changes: 4 additions & 4 deletions devops/dependencies-igc-dev.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"linux": {
"igc_dev": {
"github_tag": "igc-dev-e0d826a",
"version": "e0d826a",
"updated_at": "2024-12-17T21:18:30Z",
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/2327583926/zip",
"github_tag": "igc-dev-97b3d8f",
"version": "97b3d8f",
"updated_at": "2025-01-08T17:43:30Z",
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/2403247641/zip",
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
}
}
Expand Down
12 changes: 6 additions & 6 deletions devops/dependencies.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"linux": {
"compute_runtime": {
"github_tag": "24.48.31907.7",
"version": "24.48.31907.7",
"url": "https://github.com/intel/compute-runtime/releases/tag/24.48.31907.7",
"github_tag": "24.52.32224.5",
"version": "24.52.32224.5",
"url": "https://github.com/intel/compute-runtime/releases/tag/24.52.32224.5",
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
},
"igc": {
"github_tag": "v2.2.3",
"version": "2.2.3",
"url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.2.3",
"github_tag": "v2.5.6",
"version": "2.5.6",
"url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.5.6",
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
},
"cm": {
Expand Down
108 changes: 108 additions & 0 deletions devops/scripts/build_zstd_1_5_6_ub24.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

# Script to build and install zstd 1.5.6 on Ubuntu 24, with -fPIC flag.
# The default installation of zstd on Ubuntu 24 does not have -fPIC flag
# enabled, which is required for building DPC++ in shared libraries mode.

# Function to check if the OS is Ubuntu 24
check_os() {
. /etc/os-release
if [[ "$NAME" != "Ubuntu" || "$VERSION_ID" != "24.04" ]]; then
echo "Warning: This script has only been tested with Ubuntu 24."
fi
}

# Function to install packages with or without sudo
install_packages() {
if [ "$USE_SUDO" = true ]; then
sudo apt-get update
sudo apt-get install -y build-essential wget
else
apt-get update
apt-get install -y build-essential wget
fi
}

# Function to uninstall libzstd-dev if installed
uninstall_libzstd_dev() {
if dpkg -l | grep -q libzstd-dev; then
if [ "$USE_SUDO" = true ]; then
sudo apt-get remove -y libzstd-dev
else
apt-get remove -y libzstd-dev
fi
fi
}

# Function to build a shared library by linking zstd static lib.
# This is used to verify that zstd is built correctly, with -fPIC flag.
build_test_program() {
cat <<EOF > test_zstd.c
#include <zstd.h>
int main() {
ZSTD_CCtx* cctx = ZSTD_createCCtx();
ZSTD_freeCCtx(cctx);
return 0;
}
EOF

# Try to use zstd's static library with -fPIC
gcc test_zstd.c -lzstd -fPIC -shared
if [ $? -ne 0 ]; then
echo "zstd installation verification failed."
else
echo "zstd installation verification passed."
fi

# There won't be a.out file if verification failed.
rm test_zstd.c a.out || true
}

# Check the OS
check_os

# Set USE_SUDO to true or false based on your preference
USE_SUDO=true

# Install necessary build tools
install_packages

# Uninstall libzstd-dev package if installed
uninstall_libzstd_dev

# Define the version and URL for zstd
ZSTD_VERSION="1.5.6"
ZSTD_URL="https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz"

# Create a directory for the source code
mkdir -p zstd_build
cd zstd_build

# Download and extract zstd source code
wget $ZSTD_URL
tar -xzf zstd-$ZSTD_VERSION.tar.gz
cd zstd-$ZSTD_VERSION

# Build zstd with -fPIC flag.
CFLAGS="-fPIC" CXXFLAGS="-fPIC" make
if [ $? -ne 0 ]; then
echo "Error: make failed."
exit 1
fi

# Install zstd.
if [ "$USE_SUDO" = true ]; then
sudo make install
else
make install
fi
if [ $? -ne 0 ]; then
echo "Error: make install failed."
exit 1
fi

# Verify zstd installation.
build_test_program

# Clean up
rm -rf zstd_build
4 changes: 2 additions & 2 deletions devops/scripts/install_build_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ apt update && apt install -yqq \
jq \
curl \
libhwloc-dev \
libzstd-dev

libzstd-dev \
time
Loading

0 comments on commit 5c529aa

Please sign in to comment.