From 7614b0aa5e1b8cf053b37186d9c85dac2159c649 Mon Sep 17 00:00:00 2001 From: Alexey Bader Date: Thu, 15 Jun 2023 18:08:47 -0700 Subject: [PATCH 1/5] Base DPC++ docker container on the image from intel/llvm. intel/llvm project provides daily built docker images with pre-built DPC++ compiler. Using this image saves us time to build the compiler from sources. --- docker/dpcpp/Dockerfile | 24 ++---------------------- docker/dpcpp/configure.sh | 4 ++-- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/docker/dpcpp/Dockerfile b/docker/dpcpp/Dockerfile index f93a1084c..9aecbfd37 100644 --- a/docker/dpcpp/Dockerfile +++ b/docker/dpcpp/Dockerfile @@ -1,24 +1,4 @@ -# DPC++ version (git revision) to install -ARG IMPL_VERSION - -FROM khronosgroup/sycl-cts-ci:common - -ARG IMPL_VERSION -RUN test -n "$IMPL_VERSION" || ( echo "Error: IMPL_VERSION is not set"; exit 1 ) - -RUN git clone https://github.com/intel/llvm.git \ - --branch=sycl --single-branch --shallow-since=2021-09-01 \ - --recurse-submodules /tmp/dpcpp && \ - cd /tmp/dpcpp && \ - git checkout $IMPL_VERSION && \ - python3 /tmp/dpcpp/buildbot/configure.py \ - --src-dir=/tmp/dpcpp \ - --obj-dir=/tmp/build \ - --build-type=Release \ - --cmake-opt=-DCMAKE_INSTALL_PREFIX=/sycl && \ - python3 /tmp/dpcpp/buildbot/compile.py \ - --src-dir=/tmp/dpcpp \ - --obj-dir=/tmp/build && \ - rm -rf /tmp/dpcpp /tmp/build +# Go to https://github.com/intel/llvm/pkgs/container/llvm%2Fsycl_ubuntu2204_nightly for the latest docker image tag +FROM ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:no-drivers-c9219ce7232da9bc10d50dff8a1858540b292df5 COPY configure.sh /scripts/ diff --git a/docker/dpcpp/configure.sh b/docker/dpcpp/configure.sh index d90df3f90..48a26fca8 100644 --- a/docker/dpcpp/configure.sh +++ b/docker/dpcpp/configure.sh @@ -5,8 +5,8 @@ set -o errexit -o pipefail -o noclobber -o nounset cmake . -G Ninja -B build \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DSYCL_IMPLEMENTATION=DPCPP \ - -DDPCPP_INSTALL_DIR=/sycl \ - -DCMAKE_CXX_COMPILER=/sycl/bin/clang++ \ + -DDPCPP_INSTALL_DIR=/opt/sycl \ + -DCMAKE_CXX_COMPILER=/opt/sycl/bin/clang++ \ -DCMAKE_BUILD_TYPE=Release \ -DSYCL_CTS_ENABLE_FULL_CONFORMANCE=0 \ -DSYCL_CTS_ENABLE_DEPRECATED_FEATURES_TESTS=1 \ From acdc1c9afc9b2076c1ee352affe46ba1f5830c13 Mon Sep 17 00:00:00 2001 From: vladimirkhashev Date: Thu, 15 Jun 2023 11:55:22 -0700 Subject: [PATCH 2/5] Add test plan for "discard queue events" extension --- .../oneapi_discard_queue_events.asciidoc | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 test_plans/oneapi_discard_queue_events.asciidoc diff --git a/test_plans/oneapi_discard_queue_events.asciidoc b/test_plans/oneapi_discard_queue_events.asciidoc new file mode 100644 index 000000000..4f078c143 --- /dev/null +++ b/test_plans/oneapi_discard_queue_events.asciidoc @@ -0,0 +1,82 @@ +:sectnums: +:xrefstyle: short + += Test plan for sycl extension oneapi discard queue events + +This is a test plan for the extension adding +`ext::oneapi::property::queue::discard_events` property for `sycl::queue`. The +extension is described in +https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/supported/sycl_ext_oneapi_discard_queue_events.asciidoc[sycl_ext_oneapi_discard_queue_events.asciidoc]. + +== Testing scope + +=== Device coverage + +All of the tests described below are performed only on the default device that +is selected on the CTS command line. + +=== Feature test macro + +All of the tests should use `#ifdef SYCL_EXT_ONEAPI_DISCARD_QUEUE_EVENTS` so they can +be skipped if feature is not supported. + +== Tests + +Extension introduces new `ext::oneapi::property::queue::discard_events` +property for `sycl::queue` and new enumerator value for the +`sycl::info::event_command_status` enumeration. When the `queue` is created +with the `discard_events` property the `queue` member functions returning +events will return _invalid_ events. +Behavior of some _invalid_ event member functions is different from the default +event behavior and needs to be tested. The behavior when _invalid_ event is +passed into `handler::depends_on()` function is also different and needs to be +tested. + +=== Test description + +==== Event member functions + +* Create a queue with property list that includes `discard_events` property +* Submit a kernel to the queue, save a returned event +* Call `get_wait_list()` for the event object +* Check that an exception with the `errc::invalid` error code is thrown +* Call `wait()` for the event object +* Check that an exception with the `errc::invalid` error code is thrown +* Call the static version of `wait()` function and passed the saved event + object to it +* Check that an exception with the `errc::invalid` error code is thrown +* Call `wait_and_throw()` for the event object +* Check that an exception with the `errc::invalid` error code is thrown +* Call the static version of `wait_and_throw()` function and passed the saved + event object to it +* Check that an exception with the `errc::invalid` error code is thrown +* Call `get_info()` for the event object +* Check returned value type is `sycl::info::event_command_status` and returned + value is `sycl::info::event_command_status::ext_oneapi_unknown` + +Perform the test for two cases when queue property list includes also +`in-order` property and doesn't. + +==== Handler member functions + +* Create a queue with property list that includes `discard_events` and + `in-order` properties +* Submit a kernel to the queue, save a returned event +* Submit a command group that call `handler::depends_on(event)` on the saved + event +* Check that an exception with the `errc::invalid` error code is thrown +* Submit a command group that call `handler::depends_on(vector)` on the + saved event +* Check that an exception with the `errc::invalid` error code is thrown + +Perform the test for two cases when queue property list includes also +`in-order` property and doesn't. + +==== Simultaneously using `discard_events` and `enable_profiling` properties + +According to the specification `discard_events` property is incompatible with +`enable_profiling`. We should check that attempts to construct a queue with both properties raises `errc::invalid`. + +* Create a queue with property list that includes `discard_events` and + `enable_profiling` properties +* Check that an exception with the `errc::invalid` error code is thrown From 2995543c13fd448fda4071a4bee1185b272118c2 Mon Sep 17 00:00:00 2001 From: Alexey Bader Date: Fri, 16 Jun 2023 12:12:36 -0700 Subject: [PATCH 3/5] Align Khronos and DPC++ image tags. --- .github/workflows/cts_ci.yml | 4 ++-- docker/dpcpp/Dockerfile | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cts_ci.yml b/.github/workflows/cts_ci.yml index 1f16aacde..b30e33365 100644 --- a/.github/workflows/cts_ci.yml +++ b/.github/workflows/cts_ci.yml @@ -59,7 +59,7 @@ jobs: # - sycl-impl: computecpp # version: 2.11.0 - sycl-impl: dpcpp - version: 0267c1b + version: c9219ce7232da9bc10d50dff8a1858540b292df5 - sycl-impl: hipsycl version: 3d8b1cd steps: @@ -119,7 +119,7 @@ jobs: - sycl-impl: computecpp version: 2.11.0 - sycl-impl: dpcpp - version: 0267c1b + version: c9219ce7232da9bc10d50dff8a1858540b292df5 - sycl-impl: hipsycl version: 3d8b1cd env: diff --git a/docker/dpcpp/Dockerfile b/docker/dpcpp/Dockerfile index 9aecbfd37..741cbc277 100644 --- a/docker/dpcpp/Dockerfile +++ b/docker/dpcpp/Dockerfile @@ -1,4 +1,7 @@ -# Go to https://github.com/intel/llvm/pkgs/container/llvm%2Fsycl_ubuntu2204_nightly for the latest docker image tag -FROM ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:no-drivers-c9219ce7232da9bc10d50dff8a1858540b292df5 +# DPC++ build version (git revision) to install +# Go to https://github.com/intel/llvm/pkgs/container/llvm%2Fsycl_ubuntu2204_nightly to see avilable docker image tags +ARG IMPL_VERSION + +FROM ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:no-drivers-$IMPL_VERSION COPY configure.sh /scripts/ From 8ec4952546a22a8e3c2465208378aa3d2fd3a92a Mon Sep 17 00:00:00 2001 From: vladimirkhashev Date: Mon, 19 Jun 2023 08:17:55 -0700 Subject: [PATCH 4/5] Apply comments --- .../oneapi_discard_queue_events.asciidoc | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/test_plans/oneapi_discard_queue_events.asciidoc b/test_plans/oneapi_discard_queue_events.asciidoc index 4f078c143..ec34ea380 100644 --- a/test_plans/oneapi_discard_queue_events.asciidoc +++ b/test_plans/oneapi_discard_queue_events.asciidoc @@ -24,13 +24,14 @@ be skipped if feature is not supported. Extension introduces new `ext::oneapi::property::queue::discard_events` property for `sycl::queue` and new enumerator value for the -`sycl::info::event_command_status` enumeration. When the `queue` is created -with the `discard_events` property the `queue` member functions returning +`sycl::info::event_command_status` enumeration. When the queue is created +with the `discard_events` property the queue member functions returning events will return _invalid_ events. Behavior of some _invalid_ event member functions is different from the default event behavior and needs to be tested. The behavior when _invalid_ event is passed into `handler::depends_on()` function is also different and needs to be -tested. +tested. Also we should check correct kernel execution submitted to the queue +constructed with the `ext::oneapi::property::queue::discard_events` property. === Test description @@ -80,3 +81,23 @@ According to the specification `discard_events` property is incompatible with * Create a queue with property list that includes `discard_events` and `enable_profiling` properties * Check that an exception with the `errc::invalid` error code is thrown + +==== Kernel execution check + +Do all of the following twice, with a queue constructed with `discard_events` +and with a queue constructed with both `discard_events` and `in_order`: + +* Submit a `single_task` kernel, wait on the queue, validate that the kernel + ran +* Submit a simple `parallel_for` kernel, wait on the queue, validate that the + kernel ran +* Submit an `nd-range` kernel, wait on the queue, validate that the kernel ran +* Submit a `single_task` kernel using assert (where the assert does not + trigger), wait on the queue, validate that the kernel ran +* Submit a `single_task` kernel using stream, wait on the kernel, validate that + the kernel ran +* Submit a `single_task` kernel using a buffer accessor, wait on the kernel, + validate that the kernel ran + +If the `SYCL_EXT_ONEAPI_ASSERT` macro isn't defined test with kernel using +assert can be skipped. From 1c199ba11ae98caa5cbb6132ccae2766411b624b Mon Sep 17 00:00:00 2001 From: Alexey Bader Date: Tue, 20 Jun 2023 11:10:15 -0700 Subject: [PATCH 5/5] Switch to newer DPC++ version to fix compilation errors. --- .github/workflows/cts_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cts_ci.yml b/.github/workflows/cts_ci.yml index b30e33365..8fb281b89 100644 --- a/.github/workflows/cts_ci.yml +++ b/.github/workflows/cts_ci.yml @@ -59,7 +59,7 @@ jobs: # - sycl-impl: computecpp # version: 2.11.0 - sycl-impl: dpcpp - version: c9219ce7232da9bc10d50dff8a1858540b292df5 + version: 83f877975c97acdb38d84f94dc146571cd522e0e - sycl-impl: hipsycl version: 3d8b1cd steps: @@ -119,7 +119,7 @@ jobs: - sycl-impl: computecpp version: 2.11.0 - sycl-impl: dpcpp - version: c9219ce7232da9bc10d50dff8a1858540b292df5 + version: 83f877975c97acdb38d84f94dc146571cd522e0e - sycl-impl: hipsycl version: 3d8b1cd env: