-
Notifications
You must be signed in to change notification settings - Fork 11
71 lines (60 loc) · 1.9 KB
/
buildAndTest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# (c) Copyright 2021 Xilinx, Inc. All Rights reserved.
# (c) Copyright 2022 - 2024 Advanced Micro Devices, Inc. All Rights reserved.
name: Build & Test
on:
pull_request:
push:
branches:
- feature/fused-ops
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
buildandtest:
name: Build & Test (no torch-mlir)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}
variant: sccache
- name: Set virtual env
run: |
python3 -m venv .venv
source .venv/bin/activate
# Reuse the requirements from mlir
# mlir-xten is an extension to mlir and should work under the same environment.
- name: Install requirements.txt
run: |
pip install -r ./llvm-project/mlir/python/requirements.txt
- name: Install Ninja
uses: llvm/actions/install-ninja@main
- name: Build and Test
shell: bash
id: build-llvm
run: |
cmake -GNinja \
-Bbuild \
llvm-project/llvm \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_USE_LINKER=lld \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_BUILD_UTILS=OFF \
-DLLVM_BUILD_RUNTIMES=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DLLVM_EXTERNAL_PROJECTS=mlir-xten \
-DMLIR_XTEN_ENABLE_TORCH=OFF \
-DLLVM_EXTERNAL_MLIR_XTEN_SOURCE_DIR="$PWD"
ninja -C build check-xten-all