-
Notifications
You must be signed in to change notification settings - Fork 34
131 lines (111 loc) · 4.87 KB
/
create_publish_artifacts.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build and Package
on:
pull_request:
paths:
- '.github/workflows/create_publish_artifacts.yml'
push:
branches:
- stable
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# build and run for RISCV
run_riscv_m1_nightly_package:
runs-on: ubuntu-22.04
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
# installs tools, ninja, installs llvm and sets up sccache
- name: Setup ubuntu
uses: ./.github/actions/setup_ubuntu_build
with:
llvm_version: 17
llvm_build_type: Release
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build riscv M1
uses: ./.github/actions/do_build_ock/do_build_m1
with:
build_type: Release
install_dir: install
extra_flags: '-DCA_REFSI_M1_DEMO_MODE=ON'
- name: Create OCK install
run: |
ninja -C $(pwd)/build install
- name: Download Daily Release
run: |
# TODO: Update the nightly release from intel/llvm from 2023-12-18 to daily once
# everything has stablised
wget "https://github.com/intel/llvm/releases/download/nightly-2023-12-18/sycl_linux.tar.gz"
mkdir linux_nightly_release
tar -xzf sycl_linux.tar.gz -C linux_nightly_release
- name: Test RSICV examples
run: |
# Set environment variables
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(pwd)/linux_nightly_release/lib/libsycl.so:$(pwd)/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang
export CA_HAL_DEBUG=1
#export CA_PROFILE_LEVEL=3
export ONEAPI_DEVICE_SELECTOR=opencl:acc
export OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so
# As the oneAPI basetoolkit release has a whitelist of devices, it filters out RefSi.
# To override it, as a temporary solution we can point SYCL_CONFIG_FILE_NAME to ``.
# This way it doesn't set the default sycl.conf.
export SYCL_CONFIG_FILE_NAME=""
mkdir build_ock_tests
cmake -GNinja -Bbuild_ock_tests -DCMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++ -DCMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang -DOpenCL_LIBRARY=$(pwd)/install/lib/libCL.so -DOpenCL_INCLUDE_DIR=$(pwd)/linux_nightly_release/include/sycl $(pwd)/examples/applications
ninja -C build_ock_tests
cd build_ock_tests
ls
# Run simple_vector_add
./bin/simple-vector-add
CA_RISCV_DUMP_IR=1 CA_HAL_DEBUG=1 OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME="" bin/simple-vector-add
env CA_RISCV_VLEN_BITS_MIN=128 CA_RISCV_VF=4 bin/simple-vector-add
# Run tests
ctest bin/ --verbose
cd ..
- name: Clone oneAPI-samples
run: git clone https://github.com/oneapi-src/oneAPI-samples.git
- name: Setup environment and test Vector Add
run: |
export ONEAPI_ROOT=$(pwd)/linux_nightly_release
export PATH=$(pwd)/linux_nightly_release/bin:$PATH
export LD_LIBRARY_PATH=$(pwd)/linux_nightly_release/lib:$(pwd)/install/lib:$LD_LIBRARY_PATH
$(pwd)/linux_nightly_release/bin/clang++ -fsycl $(pwd)/oneAPI-samples/DirectProgramming/C++SYCL/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp -o vect
CA_RISCV_DUMP_IR=1 CA_HAL_DEBUG=1 OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME="" ./vect
- name: Package Artifacts
run: |
tar -czf ock_install.tar.gz install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: riscv-build
path: ock_install.tar.gz
- name: Compute tag
id: tag
run: |
if [ "${{ github.event_name == 'schedule' }}" == "true" ]; then
echo "TAG=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
else
# TODO: Use date of the commit?
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
fi
- name: Create OCK pre-release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
files:
ock_install.tar.gz
tag_name: nightly-${{ steps.tag.outputs.TAG }}
name: OCK daily ${{ steps.tag.outputs.TAG }}
prerelease: true
body: "Daily build ${{ steps.tag.outputs.TAG }}"
target_commitish: ${{ github.sha }}