Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[ESIMD] Separate ieee sqrt/div functions from ext_math.cpp test #1398

Merged
merged 2 commits into from
Nov 29, 2022
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
18 changes: 9 additions & 9 deletions SYCL/ESIMD/ext_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
// - math function - sin, cos, ..., div_ieee, pow
// - SYCL vs ESIMD APIs

// Temporarily disable while the failure is being investigated.
// UNSUPPORTED: windows

#include "esimd_test_utils.hpp"

#include <sycl/builtins_esimd.hpp>
Expand Down Expand Up @@ -468,6 +465,14 @@ int main(void) {
std::cout << "Running on " << Dev.get_info<sycl::info::device::name>()
<< "\n";
bool Pass = true;
#ifdef TEST_IEEE_DIV_REM
Pass &= testESIMDSqrtIEEE<float, 16>(Q);
Pass &= testESIMDDivIEEE<float, 8>(Q);
if (Dev.has(sycl::aspect::fp64)) {
Pass &= testESIMDSqrtIEEE<double, 32>(Q);
Pass &= testESIMDDivIEEE<double, 32>(Q);
}
#else // !TEST_IEEE_DIV_REM
Pass &= testESIMD<half, 8>(Q);
Pass &= testESIMD<float, 16>(Q);
Pass &= testESIMD<float, 32>(Q);
Expand All @@ -476,14 +481,9 @@ int main(void) {
Pass &= testSYCL<float, 8>(Q);
Pass &= testSYCL<float, 32>(Q);
}
Pass &= testESIMDSqrtIEEE<float, 16>(Q);
if (Dev.has(sycl::aspect::fp64)) {
Pass &= testESIMDSqrtIEEE<double, 32>(Q);
Pass &= testESIMDDivIEEE<double, 32>(Q);
}
Pass &= testESIMDDivIEEE<float, 8>(Q);
Pass &= testESIMDPow<float, 8>(Q);
Pass &= testESIMDPow<half, 32>(Q);
#endif // !TEST_IEEE_DIV_REM
std::cout << (Pass ? "Test Passed\n" : "Test FAILED\n");
return Pass ? 0 : 1;
}
16 changes: 16 additions & 0 deletions SYCL/ESIMD/ext_math_ieee_sqrt_div.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//==-- ext_math_ieee_qsrt_div.cpp - DPC++ ESIMD ieee sqrt/div test -------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// REQUIRES: gpu-intel-gen9 || gpu-intel-dg2 || gpu-intel-pvc || esimd_emulator

// RUN: %clangxx -fsycl-device-code-split=per_kernel -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

// This test checks ieee_sqrt() and ieee_sqrt() with float and double types.

#define TEST_IEEE_DIV_REM 1
#include "ext_math.cpp"