forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Add -fpreview-breaking-changes option (intel#11629)
This commit adds the -fpreview-breaking-changes option to supersede the SYCL2020_CONFORMANT_APIS preprocessor macro. This new option allows the SYCL library to also make breaking changes outside a SYCL major release by guarding breaking changes behind the __INTEL_PREVIEW_BREAKING_CHANGES macro. When -fpreview-breaking-changes is used together with -fsycl the compiled program is linked against a variant of the SYCL library with the __INTEL_PREVIEW_BREAKING_CHANGES macro defined. --------- Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
- Loading branch information
1 parent
7b94ac1
commit 08febcf
Showing
19 changed files
with
213 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//==----- preview_marker.cpp --- Preview library marker symbol -------------==// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <sycl/detail/export.hpp> | ||
|
||
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES | ||
namespace sycl { | ||
inline namespace _V1 { | ||
namespace detail { | ||
|
||
// Exported marker function to help verify that the preview library correctly | ||
// defines the __INTEL_PREVIEW_BREAKING_CHANGES macro and is linked with when | ||
// the -fpreview-breaking-changes option is used. | ||
__SYCL_EXPORT void PreviewMajorReleaseMarker() {} | ||
|
||
} // namespace detail | ||
} // namespace _V1 | ||
} // namespace sycl | ||
#endif // __INTEL_PREVIEW_BREAKING_CHANGES |
22 changes: 22 additions & 0 deletions
22
sycl/test-e2e/PreviewBreakingChanges/preview_lib_marker.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// REQUIRES: preview-breaking-changes-supported | ||
|
||
// RUN: %clangxx -fsycl -fpreview-breaking-changes %s -o %t | ||
// RUN: %{run} %t.out | ||
|
||
// Test to help identify that E2E testing correctly detects and uses the preview | ||
// library. | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
namespace sycl { | ||
inline namespace _V1 { | ||
namespace detail { | ||
extern void PreviewMajorReleaseMarker(); | ||
} // namespace detail | ||
} // namespace _V1 | ||
} // namespace sycl | ||
|
||
int main() { | ||
sycl::detail::PreviewMajorReleaseMarker(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// DEFINE: %{checkprefix} = %if windows %{CHECK-NO-PREVIEW-WINDOWS%} %else %{CHECK-NO-PREVIEW-LINUX%} | ||
// RUN: not %clangxx -fsycl %s -o %t 2>&1 | FileCheck --check-prefix=%{checkprefix} %s | ||
// RUN: %clangxx -fsycl -fpreview-breaking-changes %s -o %t | ||
// REQUIRES: preview-breaking-changes-supported | ||
|
||
// Checks that the preview-breaking-changes marker is present only when the | ||
// -fpreview-breaking-changes option is used. This implies two things: | ||
// 1. The driver links against the right library, i.e. sycl-preview. | ||
// 2. The sycl-preview library has the __INTEL_PREVIEW_BREAKING_CHANGES macro | ||
// defined. | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
namespace sycl { | ||
inline namespace _V1 { | ||
namespace detail { | ||
extern void PreviewMajorReleaseMarker(); | ||
} // namespace detail | ||
} // namespace _V1 | ||
} // namespace sycl | ||
|
||
int main() { | ||
sycl::detail::PreviewMajorReleaseMarker(); | ||
return 0; | ||
} | ||
|
||
// CHECK-NO-PREVIEW-WINDOWS: unresolved external symbol "void __cdecl sycl::_V1::detail::PreviewMajorReleaseMarker(void)" | ||
// CHECK-NO-PREVIEW-LINUX: undefined reference to `sycl::_V1::detail::PreviewMajorReleaseMarker()' |
Oops, something went wrong.