Skip to content

Commit

Permalink
Add CTS on devcloud(verbose)
Browse files Browse the repository at this point in the history
  • Loading branch information
szadam committed Oct 2, 2023
1 parent 6a0eb7e commit 2733a72
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 6 deletions.
48 changes: 47 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,53 @@ jobs:
working-directory: ${{github.workspace}}/build
run: bin/codegen

adapter-build-devcloud:
name: Conformance test - Adapter L0 on devcloud Ubuntu
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]

runs-on: devcloud-pvc
steps:
- uses: actions/checkout@v3

- name: Install pip packages
run: python3 -m pip install -r third_party/requirements.txt

- name: Download DPC++
run: |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-08-31/sycl_linux.tar.gz
mkdir dpcpp_compiler
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
- name: Execute CTS
run: >
srun -p pvc-shared scripts/devcloud-test.sh ${{github.workspace}} ${{matrix.compiler.c}} ${{matrix.compiler.cxx}} ${{matrix.build_type}}
- name: CTS output
if: always()
run: |
echo "#### sampler ####"
cat ${{github.workspace}}/build/test/conformance/sampler/output.txt
echo "#### memory ####"
cat ${{github.workspace}}/build/test/conformance/memory/output.txt
echo "#### virtual_memory ####"
cat ${{github.workspace}}/build/test/conformance/virtual_memory/output.txt
echo "#### device ####"
cat ${{github.workspace}}/build/test/conformance/device/output.txt
echo "#### runtime ####"
cat ${{github.workspace}}/build/test/conformance/runtime/output.txt
echo "#### queue ####"
cat ${{github.workspace}}/build/test/conformance/queue/output.txt
echo "#### context ####"
cat ${{github.workspace}}/build/test/conformance/context/output.txt
echo "#### event ####"
cat ${{github.workspace}}/build/test/conformance/event/output.txt
echo "#### usm ####"
cat ${{github.workspace}}/build/test/conformance/usm/output.txt
windows-build:
name: Build - Windows
strategy:
Expand Down Expand Up @@ -301,7 +348,6 @@ jobs:
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"


macos-build:
name: Build - MacOS
strategy:
Expand Down
45 changes: 45 additions & 0 deletions scripts/devcloud-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#! /bin/bash
# Copyright (C) 2023 Intel Corporation

# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

workspace=$1
compiler_c=$2
compiler_cxx=$3
build_type=$4

set -e
echo "Hostname: $(hostname)"

#source /opt/intel/oneapi/setvars.sh
export PATH=${workspace}/dpcpp_compiler/bin:$PATH
export CPATH=${workspace}/dpcpp_compiler/include:$CPATH
export LIBRARY_PATH=${workspace}/dpcpp_compiler/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=${workspace}/dpcpp_compiler/lib:$LD_LIBRARY_PATH
unset ONEAPI_DEVICE_SELECTOR
export ONEAPI_DEVICE_SELECTOR=level_zero:0

sycl-ls

cmake \
-B${workspace}/build \
-DCMAKE_C_COMPILER=${compiler_c} \
-DCMAKE_CXX_COMPILER=${compiler_cxx} \
-DUR_ENABLE_TRACING=ON \
-DUR_DEVELOPER_MODE=ON \
-DCMAKE_BUILD_TYPE=${build_type} \
-DUR_BUILD_TESTS=ON \
-DUR_FORMAT_CPP_STYLE=OFF \
-DUR_BUILD_ADAPTER_L0=ON

cmake --build ${workspace}/build -j $(nproc)

# Unset these variables is needed for the conformance test
unset LD_LIBRARY_PATH
unset LIBRARY_PATH
# Temporarily disabling platform test for L0, because of hang
# See issue: #824
cd ${workspace}/build
ctest -C ${build_type} --output-on-failure -L "conformance" -E "platform-adapter_level_zero" --timeout 180 -VV
15 changes: 10 additions & 5 deletions test/conformance/cts_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@
parser.add_argument("--test_command", help="Ctest test case")

args = parser.parse_args()
result = subprocess.Popen([args.test_command, '--gtest_brief=1'], stdout = subprocess.PIPE, text = True) # nosec B603
output_file = open("output.txt", "w")

result = subprocess.Popen([args.test_command, '--gtest_brief=1'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) # nosec B603

pat = re.compile(r'\[( )*FAILED( )*\]')
for line in result.stdout.readlines():

for line in result.stdout:
if pat.search(line):
test_case = line.split(" ")[5]
test_case = test_case.rstrip(',')
print(test_case)
output_file.write(line)

rc = result.communicate()
output_file.close()

result.communicate()
rc = result.returncode
if rc < 0:
print(signal.strsignal(abs(result.returncode)))
print(signal.strsignal(abs(rc)))

0 comments on commit 2733a72

Please sign in to comment.