Skip to content

[SYCL] Remove _CODELOC* macro from API #9847

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 3 commits into from
Jun 13, 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
5 changes: 0 additions & 5 deletions sycl/doc/PreprocessorMacros.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ This file describes macros that have effect on SYCL compiler and run-time.
the underlying pointer types return pointers without any additional qualifiers
so it's disabled by default.

- **DISABLE_SYCL_INSTRUMENTATION_METADATA**

This macro is used to disable passing of code location information to public
methods.

- **SYCL2020_DISABLE_DEPRECATION_WARNINGS**

Disables warnings coming from usage of SYCL 1.2.1 APIs, that are deprecated in
Expand Down
29 changes: 1 addition & 28 deletions sycl/include/sycl/detail/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#include <string>

// Default signature enables the passing of user code location information to
// public methods as a default argument. If the end-user wants to disable the
// code location information, they must compile the code with
// -DDISABLE_SYCL_INSTRUMENTATION_METADATA flag
// public methods as a default argument.
namespace sycl {
__SYCL_INLINE_VER_NAMESPACE(_V1) {
namespace detail {
Expand Down Expand Up @@ -96,31 +94,6 @@ struct code_location {
unsigned long MColumnNo;
};

// The C++ FE may instrument user calls with code location metadata.
// If it does then that will appear as an extra last argument.
// Having _TWO_ mid-param #ifdefs makes the functions very difficult to read.
// Here we simplify the &CodeLoc declaration to be _CODELOCPARAM(&CodeLoc) and
// _CODELOCARG(&CodeLoc).

#ifndef DISABLE_SYCL_INSTRUMENTATION_METADATA
#define _CODELOCONLYPARAM(a) \
const ::sycl::detail::code_location a = \
::sycl::detail::code_location::current()
#define _CODELOCPARAM(a) \
, const ::sycl::detail::code_location a = \
::sycl::detail::code_location::current()
#define _CODELOCPARAMDEF(a) , const ::sycl::detail::code_location a

#define _CODELOCARG(a)
#define _CODELOCFW(a) , a
#else
#define _CODELOCONLYPARAM(a)
#define _CODELOCPARAM(a)

#define _CODELOCARG(a) const ::sycl::detail::code_location a = {}
#define _CODELOCFW(a)
#endif

/// @brief Data type that manages the code_location information in TLS
/// @details As new SYCL features are added, they all enable the propagation of
/// the code location information where the SYCL API was called by the
Expand Down
Loading