From 10861d8f252c45b7c4b579e530e744911d3170d2 Mon Sep 17 00:00:00 2001 From: Alexey Bader Date: Wed, 9 Sep 2020 14:46:18 +0300 Subject: [PATCH 1/3] [SYCL][NFC] Remove workaround for SPIR-V translator issues --- sycl/test/basic_tests/stream/stream.cpp | 6 +----- sycl/test/hier_par/hier_par_wgscope.cpp | 5 +---- sycl/test/sub_group/generic-shuffle.cpp | 5 +---- sycl/test/sub_group/generic_reduce.cpp | 7 ++----- sycl/test/sub_group/load_store.cpp | 5 +---- sycl/test/sub_group/scan_fp16.cpp | 5 +---- sycl/test/sub_group/shuffle.cpp | 5 +---- sycl/test/sub_group/shuffle_fp16.cpp | 5 +---- sycl/test/sub_group/shuffle_fp64.cpp | 5 +---- 9 files changed, 10 insertions(+), 38 deletions(-) diff --git a/sycl/test/basic_tests/stream/stream.cpp b/sycl/test/basic_tests/stream/stream.cpp index 34cef884152a..6b5e6925298d 100644 --- a/sycl/test/basic_tests/stream/stream.cpp +++ b/sycl/test/basic_tests/stream/stream.cpp @@ -1,8 +1,4 @@ -// XFAIL: cpu -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s // RUN: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER // RUN: %GPU_RUN_ON_LINUX_PLACEHOLDER %t.out %GPU_CHECK_ON_LINUX_PLACEHOLDER diff --git a/sycl/test/hier_par/hier_par_wgscope.cpp b/sycl/test/hier_par/hier_par_wgscope.cpp index b0e58d305e1f..42022748dfe5 100644 --- a/sycl/test/hier_par/hier_par_wgscope.cpp +++ b/sycl/test/hier_par/hier_par_wgscope.cpp @@ -1,7 +1,4 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/generic-shuffle.cpp b/sycl/test/sub_group/generic-shuffle.cpp index 786a9b57a0ec..b8bb972d646a 100644 --- a/sycl/test/sub_group/generic-shuffle.cpp +++ b/sycl/test/sub_group/generic-shuffle.cpp @@ -1,10 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/generic_reduce.cpp b/sycl/test/sub_group/generic_reduce.cpp index 98401e091e73..fdad3289ec10 100644 --- a/sycl/test/sub_group/generic_reduce.cpp +++ b/sycl/test/sub_group/generic_reduce.cpp @@ -1,11 +1,8 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-unnamed-lambda -std=c++14 %s -o %t.out -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple -std=c++14 -D SG_GPU %s -o %t_gpu.out +// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -std=c++14 %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple -std=c++14 -D SG_GPU %s -o %t_gpu.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t_gpu.out diff --git a/sycl/test/sub_group/load_store.cpp b/sycl/test/sub_group/load_store.cpp index c51a01fbdaef..dae9db67e979 100644 --- a/sycl/test/sub_group/load_store.cpp +++ b/sycl/test/sub_group/load_store.cpp @@ -1,12 +1,9 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - // UNSUPPORTED: cuda || cpu // CUDA compilation and runtime do not yet support sub-groups. // #2252 Disable until all variants of built-ins are available in OpenCL CPU // runtime for every supported ISA // -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/scan_fp16.cpp b/sycl/test/sub_group/scan_fp16.cpp index 13e3f45b2794..bfdb09f8f7f3 100644 --- a/sycl/test/sub_group/scan_fp16.cpp +++ b/sycl/test/sub_group/scan_fp16.cpp @@ -1,10 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out //==--------------- scan_fp16.cpp - SYCL sub_group scan test --------*- C++ -*---==// diff --git a/sycl/test/sub_group/shuffle.cpp b/sycl/test/sub_group/shuffle.cpp index b86b00dbf89b..5207716148ef 100644 --- a/sycl/test/sub_group/shuffle.cpp +++ b/sycl/test/sub_group/shuffle.cpp @@ -1,10 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/shuffle_fp16.cpp b/sycl/test/sub_group/shuffle_fp16.cpp index 930035d37a67..62f07fc612de 100644 --- a/sycl/test/sub_group/shuffle_fp16.cpp +++ b/sycl/test/sub_group/shuffle_fp16.cpp @@ -1,10 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // //==------------ shuffle_fp16.cpp - SYCL sub_group shuffle test -----*- C++ -*---==// diff --git a/sycl/test/sub_group/shuffle_fp64.cpp b/sycl/test/sub_group/shuffle_fp64.cpp index 3b5c3994cec8..3b1ed5690760 100644 --- a/sycl/test/sub_group/shuffle_fp64.cpp +++ b/sycl/test/sub_group/shuffle_fp64.cpp @@ -1,10 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. -// See https://github.com/intel/llvm/issues/2264 for more details. - // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out From 72f7a2540ed38e745013f59ded690d95188bc527 Mon Sep 17 00:00:00 2001 From: Alexey Bader Date: Wed, 9 Sep 2020 15:52:01 +0300 Subject: [PATCH 2/3] Use XFAIL to work-around issues caused by enabling optimizations This way fixes will be detected automatically. --- sycl/test/basic_tests/boolean.cpp | 3 ++- sycl/test/basic_tests/stream/stream.cpp | 4 ++++ sycl/test/hier_par/hier_par_wgscope.cpp | 4 ++++ sycl/test/sub_group/generic_reduce.cpp | 4 ++++ sycl/test/sub_group/load_store.cpp | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sycl/test/basic_tests/boolean.cpp b/sycl/test/basic_tests/boolean.cpp index dec4aec312ed..031a0afafda0 100644 --- a/sycl/test/basic_tests/boolean.cpp +++ b/sycl/test/basic_tests/boolean.cpp @@ -1,7 +1,8 @@ // TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. +// XFAIL: gpu && (level_zero || opencl) -// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/basic_tests/stream/stream.cpp b/sycl/test/basic_tests/stream/stream.cpp index 6b5e6925298d..d7e42e6f5c8a 100644 --- a/sycl/test/basic_tests/stream/stream.cpp +++ b/sycl/test/basic_tests/stream/stream.cpp @@ -1,3 +1,7 @@ +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. +// See https://github.com/intel/llvm/issues/2264 for more details. +// XFAIL: gpu && (level_zero || opencl) + // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s // RUN: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER diff --git a/sycl/test/hier_par/hier_par_wgscope.cpp b/sycl/test/hier_par/hier_par_wgscope.cpp index 42022748dfe5..2167f3bfba8b 100644 --- a/sycl/test/hier_par/hier_par_wgscope.cpp +++ b/sycl/test/hier_par/hier_par_wgscope.cpp @@ -1,3 +1,7 @@ +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. +// See https://github.com/intel/llvm/issues/2264 for more details. +// XFAIL: gpu && (level_zero || opencl) && linux + // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/generic_reduce.cpp b/sycl/test/sub_group/generic_reduce.cpp index fdad3289ec10..3ef504343af4 100644 --- a/sycl/test/sub_group/generic_reduce.cpp +++ b/sycl/test/sub_group/generic_reduce.cpp @@ -1,3 +1,7 @@ +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. +// See https://github.com/intel/llvm/issues/2264 for more details. +// XFAIL: gpu && linux + // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // diff --git a/sycl/test/sub_group/load_store.cpp b/sycl/test/sub_group/load_store.cpp index dae9db67e979..f6c96a02324d 100644 --- a/sycl/test/sub_group/load_store.cpp +++ b/sycl/test/sub_group/load_store.cpp @@ -1,3 +1,7 @@ +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. +// See https://github.com/intel/llvm/issues/2264 for more details. +// XFAIL: gpu + // UNSUPPORTED: cuda || cpu // CUDA compilation and runtime do not yet support sub-groups. // #2252 Disable until all variants of built-ins are available in OpenCL CPU From 81f33074dad153abcc060c7f35bc196d1da451c8 Mon Sep 17 00:00:00 2001 From: Alexey Bader Date: Wed, 9 Sep 2020 16:55:59 +0300 Subject: [PATCH 3/3] Adjust checks for Windows --- sycl/test/basic_tests/stream/stream.cpp | 2 +- sycl/test/hier_par/hier_par_wgscope.cpp | 2 +- sycl/test/sub_group/generic_reduce.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/test/basic_tests/stream/stream.cpp b/sycl/test/basic_tests/stream/stream.cpp index d7e42e6f5c8a..441320da38f5 100644 --- a/sycl/test/basic_tests/stream/stream.cpp +++ b/sycl/test/basic_tests/stream/stream.cpp @@ -1,6 +1,6 @@ // TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// XFAIL: gpu && (level_zero || opencl) +// XFAIL: gpu && (level_zero || opencl) && linux // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s diff --git a/sycl/test/hier_par/hier_par_wgscope.cpp b/sycl/test/hier_par/hier_par_wgscope.cpp index 2167f3bfba8b..698ac60bf848 100644 --- a/sycl/test/hier_par/hier_par_wgscope.cpp +++ b/sycl/test/hier_par/hier_par_wgscope.cpp @@ -1,6 +1,6 @@ // TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// XFAIL: gpu && (level_zero || opencl) && linux +// XFAIL: gpu && (level_zero || opencl) // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out diff --git a/sycl/test/sub_group/generic_reduce.cpp b/sycl/test/sub_group/generic_reduce.cpp index 3ef504343af4..676c6b284a39 100644 --- a/sycl/test/sub_group/generic_reduce.cpp +++ b/sycl/test/sub_group/generic_reduce.cpp @@ -1,6 +1,6 @@ // TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// XFAIL: gpu && linux +// XFAIL: gpu // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups.