Skip to content

[SYCL][InvokeSimd][E2E] Fix scale tests on hardware that doesn't support fp64 #9552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// REQUIRES: aspect-fp64
// Check that full compilation works:
// RUN: %clangxx -DIMPL_SUBGROUP -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %S/../scale_double.cpp -o %t.out
// RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %{run} %t.out
//
// VISALTO enable run
// RUN: env IGC_VISALTO=63 IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %{run} %t.out

/*
* This tests is the same as InvokeSimd/feature/scale_double.cpp, but compiles
* without optional subgroup attribute specified and intended to check that
* compiler is able to choose subgroup size correctly.
*/
4 changes: 3 additions & 1 deletion sycl/test-e2e/InvokeSimd/Feature/scale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ int main(void) {
const bool SupportsDouble = dev.has(aspect::fp64);

bool passed = true;
#ifndef TEST_DOUBLE_TYPE
passed &= test<unsigned char>(q);
passed &= test<char>(q);
passed &= test<unsigned short>(q);
Expand All @@ -157,9 +158,10 @@ int main(void) {
passed &= test<long>(q);

passed &= test<float>(q);
#else
if (SupportsDouble)
passed &= test<double>(q);

#endif
std::cout << (passed ? "Passed\n" : "FAILED\n");
return passed ? 0 : 1;
}
27 changes: 27 additions & 0 deletions sycl/test-e2e/InvokeSimd/Feature/scale_double.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// REQUIRES: aspect-fp64
// Check that full compilation works:
// RUN: %{build} -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr -o %t.out
// RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %{run} %t.out
//
// VISALTO enable run
// RUN: env IGC_VISALTO=63 IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %{run} %t.out

/*
* Tests invoke_simd support in the compiler/headers
* Test case purpose:
* -----------------
* To verify that the simple scale example from the invoke_simd spec
* https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_invoke_simd.asciidoc
* works.
*
* Test case description:
* ---------------------
* Invoke a simple SIMD function that scales all elements of a SIMD type X by a
* scalar value n with double.
*
* This test also runs with all types of VISA link time optimizations enabled.
*/

#define TEST_DOUBLE_TYPE

#include "scale.cpp"