Skip to content

[SYCL][NFC] Use default macro initialization where applicable #3979

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
Jun 24, 2021
Merged
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
6 changes: 3 additions & 3 deletions clang/lib/Frontend/InitPreprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001");

if (LangOpts.SYCLValueFitInMaxInt)
Builder.defineMacro("__SYCL_ID_QUERIES_FIT_IN_INT__", "1");
Builder.defineMacro("__SYCL_ID_QUERIES_FIT_IN_INT__");

// Set __SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__ macro for
// both host and device compilations if -fsycl-disable-range-rounding
Expand Down Expand Up @@ -1176,7 +1176,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
// Define a macro indicating that the source file is being compiled with a
// SYCL device compiler which doesn't produce host binary.
if (LangOpts.SYCLIsDevice) {
Builder.defineMacro("__SYCL_DEVICE_ONLY__", "1");
Builder.defineMacro("__SYCL_DEVICE_ONLY__");
Builder.defineMacro("SYCL_EXTERNAL", "__attribute__((sycl_device))");

const llvm::Triple &DeviceTriple = TI.getTriple();
Expand All @@ -1188,7 +1188,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("SYCL_USE_NATIVE_FP_ATOMICS");
}
if (LangOpts.SYCLUnnamedLambda)
Builder.defineMacro("__SYCL_UNNAMED_LAMBDA__", "1");
Builder.defineMacro("__SYCL_UNNAMED_LAMBDA__");

// OpenCL definitions.
if (LangOpts.OpenCL) {
Expand Down