Skip to content

Commit 3e75635

Browse files
committed
Merge commit '12ece03' into sycl-web
2 parents 1590769 + 12ece03 commit 3e75635

File tree

136 files changed

+5956
-857
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+5956
-857
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ sycl/doc/extensions/ @intel/dpcpp-specification-reviewers
3636

3737
# Unified Runtime
3838
sycl/cmake/modules/FetchUnifiedRuntime.cmake @intel/unified-runtime-reviewers
39+
sycl/cmake/modules/UnifiedRuntimeTag.cmake @intel/unified-runtime-reviewers
3940
sycl/include/sycl/detail/ur.hpp @intel/unified-runtime-reviewers
4041
sycl/source/detail/posix_ur.cpp @intel/unified-runtime-reviewers
4142
sycl/source/detail/ur.cpp @intel/unified-runtime-reviewers

buildbot/configure.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def do_configure(args):
6464

6565
sycl_enable_xpti_tracing = "ON"
6666
xpti_enable_werror = "OFF"
67+
llvm_enable_zstd = "OFF"
6768

6869
if sys.platform != "darwin":
6970
sycl_enabled_backends.append("level_zero")
@@ -133,6 +134,8 @@ def do_configure(args):
133134

134135
# For clang-format, clang-tidy and code coverage
135136
llvm_enable_projects += ";clang-tools-extra;compiler-rt"
137+
# Build with zstd enabled on CI.
138+
llvm_enable_zstd = "ON"
136139
if sys.platform != "darwin":
137140
# libclc is required for CI validation
138141
libclc_enabled = True
@@ -177,6 +180,8 @@ def do_configure(args):
177180
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
178181
"-DSYCL_BUILD_PI_HIP_PLATFORM={}".format(sycl_build_pi_hip_platform),
179182
"-DLLVM_BUILD_TOOLS=ON",
183+
"-DLLVM_ENABLE_ZSTD={}".format(llvm_enable_zstd),
184+
"-DLLVM_USE_STATIC_ZSTD=ON",
180185
"-DSYCL_ENABLE_WERROR={}".format(sycl_werror),
181186
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
182187
"-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests.

