From 174b535596c337ba2cffd3da34e4bde1b7b66da1 Mon Sep 17 00:00:00 2001 From: "srividya.sundaram" Date: Fri, 29 Jan 2021 12:06:25 -0800 Subject: [PATCH 1/6] Add guidelines for adding FE tests --- CONTRIBUTING.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 03e363c191e7e..af63bbcdbb8ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,20 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information. - Run regression tests - [instructions](sycl/doc/GetStartedGuide.md#test-dpc-toolchain). +**Guidelines for adding Clang FE tests**: +- Use `sycl::` namespace instead of `cl::sycl::` + +- Include sycl mock headers as system headers. +Example: `-internal-isystem %S/Inputs` +`#include "sycl.hpp"` + +- Use SYCL functions for invoking kernels from the mock header `(single_task, parallel_for)` + +- Add a helpful comment describing what the test does at the beginning and other comments throughout the test as necessary. + +- Try to follow descriptive naming convention for variables, functions as much as possible. +Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#id43) + ### Commit message - When writing your commit message, please make sure to follow From 01c5b924bc49810bd0e2bb5cfe50806ec0f225f3 Mon Sep 17 00:00:00 2001 From: "srividya.sundaram" Date: Mon, 1 Feb 2021 11:16:46 -0800 Subject: [PATCH 2/6] Address review comments --- CONTRIBUTING.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index af63bbcdbb8ee..f3f2eddb1dc1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,12 +61,20 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information. Example: `-internal-isystem %S/Inputs` `#include "sycl.hpp"` -- Use SYCL functions for invoking kernels from the mock header `(single_task, parallel_for)` +- Use SYCL functions for invoking kernels from the mock header `(single_task, parallel_for, parallel_for_work_group)` +Example: +```bash +`#include "Inputs/sycl.hpp"` +sycl::queue q; +q.submit([&](cl::sycl::handler &h) { +h.single_task( { //code }); +}); +``` - Add a helpful comment describing what the test does at the beginning and other comments throughout the test as necessary. - Try to follow descriptive naming convention for variables, functions as much as possible. -Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#id43) +Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly) ### Commit message From edffe2f4a2ae6f2c9c228ede4fd7d2eb492e09d4 Mon Sep 17 00:00:00 2001 From: "srividya.sundaram" Date: Mon, 1 Feb 2021 13:58:42 -0800 Subject: [PATCH 3/6] Add "test dpcpp toolchain" section --- CONTRIBUTING.md | 79 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3f2eddb1dc1e..9c2c9a19fe125 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,27 +54,64 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information. - Run regression tests - [instructions](sycl/doc/GetStartedGuide.md#test-dpc-toolchain). -**Guidelines for adding Clang FE tests**: -- Use `sycl::` namespace instead of `cl::sycl::` - -- Include sycl mock headers as system headers. -Example: `-internal-isystem %S/Inputs` -`#include "sycl.hpp"` - -- Use SYCL functions for invoking kernels from the mock header `(single_task, parallel_for, parallel_for_work_group)` -Example: -```bash -`#include "Inputs/sycl.hpp"` -sycl::queue q; -q.submit([&](cl::sycl::handler &h) { -h.single_task( { //code }); -}); -``` - -- Add a helpful comment describing what the test does at the beginning and other comments throughout the test as necessary. - -- Try to follow descriptive naming convention for variables, functions as much as possible. -Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly) +### Test DPC++ toolchain + +Every product change should be accompanied with corresponding test modification +(adding new test(s), extending, removing or modifying existing test(s)). + +There are 3 types of tests which are used for DPC++ toolchain validation: +* DPC++ in-tree LIT tests including [check-llvm](../../llvm/test), +[check-clang](../../clang/test), [check-llvm-spirv](../../llvm-spirv/test) and +[check-sycl](../../sycl/test) targets stored in this repository. These tests +should not have hardware (e.g. GPU, FPGA, etc.) or external software +dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following +this approach should be moved to DPC++ end-to-end or SYCL-CTS tests. +However, the tests for a feature under active development requiring atomic +change for tests and product can be put to +[sycl/test/on-device](../../sycl/test/on-device) temporarily. It is developer +responsibility to move the tests to DPC++ E2E test suite or SYCL-CTS once +the feature is stabilized. + + **Guidelines for adding DPC++ in-tree LIT tests (DPC++ Clang FE tests)**: + - Use `sycl::` namespace instead of `cl::sycl::` + + - Include sycl mock headers as system headers. + Example: `-internal-isystem %S/Inputs` + `#include "sycl.hpp"` + + - Use SYCL functions for invoking kernels from the mock header `(single_task, parallel_for, parallel_for_work_group)` + Example: + ```bash + `#include "Inputs/sycl.hpp"` + sycl::queue q; + q.submit([&](cl::sycl::handler &h) { + h.single_task( { //code }); + }); + ``` + + - Add a helpful comment describing what the test does at the beginning and other comments throughout the test as necessary. + + - Try to follow descriptive naming convention for variables, functions as much as possible. + Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly) + +* DPC++ end-to-end (E2E) tests which are extension to +[LLVM\* test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL). +A test which requires full stack including backend runtimes (e.g. OpenCL, +Level Zero or CUDA) should be put to DPC++ E2E test suite following +[CONTRIBUTING](https://github.com/intel/llvm-test-suite/blob/intel/CONTRIBUTING.md). + +* SYCL-CTS are official +[Khronos\* SYCL\* conformance tests](https://github.com/KhronosGroup/SYCL-CTS). +They verify SYCL specification compatibility. All implementation details or +extensions are out of scope for the tests. If SYCL specification has changed +(SYCL CTS tests conflict with recent version of SYCL specification) or change +is required in the way the tests are built with DPC++ compiler (defined in +[FindIntel_SYCL](https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-1.2.1/master/cmake/FindIntel_SYCL.cmake)) +pull request should be created under +[KhronosGroup/SYCL-CTS](https://github.com/KhronosGroup/SYCL-CTS) with required +patch. + + ### Commit message From 7d944bf1adc8da5f68116b81a695509dc910bbc2 Mon Sep 17 00:00:00 2001 From: "srividya.sundaram" Date: Mon, 1 Feb 2021 14:32:37 -0800 Subject: [PATCH 4/6] Remove redundant section from GSG --- CONTRIBUTING.md | 2 -- sycl/doc/GetStartedGuide.md | 35 ----------------------------------- 2 files changed, 37 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c2c9a19fe125..65d83dc3e6276 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -111,8 +111,6 @@ pull request should be created under [KhronosGroup/SYCL-CTS](https://github.com/KhronosGroup/SYCL-CTS) with required patch. - - ### Commit message - When writing your commit message, please make sure to follow diff --git a/sycl/doc/GetStartedGuide.md b/sycl/doc/GetStartedGuide.md index 01a18b9a0c825..ce7c97b56ce65 100644 --- a/sycl/doc/GetStartedGuide.md +++ b/sycl/doc/GetStartedGuide.md @@ -333,41 +333,6 @@ Make sure that these binaries are available in `PATH` environment variable: * `aoc` from `/compiler///lib/oclfpga/bin` * `aocl-ioc64` from `/compiler///bin` -### Test DPC++ toolchain - -Every product change should be accompanied with corresponding test modification -(adding new test(s), extending, removing or modifying existing test(s)). - -There are 3 types of tests which are used for DPC++ toolchain validation: -* DPC++ in-tree LIT tests including [check-llvm](../../llvm/test), -[check-clang](../../clang/test), [check-llvm-spirv](../../llvm-spirv/test) and -[check-sycl](../../sycl/test) targets stored in this repository. These tests -should not have hardware (e.g. GPU, FPGA, etc.) or external software -dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following -this approach should be moved to DPC++ end-to-end or SYCL-CTS tests. -However, the tests for a feature under active development requiring atomic -change for tests and product can be put to -[sycl/test/on-device](../../sycl/test/on-device) temporarily. It is developer -responsibility to move the tests to DPC++ E2E test suite or SYCL-CTS once -the feature is stabilized. - -* DPC++ end-to-end (E2E) tests which are extension to -[LLVM\* test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL). -A test which requires full stack including backend runtimes (e.g. OpenCL, -Level Zero or CUDA) should be put to DPC++ E2E test suite following -[CONTRIBUTING](https://github.com/intel/llvm-test-suite/blob/intel/CONTRIBUTING.md). - -* SYCL-CTS are official -[Khronos\* SYCL\* conformance tests](https://github.com/KhronosGroup/SYCL-CTS). -They verify SYCL specification compatibility. All implementation details or -extensions are out of scope for the tests. If SYCL specification has changed -(SYCL CTS tests conflict with recent version of SYCL specification) or change -is required in the way the tests are built with DPC++ compiler (defined in -[FindIntel_SYCL](https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-1.2.1/master/cmake/FindIntel_SYCL.cmake)) -pull request should be created under -[KhronosGroup/SYCL-CTS](https://github.com/KhronosGroup/SYCL-CTS) with required -patch. - #### Run in-tree LIT tests To verify that built DPC++ toolchain is working correctly, run: From 1d32e8777b97eb7715b82dada6d2716ab9bf1bef Mon Sep 17 00:00:00 2001 From: "srividya.sundaram" Date: Mon, 1 Feb 2021 14:35:31 -0800 Subject: [PATCH 5/6] Fix section title --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65d83dc3e6276..c4873d7893e29 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,7 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information. - Run regression tests - [instructions](sycl/doc/GetStartedGuide.md#test-dpc-toolchain). -### Test DPC++ toolchain +### Tests development Every product change should be accompanied with corresponding test modification (adding new test(s), extending, removing or modifying existing test(s)). From 69a7208d46dfdb5ec266191e4d70bf39de643ba2 Mon Sep 17 00:00:00 2001 From: "srividya.sundaram" Date: Mon, 1 Feb 2021 14:39:57 -0800 Subject: [PATCH 6/6] Retain test dpcpp toolchain header --- sycl/doc/GetStartedGuide.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/doc/GetStartedGuide.md b/sycl/doc/GetStartedGuide.md index ce7c97b56ce65..585c177c64f9a 100644 --- a/sycl/doc/GetStartedGuide.md +++ b/sycl/doc/GetStartedGuide.md @@ -333,6 +333,7 @@ Make sure that these binaries are available in `PATH` environment variable: * `aoc` from `/compiler///lib/oclfpga/bin` * `aocl-ioc64` from `/compiler///bin` +### Test DPC++ toolchain #### Run in-tree LIT tests To verify that built DPC++ toolchain is working correctly, run: