Skip to content

Add ock artefact building #20

Add ock artefact building

Add ock artefact building #20

Workflow file for this run

# Simple workflow for running non-documentation PR testing
name: Run ock tests for PR testing
on:
workflow_call:
inputs:
ock:
required: false
type: boolean
default: true
test_tornado:
required: false
type: boolean
default: true
target_list:
required: false
type: string
default: '["x86_64", "aarch64", "riscv64"]'
# os_list:
# required: false
# type: string
# default: '["ubuntu-22.04", "windows-2019"]'
# update_cache:
# required: false
# type: boolean
# default: false
# target_host_x86_64_windows:
# required: false
# type: boolean
# default: false
# target_host_aarch64_linux:
# required: false
# type: boolean
# default: true
llvm_version:
required: false
type: string
default: 18
jobs:
# create_ock_artefacts:
# strategy:
# matrix:
# target: ${{ fromJson(inputs.target_list) }}
# runs-on: ${{ 'ubuntu-24.04' && contains(matrix.target, 'host_riscv') || ('windows-2019' && contains(matrix.target, 'windows') || 'ubuntu-22.04' ) }}
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: build ock artefact
# uses: ./.github/actions/do_build_ock_artefact
# with:
# target: ${{ matrix.target }}
# llvm_version: ${{ inputs.llvm_version }}
build_icd:
# only build for x86_64, aarch64_linux and if running tornado
if: (contains(inputs.target_list,'host_x86_64_linux') || contains(inputs.target_list, 'host_aarch64_linux')) && inputs.test_tornado
runs-on: ubuntu-22.04
steps:
- name: clone ock platform
uses: ./.github/actions/sparse_checkout
# The following can also be done with the matrix with exclude: to limit the targets to what we want
- name : build and upload icd x86_64
if: (contains(inputs.target_list, 'host_x86_64_linux'))
uses: ./.github/actions/do_build_icd
with:
target: host_x86_64_linux
- name : build and upload icd aarch64
if: (contains(inputs.target_list, 'host_aarch64_linux'))
uses: ./.github/actions/do_build_icd
with:
target: host_aarch64_linux
# Todo do as an action
build_run_tornado_x86_64:
if: contains(inputs.target_list, 'host_x86_64_linux')
needs: [ build_icd ]
runs-on: ubuntu-22.04
steps:

Check failure on line 81 in .github/workflows/planned_testing.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/planned_testing.yml

Invalid workflow file

You have an error in your yaml syntax on line 81
- name: clone ock platform
uses: ./.github/actions/sparse_checkout
- name : build and upload icd
if: (contains(inputs.target_list, 'host_x86_64_linux'))
uses: ./.github/actions/do_build_tornado
with:
target: host_x86_64_linux
# - name: Install Ninja
# uses: llvm/actions/install-ninja@main
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# - target: riscv64
# runs-on: ${{ matrix.os }}
# steps:
# # - name: Install Ninja
# # uses: llvm/actions/install-ninja@main
# - name: clone ock platform
# uses: actions/checkout@v4
# with:
# sparse-checkout: |
# platform
# .github
# - name: download icd artifact
# uses: actions/download-artifact@v4
# with:
# name: icd_${{matrix.os}}_${{matrix.target}}
# path: install_icd
# # Get maven
# - name: fetch maven
# run: |
# wget https://archive.apache.org/dist/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.tar.gz
# tar xf apache-maven-3.9.3-bin.tar.gz
# # for x86, we'll need to do something else for aarch64
# - name: select jdk21
# run: |
# sudo update-java-alternatives -s temurin-21-jdk-amd64
# pip install tqdm
# - name: build tornadovm
# run: |
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1 TornadoVM_build
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
# export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk
# export PATH=$PWD/apache-maven-3.9.3/bin:$PATH
# mvn -v
# java --version
# cd TornadoVM_build
# # The tornado build system links in OpenCL assuming it's in a known place. This gets around
# # this by pass CXX as an environment variable as it's difficult to change the build system
# # even if we don't use this script.
# CXX="g++ -L$GITHUB_WORKSPACE/install_icd/lib" make -j8 jdk21 BACKEND=opencl
# # # Not sure if gitlab ci does not follow symbolic links so copy for the artefact
# # cp -r -L $TORNADO_SDK $GITHUB_WORKSPACE/TornadoVM_SDK
# - name: Download ock artefact
# uses: actions/download-artifact@v4
# with:
# name: ock_${{matrix.os}}_${{matrix.target}}
# path: install_ock
# - name: Run tornado example
# run: |
# export ARTEFACT_CHECKOUT_PATH=$GITHUB_WORKSPACE/install_ock
# echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH
# ls $ARTEFACT_CHECKOUT_PATH
# export ICD_LOADER_INSTALL_PATH=$GITHUB_WORKSPACE/install_icd
# echo ICD_LOADER_INSTALL_PATH is $ICD_LOADER_INSTALL_PATH
# ls $ICD_LOADER_INSTALL_PATH
# export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH
# echo $LD_LIBRARY_PATH
# export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
# export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk
# export PATH=$TORNADO_SDK/bin:$PATH
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1
# cd TornadoVM
# CA_HOST_DUMP_ASM=1 tornado --printKernel --threadInfo -m tornado.examples/uk.ac.manchester.tornado.examples.compute.MatrixMultiplication2D 256
# todo : download ock artefact
# Run tornado example
# at some point we will make an artefact if we want to do more, but it is enough to show it working using the created files.
# - name: run tornado example
# run: |
# echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH
# ls $ARTEFACT_CHECKOUT_PATH
# export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH
# echo $LD_LIBRARY_PATH
# export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
# export TORNADO_SDK=$CI_PROJECT_DIR/TornadoVM_SDK
# export PATH=$TORNADO_SDK/bin:$PATH
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1
# cd TornadoVM
# toolchain:
# description: 'path to toolchain'
# default: $GITHUB_WORKSPACE/ock/platform/x86_64-linux.cmake
# build_type:
# description: 'path to toolchain'
# default: ock/platform/x86_64-linux.cmake
# name:
# description: 'artifact name'
# default: ubuntu-22.04-x86_64
# use_ock_artefacts:
# needs: [ calc_matrix, create_ock_artefacts ]
# strategy:
# matrix:
# target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# - target: riscv64
# runs-on: ${{ matrix.os }}
# steps:
# - name: Download ock artefact
# uses: actions/download-artifact@v4
# with:
# name: ock_${{matrix.os}}_${{matrix.target}}
# path: ock_${{matrix.os}}_${{matrix.target}}
# - name: print ock artefact
# run: |
# ls -R .
# echo "${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.arch }}" > foo.txt
# --define CA_CL_ENABLE_ICD_LOADER=ON
# --define OCL_EXTENSION_cl_khr_command_buffer=ON
# --define OCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=ON
# --define OCL_EXTENSION_cl_khr_extended_async_copies=ON
# --target check-ock
# -B build