Skip to content

Commit

Permalink
ci: add ci on QEMU for AArch64 JIT implemenation
Browse files Browse the repository at this point in the history
The old QEMU behaves differently from real CPUs with regard to SVE instructions.
qemu.sh downloads the recnet QEMU source code and builds it.
  • Loading branch information
kawakami-k authored and Evarist committed Oct 27, 2020
1 parent ae90330 commit 1c75094
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/automation/.drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# *******************************************************************************
# Copyright 2020 Arm Limited and affiliates.
# Copyright 2020 FUJITSU LIMITED
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -113,3 +114,23 @@ steps:
- .github/automation/build_acl.sh --version 20.08 --arch arm64-v8a --root-dir $(pwd)/ComputeLibrary
- .github/automation/build.sh --threading omp --mode Release --source-dir $(pwd) --build-dir $(pwd)/build --acl-dir $(pwd)/ComputeLibrary
- .github/automation/test.sh --test-kind gtest --build-dir $(pwd)/build --report-dir $(pwd)/report

---
kind: pipeline
name: Ubuntu18-JIT

platform:
arch: amd64

steps:
- name: gcc-jit-test
image: ubuntu:18.04
commands:
- apt-get update && apt-get install -y git build-essential cmake binutils-aarch64-linux-gnu crossbuild-essential-arm64 pkg-config-aarch64-linux-gnu python3 wget libglib2.0-dev
- .github/automation/env/qemu.sh
- export CC=aarch64-linux-gnu-gcc
- export CXX=aarch64-linux-gnu-g++
- .github/automation/build.sh --threading omp --mode Release --source-dir $(pwd) --build-dir $(pwd)/build --cmake-opt "-DDNNL_TARGET_ARCH=AARCH64 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=AARCH64 -DCMAKE_FIND_ROOT_PATH=/usr/aarch64-linux-gnu -DDNNL_TARGET_EMULATOR=qemu-aarch64"
- export QEMU_LD_PREFIX=/usr/aarch64-linux-gnu
- export QEMU_CPU="max,sve512=on"
- .github/automation/test.sh --test-kind gtest --build-dir $(pwd)/build --report-dir $(pwd)/report
6 changes: 5 additions & 1 deletion .github/automation/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ while [[ $# -gt 0 ]]; do
--build-dir)
BUILD_DIR="$2"
;;
--cmake-opt)
CMAKE_OPT="$2"
;;
*)
echo "Unknown option: $1"
exit 1
Expand All @@ -45,7 +48,8 @@ while [[ $# -gt 0 ]]; do
shift
done

CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILD_MODE} -DDNNL_BUILD_FOR_CI=ON -DDNNL_WERROR=ON"
CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILD_MODE} -DDNNL_BUILD_FOR_CI=ON -DDNNL_WERROR=ON ${CMAKE_OPT}"

CPU_RUNTIME="NONE"
GPU_RUNTIME="NONE"

Expand Down
25 changes: 25 additions & 0 deletions .github/automation/env/qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /bin/bash

#===============================================================================
# Copyright 2020 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#===============================================================================

# Download, build and install QEMU
wget https://download.qemu.org/qemu-5.0.0.tar.xz
tar xJf qemu-5.0.0.tar.xz > /dev/null
cd qemu-5.0.0
./configure --target-list=aarch64-linux-user > /dev/null
make > /dev/null
make install > /dev/null

0 comments on commit 1c75094

Please sign in to comment.