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

[SYCL][libdevice] Test libdevice jit-link mode. #1055

Merged
merged 3 commits into from
Jun 16, 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
5 changes: 5 additions & 0 deletions SYCL/DeviceLib/cmath_fp64_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include "math_utils.hpp"
#include <CL/sycl.hpp>
#include <cmath>
Expand Down
5 changes: 5 additions & 0 deletions SYCL/DeviceLib/cmath_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

// RUN: %clangxx -fsycl -fno-builtin -fsycl-device-lib-jit-link %s -o %t.out

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please clarify why some of the tests have -fno-builtin flag and some of them don't? Is this a workaround for something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @againull
To some math functions, clang may have different ways to handle.

  1. convert it to a library function call
  2. instruction expand, use several IR instructions to replace
    The tests aim to test implementations in SYCL device library, we need to guarantee all functions to test are converted to corresponding library function call, so adding "-fno-builtin" to force to achieve it.

Thanks very much.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @againull
Ping~

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation!

// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include "math_utils.hpp"
#include <CL/sycl.hpp>
#include <cmath>
Expand Down
5 changes: 5 additions & 0 deletions SYCL/DeviceLib/math_fp64_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include "math_utils.hpp"
#include <CL/sycl.hpp>
#include <cstdint>
Expand Down
5 changes: 5 additions & 0 deletions SYCL/DeviceLib/math_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include "math_utils.hpp"
#include <CL/sycl.hpp>
#include <cstdint>
Expand Down
5 changes: 5 additions & 0 deletions SYCL/DeviceLib/std_complex_math_fp64_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include <CL/sycl.hpp>
#include <array>
#include <cassert>
Expand Down
5 changes: 5 additions & 0 deletions SYCL/DeviceLib/std_complex_math_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include <CL/sycl.hpp>
#include <array>
#include <cassert>
Expand Down
5 changes: 5 additions & 0 deletions SYCL/DeviceLib/string_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

// RUN: %clangxx -fsycl -fno-builtin -fsycl-device-lib-jit-link %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include <CL/sycl.hpp>
#include <cassert>
#include <cstdint>
Expand Down