Skip to content

Commit

Permalink
Merge branch 'sycl' into sycl-graph-bugfix-1
Browse files Browse the repository at this point in the history
  • Loading branch information
EwanC committed Aug 25, 2023
2 parents e591849 + 92ddf8d commit cb49b0b
Show file tree
Hide file tree
Showing 92 changed files with 918 additions and 863 deletions.
1 change: 1 addition & 0 deletions .github/workflows/sycl_detect_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- devops/*/**
drivers:
- devops/dependencies.json
- devops/scripts/install_drivers.sh
- name: Set output
id: result
Expand Down
79 changes: 0 additions & 79 deletions .github/workflows/sycl_gen_test_matrix.yml

This file was deleted.

12 changes: 2 additions & 10 deletions .github/workflows/sycl_linux_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,8 @@ jobs:
- name: Install drivers
if: inputs.install_drivers == 'true'
run: |
sudo cp devops/scripts/get_release.py /opt/
sudo -E devops/scripts/install_drivers.sh llvm/devops/dependencies.json --all
- name: Install drivers (deprecated CI interface)
if: env.compute_runtime_tag != '' && inputs.install_drivers != 'true'
run: |
if [ -e /opt/install_drivers.sh ]; then
# TODO pack this script into container
sudo cp devops/scripts/get_release.py /opt/
sudo -E /opt/install_drivers.sh --all
fi
sudo apt install curl
echo "$GITHUB_TOKEN" | sudo -E devops/scripts/install_drivers.sh llvm/devops/dependencies.json --all
- name: Source OneAPI TBB vars.sh
shell: bash
run: |
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/sycl_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,12 @@ jobs:
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}


test_matrix:
if: github.repository == 'intel/llvm'
name: Generate Test Matrix
uses: ./.github/workflows/sycl_gen_test_matrix.yml
with:
lts_config: "win_l0_gen12"

windows_default:
name: Windows
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_windows_build_and_test.yml
needs: test_matrix
with:
retention-days: 90
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }}

# We upload both Linux/Windows build via Github's "Releases"
# functionality, make sure Linux/Windows names follow the same pattern.
artifact_archive_name: sycl_windows.tar.gz
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/sycl_post_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,10 @@ jobs:
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}

# This job generates matrix of tests for SYCL End-to-End tests on Windows
test_matrix:
name: Generate Test Matrix
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_gen_test_matrix.yml
with:
lts_config: "win_l0_gen12"

windows_default:
name: Windows
needs: test_matrix
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_windows_build_and_test.yml
with:
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }}

macos_default:
name: macOS
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/sycl_precommit_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,14 @@ jobs:
with:
path: src

# This job generates matrix of tests for SYCL End-to-End tests
test_matrix:
name: Generate Test Matrix
uses: ./.github/workflows/sycl_gen_test_matrix.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
lts_config: "win_l0_gen12"

windows_default:
name: Windows
needs: [lint, test_matrix, detect_changes]
needs: [lint, detect_changes]
if: |
always()
&& (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
&& github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_windows_build_and_test.yml
with:
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }}
build_ref: ${{ github.sha }}
changes: ${{ needs.detect_changes.outputs.filters }}
54 changes: 36 additions & 18 deletions .github/workflows/sycl_windows_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
build_ref:
type: string
required: false
lts_matrix:
type: string
required: false
default: "[]"
changes:
type: string
description: 'Filter matches for the changed files in the PR'
Expand Down Expand Up @@ -127,14 +123,9 @@ jobs:
e2e-tests:
needs: build
# Continue if build was successful.
if: ${{ always() && needs.build.outputs.build_conclusion == 'success' && inputs.lts_matrix != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.lts_matrix) }}
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
env: ${{ matrix.env }}
if: ${{ always() && needs.build.outputs.build_conclusion == 'success' }}
name: SYCL E2E on Windows
runs-on: [Windows, gen12]
steps:
- uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
with:
Expand All @@ -152,10 +143,37 @@ jobs:
path: llvm
- name: Register cleanup after job is finished
uses: ./llvm/devops/actions/cleanup
- uses: ./llvm/devops/actions/e2e-tests-win
name: Run SYCL End-to-End tests
- name: Download compiler toolchain
uses: actions/download-artifact@v3
with:
sycl_artifact: sycl_windows_default
sycl_archive: ${{ inputs.artifact_archive_name }}
targets: ${{ matrix.targets }}
cmake_args: '${{ matrix.cmake_args }}'
name: sycl_windows_default
- name: Extract SYCL toolchain
shell: bash
run: |
mkdir install
tar -xf ${{ inputs.artifact_archive_name }} -C install
rm ${{ inputs.artifact_archive_name }}
- name: Setup SYCL toolchain
run: |
echo "PATH=$env:GITHUB_WORKSPACE\\install\\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- run: |
sycl-ls
- run: |
sycl-ls --verbose
- name: Configure E2E with Level Zero target
shell: cmd
run: |
mkdir build-e2e
cmake -GNinja -B build-e2e -S.\llvm\sycl\test-e2e -DSYCL_TEST_E2E_TARGETS="ext_oneapi_level_zero:gpu" -DCMAKE_CXX_COMPILER="clang++" -DLEVEL_ZERO_LIBS_DIR="D:\github\level-zero_win-sdk\lib" -DLLVM_LIT="..\llvm\llvm\utils\lit\lit.py"
- name: Run End-to-End tests
shell: bash
run: |
# Run E2E tests.
export LIT_OPTS="-v --no-progress-bar --show-unsupported --max-time 3600 --time-tests"
cmake --build build-e2e --target check-sycl-e2e
- name: Cleanup
shell: cmd
if: always()
run: |
rmdir /q /s install
rmdir /q /s build-e2e
15 changes: 1 addition & 14 deletions clang/docs/ClangOffloadBundler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,7 @@ Where:
============= ==============================================================

**target-triple**
The target triple of the code object. See `Target Triple
<https://clang.llvm.org/docs/CrossCompilation.html#target-triple>`.

The bundler accepts target triples with or without the optional environment
field:

``<arch><sub>-<vendor>-<sys>``, or
``<arch><sub>-<vendor>-<sys>-<env>``

However, in order to standardize outputs for tools that consume bitcode
bundles, bundles written by the bundler internally use only the 4-field
target triple:

``<arch><sub>-<vendor>-<sys>-<env>``
The target triple of the code object.

**target-id**
The canonical target ID of the code object. Present only if the target
Expand Down
28 changes: 2 additions & 26 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,6 @@ using namespace clang::driver;
using namespace clang;
using namespace llvm::opt;

// clang-offload-bundler is currently generating a 'standardized' target triple.
// Triple's format - Architecture-Vendor-OS-Environment.
// Bundle sections created by clang-offload-bundler contain the 'standardized'
// triple. This routine transforms the triple specified by user as input to this
// 'standardized' format to facilitate checks.
static std::string standardizedTriple(std::string OrigTriple) {
llvm::Triple t = llvm::Triple(OrigTriple);
return llvm::Triple(t.getArchName(), t.getVendorName(), t.getOSName(),
t.getEnvironmentName())
.str() +
"-";
}

static std::optional<llvm::Triple> getOffloadTargetTriple(const Driver &D,
const ArgList &Args) {
auto OffloadTargets = Args.getAllArgValues(options::OPT_offload_EQ);
Expand Down Expand Up @@ -6101,20 +6088,9 @@ class OffloadingActionBuilder final {
if (Arch.compare(0, 4, "fpga") == 0)
Arch = C.getDriver().MakeSYCLDeviceTriple("spir64_fpga").str();

// The last component for the triple may be a GPU arch
auto TripleOrGPU = StringRef(Arch).rsplit('-');
if (clang::StringToCudaArch(TripleOrGPU.second.str()) !=
clang::CudaArch::UNKNOWN) {
Arch = standardizedTriple(TripleOrGPU.first.str());
Arch += TripleOrGPU.second.str();
} else {
Arch = standardizedTriple(Arch);
}

if (std::find(UniqueSections.begin(), UniqueSections.end(), Arch) ==
UniqueSections.end()) {
UniqueSections.end())
UniqueSections.push_back(Arch);
}
}
}

Expand All @@ -6123,8 +6099,8 @@ class OffloadingActionBuilder final {

for (auto &SyclTarget : Targets) {
std::string SectionTriple = SyclTarget.TC->getTriple().str();
SectionTriple = standardizedTriple(SectionTriple);
if (SyclTarget.BoundArch) {
SectionTriple += "-";
SectionTriple += SyclTarget.BoundArch;
}
// If any matching section is found, we are good.
Expand Down
Loading

0 comments on commit cb49b0b

Please sign in to comment.