clang/include/clang/Basic/Attr.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,12 +1571,12 @@ def SYCLType: InheritableAttr {
15711571
let Subjects = SubjectList<[CXXRecord, Enum], ErrorDiag>;
15721572
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
15731573
let Args = [EnumArgument<"Type", "SYCLType", /*is_string=*/true,
1574-
["accessor", "local_accessor",
1574+
["accessor", "local_accessor", "work_group_memory",
15751575
"specialization_id", "kernel_handler", "buffer_location",
15761576
"no_alias", "accessor_property_list", "group",
15771577
"private_memory", "aspect", "annotated_ptr", "annotated_arg",
15781578
"stream", "sampler", "host_pipe", "multi_ptr"],
1579-
["accessor", "local_accessor",
1579+
["accessor", "local_accessor", "work_group_memory",
15801580
"specialization_id", "kernel_handler", "buffer_location",
15811581
"no_alias", "accessor_property_list", "group",
15821582
"private_memory", "aspect", "annotated_ptr", "annotated_arg",

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4675,10 +4675,14 @@ def image__base : Separate<["-"], "image_base">;
46754675
def include_ : JoinedOrSeparate<["-", "--"], "include">, Group<clang_i_Group>, EnumName<"include">,
46764676
MetaVarName<"<file>">, HelpText<"Include file before parsing">,
46774677
Visibility<[ClangOption, CC1Option]>;
4678-
def include_footer : Separate<["-"], "include-footer">, Group<clang_i_Group>,
4678+
def include_internal_footer : Separate<["-"], "include-internal-footer">, Group<clang_i_Group>,
46794679
Visibility<[CC1Option]>,
46804680
HelpText<"Name of the footer integration file">, MetaVarName<"<file>">,
46814681
MarshallingInfoString<PreprocessorOpts<"IncludeFooter">>;
4682+
def include_internal_header : Separate<["-"], "include-internal-header">, Group<clang_i_Group>,
4683+
Visibility<[CC1Option]>,
4684+
HelpText<"Name of the header integration file">, MetaVarName<"<file>">,
4685+
MarshallingInfoString<PreprocessorOpts<"IncludeHeader">>;
46824686
def include_pch : Separate<["-"], "include-pch">, Group<clang_i_Group>,
46834687
Visibility<[ClangOption, CC1Option]>,
46844688
HelpText<"Include precompiled header file">, MetaVarName<"<file>">,

clang/include/clang/Lex/PreprocessorOptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class PreprocessorOptions {
6868
std::vector<std::pair<std::string, bool/*isUndef*/>> Macros;
6969
std::vector<std::string> Includes;
7070
std::string IncludeFooter;
71+
std::string IncludeHeader;
7172
std::vector<std::string> MacroIncludes;
7273

7374
/// Perform extra checks when loading PCM files for mutable file systems.

clang/include/clang/Sema/SemaSYCL.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class SYCLIntegrationHeader {
6262
kind_pointer,
6363
kind_specialization_constants_buffer,
6464
kind_stream,
65-
kind_last = kind_stream
65+
kind_work_group_memory,
66+
kind_last = kind_work_group_memory
6667
};
6768

6869
public:

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5749,7 +5749,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
57495749
// action to determine this.
57505750
if (types::getPreprocessedType(Input.getType()) != types::TY_INVALID &&
57515751
!Header.empty()) {
5752-
CmdArgs.push_back("-include");
5752+
// Add the -include-internal-header option to add the integration header
5753+
CmdArgs.push_back("-include-internal-header");
57535754
CmdArgs.push_back(Args.MakeArgString(Header));
57545755
// When creating dependency information, filter out the generated
57555756
// header file.
@@ -5761,11 +5762,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
57615762
CmdArgs.push_back("-fsycl-enable-int-header-diags");
57625763
}
57635764

5764-
// Add the -include-footer option to add the integration footer
57655765
StringRef Footer = D.getIntegrationFooter(Input.getBaseInput());
57665766
if (types::getPreprocessedType(Input.getType()) != types::TY_INVALID &&
57675767
!Args.hasArg(options::OPT_fno_sycl_use_footer) && !Footer.empty()) {
5768-
CmdArgs.push_back("-include-footer");
5768+
// Add the -include-internal-footer option to add the integration footer
5769+
CmdArgs.push_back("-include-internal-footer");
57695770
CmdArgs.push_back(Args.MakeArgString(Footer));
57705771
// When creating dependency information, filter out the generated
57715772
// integration footer file.
@@ -10166,6 +10167,19 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1016610167
SmallString<128> TargetTripleOpt = TT.getArchName();
1016710168
bool WrapFPGADevice = false;
1016810169
bool FPGAEarly = false;
10170+
10171+
// Validate and propogate CLI options related to device image compression.
10172+
// -offload-compress
10173+
if (C.getInputArgs().getLastArg(options::OPT_offload_compress)) {
10174+
WrapperArgs.push_back(
10175+
C.getArgs().MakeArgString(Twine("-offload-compress")));
10176+
// -offload-compression-level=<>
10177+
if (Arg *A = C.getInputArgs().getLastArg(
10178+
options::OPT_offload_compression_level_EQ))
10179+
WrapperArgs.push_back(C.getArgs().MakeArgString(
10180+
Twine("-offload-compression-level=") + A->getValue()));
10181+
}
10182+
1016910183
if (Arg *A = C.getInputArgs().getLastArg(options::OPT_fsycl_link_EQ)) {
1017010184
WrapFPGADevice = true;
1017110185
FPGAEarly = (A->getValue() == StringRef("early"));

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,13 @@ void clang::InitializePreprocessor(Preprocessor &PP,
16631663
AddImplicitInclude(Builder, Path);
16641664
}
16651665

1666+
// Process -include-internal-header directive.
1667+
if (!LangOpts.SYCLIsDevice) {
1668+
if (!InitOpts.IncludeHeader.empty()) {
1669+
AddImplicitInclude(Builder, InitOpts.IncludeHeader);
1670+
}
1671+
}
1672+
16661673
// Instruct the preprocessor to skip the preamble.
16671674
PP.setSkipMainFilePreamble(InitOpts.PrecompiledPreambleBytes.first,
16681675
InitOpts.PrecompiledPreambleBytes.second);

clang/lib/Frontend/PrintPreprocessedOutput.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,24 @@ void PrintPPOutputPPCallbacks::WriteFooterContent(StringRef CodeFooter) {
265265
*OS << '\n';
266266
}
267267

268+
static bool is_separator(char value) { return value == '\\'; }
269+
268270
void PrintPPOutputPPCallbacks::WriteLineInfo(unsigned LineNo,
269271
const char *Extra,
270272
unsigned ExtraLen) {
271273
startNewLineIfNeeded();
272274

275+
if (PP.getLangOpts().isSYCL()) {
276+
StringRef CurFilenameWithNoLeadingDotSlash =
277+
llvm::sys::path::remove_leading_dotbackslash_only(CurFilename.str());
278+
if ((CurFilenameWithNoLeadingDotSlash ==
279+
PP.getPreprocessorOpts().IncludeFooter) ||
280+
CurFilenameWithNoLeadingDotSlash ==
281+
PP.getPreprocessorOpts().IncludeHeader) {
282+
CurFilename = "<uninit>";
283+
}
284+
}
285+
273286
// Emit #line directives or GNU line markers depending on what mode we're in.
274287
if (UseLineDirectives) {
275288
*OS << "#line" << ' ' << LineNo << ' ' << '"';
@@ -288,6 +301,7 @@ void PrintPPOutputPPCallbacks::WriteLineInfo(unsigned LineNo,
288301
else if (FileType == SrcMgr::C_ExternCSystem)
289302
OS->write(" 3 4", 4);
290303
}
304+
291305
*OS << '\n';
292306
}
293307

@@ -913,8 +927,6 @@ static void PrintIncludeFooter(Preprocessor &PP, SourceLocation Loc,
913927
return;
914928
FileID FooterFileID = SourceMgr.ComputeValidFooterFileID(Footer);
915929
StringRef FooterContentBuffer = SourceMgr.getBufferData(FooterFileID);
916-
// print out the name of the integration footer.
917-
Callbacks->WriteFooterInfo(Footer);
918930
SmallVector<StringRef, 8> FooterContentArr;
919931
FooterContentBuffer.split(FooterContentArr, '\r');
920932
// print out the content of the integration footer.
@@ -1185,15 +1197,6 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP, raw_ostream *OS,
11851197
PrintPreprocessedTokens(PP, Tok, Callbacks);
11861198
*OS << '\n';
11871199

1188-
if (!PP.getPreprocessorOpts().IncludeFooter.empty() &&
1189-
!PP.IncludeFooterProcessed) {
1190-
assert(PP.getLangOpts().SYCLIsHost &&
1191-
"The 'include-footer' is expected in host compilation only");
1192-
SourceLocation Loc = Tok.getLocation();
1193-
PrintIncludeFooter(PP, Loc, PP.getPreprocessorOpts().IncludeFooter,
1194-
Callbacks);
1195-
}
1196-
11971200
// Remove the handlers we just added to leave the preprocessor in a sane state
11981201
// so that it can be reused (for example by a clang::Parser instance).
11991202
PP.RemovePragmaHandler(MicrosoftExtHandler.get());

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4693,6 +4693,9 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
46934693
CurOffset + offsetOf(FD, FieldTy));
46944694
} else if (SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::stream)) {
46954695
addParam(FD, FieldTy, SYCLIntegrationHeader::kind_stream);
4696+
} else if (SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::work_group_memory)) {
4697+
addParam(FieldTy, SYCLIntegrationHeader::kind_work_group_memory,
4698+
offsetOf(FD, FieldTy));
46964699
} else if (SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::sampler) ||
46974700
SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::annotated_ptr) ||
46984701
SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::annotated_arg)) {
@@ -5773,6 +5776,7 @@ static const char *paramKind2Str(KernelParamKind K) {
57735776
CASE(stream);
57745777
CASE(specialization_constants_buffer);
57755778
CASE(pointer);
5779+
CASE(work_group_memory);
57765780
}
57775781
return "<ERROR>";
57785782

0 commit comments

Comments
 (0)