Skip to content

Commit c107c05

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (intel#33)
2 parents cee7f3b + f90614c commit c107c05

File tree

240 files changed

+6946
-2055
lines changed

Some content is hidden

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

240 files changed

+6946
-2055
lines changed

buildbot/dependency.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ ocl_cpu_rt_ver=2020.11.8.0.27
44
# https://github.com/intel/llvm/releases/download/2020-WW36/win-oclcpuexp-2020.11.8.0.27_rel.zip
55
ocl_cpu_rt_ver_win=2020.11.8.0.27
66
# Same GPU driver supports Level Zero and OpenCL:
7-
# https://github.com/intel/compute-runtime/releases/tag/20.29.17408
8-
ocl_gpu_rt_ver=20.29.17408
7+
# https://github.com/intel/compute-runtime/releases/tag/20.35.17767
8+
ocl_gpu_rt_ver=20.35.17767
99
# Same GPU driver supports Level Zero and OpenCL:
10-
# https://downloadmirror.intel.com/29674/a08/igfx_win10_100.8336.zip
11-
ocl_gpu_rt_ver_win=27.20.100.8336
10+
# https://downloadmirror.intel.com/29817/a08/igfx_win10_100.8673.zip
11+
ocl_gpu_rt_ver_win=27.20.100.8673
1212
intel_sycl_ver=build
1313
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.1-beta08/oneapi-tbb-2021.1-beta08-lin.tgz
1414
tbb_ver=2021.1.9.636
@@ -24,8 +24,8 @@ fpga_ver_win=20200811_000006
2424
[DRIVER VERSIONS]
2525
cpu_driver_lin=2020.11.8.0.27
2626
cpu_driver_win=2020.11.8.0.27
27-
gpu_driver_lin=20.29.17408
28-
gpu_driver_win=27.20.100.8336
27+
gpu_driver_lin=20.35.17767
28+
gpu_driver_win=27.20.100.8673
2929
fpga_driver_lin=2020.11.8.0.27
3030
fpga_driver_win=2020.11.8.0.27
3131
# NVidia CUDA driver

clang/include/clang/Basic/Attr.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,6 @@ def LoopUnrollHint : InheritableAttr {
12991299

13001300
def IntelReqdSubGroupSize: InheritableAttr {
13011301
let Spellings = [GNU<"intel_reqd_sub_group_size">,
1302-
CXX11<"cl", "intel_reqd_sub_group_size">,
13031302
CXX11<"intel", "reqd_sub_group_size">];
13041303
let Args = [ExprArgument<"SubGroupSize">];
13051304
let Subjects = SubjectList<[Function, CXXMethod], ErrorDiag>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,30 +3476,16 @@ code. See `cl_intel_required_subgroup_size
34763476
for details.
34773477

34783478
SYCL documentation:
3479-
The [[cl::intel_reqd_sub_group_size(n)]] and [[intel::reqd_sub_group_size(n)]]
3480-
attribute indicates that the kernel must be compiled and executed with a
3481-
sub-group of size n. The value of n must be set to a sub-group size supported
3482-
by the device, or device compilation will fail.
3479+
The [[intel::reqd_sub_group_size(n)]] attribute indicates that the kernel must
3480+
be compiled and executed with a sub-group of size n. The value of n must be set
3481+
to a sub-group size supported by the device, or device compilation will fail.
34833482

34843483
In addition to device functions, the required sub-group size attribute may also
34853484
be specified in the definition of a named functor object and lambda functions,
34863485
as in the examples below:
34873486

34883487
.. code-block:: c++
34893488

3490-
class Functor
3491-
{
3492-
void operator()(item<1> item) [[cl::intel_reqd_sub_group_size(16)]]
3493-
{
3494-
/* kernel code */
3495-
}
3496-
}
3497-
3498-
kernel<class kernel_name>(
3499-
[]() [[cl::intel_reqd_sub_group_size(n)]] {
3500-
/* kernel code */
3501-
});
3502-
35033489
class Functor
35043490
{
35053491
[[intel::reqd_sub_group_size(16)]] void operator()(item<1> item)

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11002,11 +11002,9 @@ def err_sycl_restrict : Error<
1100211002
"|use a const static or global variable that is neither zero-initialized "
1100311003
"nor constant-initialized"
1100411004
"}0">;
11005-
def warn_sycl_kernel_too_many_args : Warning<
11006-
"kernel argument count (%0) exceeds supported maximum of %1 on GPU">,
11007-
InGroup<SyclStrict>;
11008-
def note_sycl_kernel_args_count : Note<"array elements and fields of a "
11009-
"class/struct may be counted separately">;
11005+
def warn_sycl_kernel_too_big_args : Warning<
11006+
"size of kernel arguments (%0 bytes) exceeds supported maximum of %1 bytes "
11007+
"on GPU">, InGroup<SyclStrict>;
1101011008
def err_sycl_virtual_types : Error<
1101111009
"No class with a vtable can be used in a SYCL kernel or any code included in the kernel">;
1101211010
def note_sycl_recursive_function_declared_here: Note<"function implemented using recursion declared here">;
@@ -11073,11 +11071,6 @@ def err_ivdep_declrefexpr_arg : Error<
1107311071
def warn_ivdep_redundant : Warning <"ignoring redundant Intel FPGA loop "
1107411072
"attribute 'ivdep': safelen %select{INF|%1}0 >= safelen %select{INF|%3}2">,
1107511073
InGroup<IgnoredAttributes>;
11076-
def warn_attribute_spelling_deprecated : Warning<
11077-
"attribute %0 is deprecated">,
11078-
InGroup<DeprecatedAttributes>;
11079-
def note_spelling_suggestion : Note<
11080-
"did you mean to use %0 instead?">;
1108111074

1108211075
// errors of expect.with.probability
1108311076
def err_probability_not_constant_float : Error<

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6119,8 +6119,9 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
61196119
}
61206120

61216121
// For /P, preprocess to file named after BaseInput.
6122-
if (C.getArgs().hasArg(options::OPT__SLASH_P)) {
6123-
assert(AtTopLevel && isa<PreprocessJobAction>(JA));
6122+
if (C.getArgs().hasArg(options::OPT__SLASH_P) &&
6123+
((AtTopLevel && isa<PreprocessJobAction>(JA)) ||
6124+
isa<OffloadBundlingJobAction>(JA))) {
61246125
StringRef BaseName = llvm::sys::path::filename(BaseInput);
61256126
StringRef NameArg;
61266127
if (Arg *A = C.getArgs().getLastArg(options::OPT__SLASH_Fi))

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4201,8 +4201,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
42014201
SYCLStdArg->render(Args, CmdArgs);
42024202
CmdArgs.push_back("-fsycl-std-layout-kernel-params");
42034203
} else {
4204-
// Ensure the default version in SYCL mode is 1.2.1 (aka 2017)
4205-
CmdArgs.push_back("-sycl-std=2017");
4204+
// Ensure the default version in SYCL mode is 2020
4205+
CmdArgs.push_back("-sycl-std=2020");
42064206
}
42074207
}
42084208

@@ -5996,10 +5996,17 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
59965996
options::OPT_fno_gnu_inline_asm, true))
59975997
CmdArgs.push_back("-fno-gnu-inline-asm");
59985998

5999+
bool EnableSYCLEarlyOptimizations =
6000+
Args.hasFlag(options::OPT_fsycl_early_optimizations,
6001+
options::OPT_fno_sycl_early_optimizations,
6002+
Triple.getSubArch() != llvm::Triple::SPIRSubArch_fpga);
6003+
59996004
// Enable vectorization per default according to the optimization level
60006005
// selected. For optimization levels that want vectorization we use the alias
60016006
// option to simplify the hasFlag logic.
60026007
bool EnableVec = shouldEnableVectorizerAtOLevel(Args, false);
6008+
if (UseSYCLTriple && EnableSYCLEarlyOptimizations)
6009+
EnableVec = false; // But disable vectorization for SYCL device code
60036010
OptSpecifier VectorizeAliasOption =
60046011
EnableVec ? options::OPT_O_Group : options::OPT_fvectorize;
60056012
if (Args.hasFlag(options::OPT_fvectorize, VectorizeAliasOption,
@@ -6008,6 +6015,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
60086015

60096016
// -fslp-vectorize is enabled based on the optimization level selected.
60106017
bool EnableSLPVec = shouldEnableVectorizerAtOLevel(Args, true);
6018+
if (UseSYCLTriple && EnableSYCLEarlyOptimizations)
6019+
EnableSLPVec = false; // But disable vectorization for SYCL device code
60116020
OptSpecifier SLPVectAliasOption =
60126021
EnableSLPVec ? options::OPT_O_Group : options::OPT_fslp_vectorize;
60136022
if (Args.hasFlag(options::OPT_fslp_vectorize, SLPVectAliasOption,
@@ -7710,6 +7719,7 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
77107719
TranslatorArgs.push_back(Output.getFilename());
77117720
if (getToolChain().getTriple().isSYCLDeviceEnvironment()) {
77127721
TranslatorArgs.push_back("-spirv-max-version=1.1");
7722+
TranslatorArgs.push_back("-spirv-debug-info-version=legacy");
77137723
if (C.getArgs().hasArg(options::OPT_fsycl_esimd))
77147724
TranslatorArgs.push_back("-spirv-allow-unknown-intrinsics");
77157725

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const char *SYCL::Linker::constructLLVMSpirvCommand(Compilation &C,
4242
} else {
4343
CmdArgs.push_back("-spirv-max-version=1.1");
4444
CmdArgs.push_back("-spirv-ext=+all");
45+
CmdArgs.push_back("-spirv-debug-info-version=legacy");
4546
if (C.getArgs().hasArg(options::OPT_fsycl_esimd))
4647
CmdArgs.push_back("-spirv-allow-unknown-intrinsics");
4748
CmdArgs.push_back("-o");
@@ -204,6 +205,13 @@ void SYCL::Linker::ConstructJob(Compilation &C, const JobAction &JA,
204205
SpirvInputs);
205206
}
206207

208+
static const char *makeExeName(Compilation &C, StringRef Name) {
209+
llvm::SmallString<8> ExeName(Name);
210+
if (C.getDriver().IsCLMode())
211+
ExeName.append(".exe");
212+
return C.getArgs().MakeArgString(ExeName);
213+
}
214+
207215
void SYCL::fpga::BackendCompiler::ConstructJob(Compilation &C,
208216
const JobAction &JA,
209217
const InputInfo &Output,
@@ -312,7 +320,8 @@ void SYCL::fpga::BackendCompiler::ConstructJob(Compilation &C,
312320
CmdArgs.push_back(Args.MakeArgString(A->getAsString(Args)));
313321
}
314322

315-
SmallString<128> ExecPath(getToolChain().GetProgramPath("aoc"));
323+
SmallString<128> ExecPath(
324+
getToolChain().GetProgramPath(makeExeName(C, "aoc")));
316325
const char *Exec = C.getArgs().MakeArgString(ExecPath);
317326
auto Cmd = std::make_unique<Command>(
318327
JA, *this, ResponseFileSupport::None(), Exec, CmdArgs, None);
@@ -349,7 +358,8 @@ void SYCL::gen::BackendCompiler::ConstructJob(Compilation &C,
349358
static_cast<const toolchains::SYCLToolChain &>(getToolChain());
350359
TC.TranslateBackendTargetArgs(Args, CmdArgs);
351360
TC.TranslateLinkerTargetArgs(Args, CmdArgs);
352-
SmallString<128> ExecPath(getToolChain().GetProgramPath("ocloc"));
361+
SmallString<128> ExecPath(
362+
getToolChain().GetProgramPath(makeExeName(C, "ocloc")));
353363
const char *Exec = C.getArgs().MakeArgString(ExecPath);
354364
auto Cmd = std::make_unique<Command>(
355365
JA, *this, ResponseFileSupport::None(), Exec, CmdArgs, None);
@@ -382,7 +392,8 @@ void SYCL::x86_64::BackendCompiler::ConstructJob(Compilation &C,
382392

383393
TC.TranslateBackendTargetArgs(Args, CmdArgs);
384394
TC.TranslateLinkerTargetArgs(Args, CmdArgs);
385-
SmallString<128> ExecPath(getToolChain().GetProgramPath("opencl-aot"));
395+
SmallString<128> ExecPath(
396+
getToolChain().GetProgramPath(makeExeName(C, "opencl-aot")));
386397
const char *Exec = C.getArgs().MakeArgString(ExecPath);
387398
auto Cmd = std::make_unique<Command>(
388399
JA, *this, ResponseFileSupport::None(), Exec, CmdArgs, None);

clang/lib/Sema/SemaDecl.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,22 @@ static void adjustDeclContextForDeclaratorDecl(DeclaratorDecl *NewD,
32123212
FixSemaDC(VD->getDescribedVarTemplate());
32133213
}
32143214

3215+
template <typename AttributeType>
3216+
static void checkDimensionsAndSetDiagnostics(Sema &S, FunctionDecl *New,
3217+
FunctionDecl *Old) {
3218+
AttributeType *NewDeclAttr = New->getAttr<AttributeType>();
3219+
AttributeType *OldDeclAttr = Old->getAttr<AttributeType>();
3220+
if ((NewDeclAttr->getXDim() != OldDeclAttr->getXDim()) ||
3221+
(NewDeclAttr->getYDim() != OldDeclAttr->getYDim()) ||
3222+
(NewDeclAttr->getZDim() != OldDeclAttr->getZDim())) {
3223+
S.Diag(New->getLocation(), diag::err_conflicting_sycl_function_attributes)
3224+
<< OldDeclAttr << NewDeclAttr;
3225+
S.Diag(New->getLocation(), diag::warn_duplicate_attribute) << OldDeclAttr;
3226+
S.Diag(OldDeclAttr->getLocation(), diag::note_conflicting_attribute);
3227+
S.Diag(NewDeclAttr->getLocation(), diag::note_conflicting_attribute);
3228+
}
3229+
}
3230+
32153231
/// MergeFunctionDecl - We just parsed a function 'New' from
32163232
/// declarator D which has the same name and scope as a previous
32173233
/// declaration 'Old'. Figure out how to resolve this situation,
@@ -3286,6 +3302,15 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD,
32863302
}
32873303
}
32883304

3305+
if (New->hasAttr<ReqdWorkGroupSizeAttr>() &&
3306+
Old->hasAttr<ReqdWorkGroupSizeAttr>())
3307+
checkDimensionsAndSetDiagnostics<ReqdWorkGroupSizeAttr>(*this, New, Old);
3308+
3309+
if (New->hasAttr<SYCLIntelMaxWorkGroupSizeAttr>() &&
3310+
Old->hasAttr<SYCLIntelMaxWorkGroupSizeAttr>())
3311+
checkDimensionsAndSetDiagnostics<SYCLIntelMaxWorkGroupSizeAttr>(*this, New,
3312+
Old);
3313+
32893314
if (New->hasAttr<InternalLinkageAttr>() &&
32903315
!Old->hasAttr<InternalLinkageAttr>()) {
32913316
Diag(New->getLocation(), diag::err_internal_linkage_redeclaration)

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,13 +3013,6 @@ static void handleSubGroupSize(Sema &S, Decl *D, const ParsedAttr &AL) {
30133013
if (D->getAttr<IntelReqdSubGroupSizeAttr>())
30143014
S.Diag(AL.getLoc(), diag::warn_duplicate_attribute) << AL;
30153015

3016-
if (AL.getAttributeSpellingListIndex() ==
3017-
IntelReqdSubGroupSizeAttr::CXX11_cl_intel_reqd_sub_group_size) {
3018-
S.Diag(AL.getLoc(), diag::warn_attribute_spelling_deprecated) << AL;
3019-
S.Diag(AL.getLoc(), diag::note_spelling_suggestion)
3020-
<< "'intel::reqd_sub_group_size'";
3021-
}
3022-
30233016
S.addIntelReqdSubGroupSizeAttr(D, AL, E);
30243017
}
30253018

0 commit comments

Comments
 (0)