Skip to content

[ESIMD] Fix compilation errors caused by type_name() function #9092

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 5 commits into from
Apr 18, 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
9 changes: 3 additions & 6 deletions sycl/test-e2e/ESIMD/dword_atomic_cmpxchg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//==---------------- dword_atomic_smoke.cpp - DPC++ ESIMD on-device test --==//
//==-------------- dword_atomic_cmpxchg.cpp - DPC++ ESIMD on-device test --==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -10,15 +10,12 @@
// REQUIRES: gpu
// UNSUPPORTED: gpu-intel-gen9 && windows
// UNSUPPORTED: cuda || hip
// TODO: Re-enable this test on Windows after the following issue gets fixed:
// https://github.com/intel/llvm/issues/8934
// UNSUPPORTED: windows
// TODO: esimd_emulator fails due to random timeouts (_XFAIL_: esimd_emulator)
// TODO: esimd_emulator fails due to random timeouts
// UNSUPPORTED: esimd_emulator
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

// This macro enables only cmpxch tests. They may require more time to execute,
// This macro enables only cmpxchg tests. They may require more time to execute,
// and have higher probablity to hit kernel execution time limit, so they are
// separated.
#define CMPXCHG_TEST
Expand Down
7 changes: 2 additions & 5 deletions sycl/test-e2e/ESIMD/dword_atomic_cmpxchg_scalar_off.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
// REQUIRES: gpu
// UNSUPPORTED: gpu-intel-gen9 && windows
// UNSUPPORTED: cuda || hip
// TODO: Re-enable this test on Windows after the following issue gets fixed:
// https://github.com/intel/llvm/issues/8934
// UNSUPPORTED: windows
// TODO: esimd_emulator fails due to random timeouts (_XFAIL_: esimd_emulator)
// TODO: esimd_emulator fails due to random timeouts
// UNSUPPORTED: esimd_emulator
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

// This macro enables only cmpxch tests. They may require more time to execute,
// This macro enables only cmpxchg tests. They may require more time to execute,
// and have higher probablity to hit kernel execution time limit, so they are
// separated.
#define CMPXCHG_TEST
Expand Down
4 changes: 1 addition & 3 deletions sycl/test-e2e/ESIMD/dword_atomic_smoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// REQUIRES: gpu
// UNSUPPORTED: gpu-intel-gen9 && windows
// UNSUPPORTED: cuda || hip
// TODO: Re-enable this test on Windows after the following issue gets fixed:
// https://github.com/intel/llvm/issues/8934
// UNSUPPORTED: windows

// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

Expand Down
3 changes: 0 additions & 3 deletions sycl/test-e2e/ESIMD/dword_atomic_smoke_scalar_off.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
// REQUIRES: gpu
// UNSUPPORTED: gpu-intel-gen9 && windows
// UNSUPPORTED: cuda || hip
// TODO: Re-enable this test on Windows after the following issue gets fixed:
// https://github.com/intel/llvm/issues/8934
// UNSUPPORTED: windows
// TODO: esimd_emulator fails due to random timeouts (_XFAIL_: esimd_emulator)
// UNSUPPORTED: esimd_emulator
// RUN: %clangxx -fsycl %s -o %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/esimd_test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ std::unique_ptr<T, USMDeleter> usm_malloc_shared(queue q, int n) {
return std::move(res);
}

template <class T> static const char *type_name();
template <class T> const char *type_name() { return typeid(T).name(); }
Copy link
Contributor

Choose a reason for hiding this comment

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

If the function is defined, then likely the warning will not be issued.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but that 'static' keyword did not seem to be needed for this template function

#define TID(T) \
template <> const char *type_name<T>() { return #T; }
TID(char) // for some reason, 'char' does not match 'int8_t' during
Expand Down