Skip to content

Commit 6e2f132

Browse files
committed
Merge from 'sycl' to 'sycl-web' (#3)
CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Clang.cpp
2 parents b39fa3f + 0de6d9a commit 6e2f132

File tree

163 files changed

+2993
-975
lines changed

Some content is hidden

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

163 files changed

+2993
-975
lines changed

buildbot/configure.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def do_configure(args):
2828
"-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir),
2929
"-DOpenCL_LIBRARY={}".format(icd_loader_lib),
3030
"-DLLVM_BUILD_TOOLS=OFF",
31+
"-DSYCL_ENABLE_WERROR=ON",
3132
llvm_dir]
3233

3334
print(cmake_cmd)

clang/include/clang/Basic/DiagnosticSemaKinds.td

+1
Original file line numberDiff line numberDiff line change
@@ -9894,6 +9894,7 @@ def err_sycl_restrict : Error<
98949894
"|allocate storage"
98959895
"|use inline assembly"
98969896
"|have a class with a virtual function table"
9897+
"|call a dllimport function"
98979898
"|call a variadic function}0">;
98989899
def err_sycl_virtual_types : Error<
98999900
"No class with a vtable can be used in a SYCL kernel or any code included in the kernel">;

clang/include/clang/Sema/Sema.h

+1
Original file line numberDiff line numberDiff line change
@@ -11472,6 +11472,7 @@ class Sema {
1147211472
KernelAllocateStorage,
1147311473
KernelUseAssembly,
1147411474
KernelHavePolymorphicClass,
11475+
KernelCallDllimportFunction,
1147511476
KernelCallVariadicFunction
1147611477
};
1147711478
DeviceDiagBuilder SYCLDiagIfDeviceCode(SourceLocation Loc, unsigned DiagID);

clang/lib/Basic/Targets/SPIR.h

-8
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ class LLVM_LIBRARY_VISIBILITY SPIR32SYCLDeviceTargetInfo
164164
// to parse host code. So we allow compilation of exception_ptr but
165165
// if exceptions are used in device code we should emit a diagnostic.
166166
MaxAtomicInlineWidth = 32;
167-
// This is workaround for mutex class.
168-
// I'm not sure about this hack but I guess that mutex_class is same
169-
// problem.
170-
TLSSupported = true;
171167
}
172168
};
173169

@@ -182,10 +178,6 @@ class LLVM_LIBRARY_VISIBILITY SPIR64SYCLDeviceTargetInfo
182178
// to parse host code. So we allow compilation of exception_ptr but
183179
// if exceptions are used in device code we should emit a diagnostic.
184180
MaxAtomicInlineWidth = 64;
185-
// This is workaround for mutex class.
186-
// I'm not sure about this hack but I guess that mutex_class is same
187-
// problem.
188-
TLSSupported = true;
189181
}
190182
};
191183

clang/lib/CodeGen/CGException.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() {
718718
}
719719

720720
// CUDA and SYCL device code doesn't have exceptions.
721-
if (LO.CUDA && LO.CUDAIsDevice || LO.SYCLIsDevice)
721+
if ((LO.CUDA && LO.CUDAIsDevice) || LO.SYCLIsDevice)
722722
return nullptr;
723723

724724
// Check the innermost scope for a cached landing pad. If this is

clang/lib/Driver/Driver.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,11 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
718718
//
719719
// We need to generate a SYCL toolchain if the user specified targets with
720720
// the -fsycl-targets, -fsycl-add-targets or -fsycl-link-targets option.
721-
// If -fsycl is supplied without any of these we will assume SPIR-V
722-
bool HasValidSYCLRuntime = C.getInputArgs().hasFlag(options::OPT_fsycl,
723-
options::OPT_fno_sycl, false);
721+
// If -fsycl is supplied without any of these we will assume SPIR-V.
722+
// Use of -fsycl-device-only overrides -fsycl.
723+
bool HasValidSYCLRuntime = (C.getInputArgs().hasFlag(options::OPT_fsycl,
724+
options::OPT_fno_sycl, false) &&
725+
!C.getInputArgs().hasArg(options::OPT_sycl_device_only));
724726

725727
Arg *SYCLTargets =
726728
C.getInputArgs().getLastArg(options::OPT_fsycl_targets_EQ);
@@ -3340,12 +3342,10 @@ class OffloadingActionBuilder final {
33403342
ActionList DeviceObjects;
33413343
for (const auto &I : LI) {
33423344
if (I->getType() == types::TY_Object) {
3343-
// FIXME - Checker does not work well inline with the tool
3344-
// chain, but it needs to be here for real time checking
3345-
// auto *DeviceCheckAction =
3346-
// C.MakeAction<SPIRCheckJobAction>(I, types::TY_Object);
3347-
// DeviceObjects.push_back(DeviceCheckAction);
3348-
DeviceObjects.push_back(I);
3345+
// Perform a check for SPIR kernel.
3346+
auto *DeviceCheckAction =
3347+
C.MakeAction<SPIRCheckJobAction>(I, types::TY_Object);
3348+
DeviceObjects.push_back(DeviceCheckAction);
33493349
} else {
33503350
// Do not perform a device link and only pass the aocr
33513351
// file to the offline compilation before wrapping. Just

clang/lib/Driver/ToolChains/Clang.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -6813,6 +6813,11 @@ void SPIRCheck::ConstructJob(Compilation &C, const JobAction &JA,
68136813
CheckArgs.push_back(I.getFilename());
68146814
}
68156815

6816+
// Add output file, which is just a copy of the input to better fit in the
6817+
// toolchain flow.
6818+
CheckArgs.push_back("-o");
6819+
CheckArgs.push_back(Output.getFilename());
6820+
68166821
C.addCommand(std::make_unique<Command>(JA, *this,
68176822
TCArgs.MakeArgString(getToolChain().GetProgramPath(getShortName())),
68186823
CheckArgs, None));

clang/lib/Sema/SemaDecl.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -6818,6 +6818,14 @@ NamedDecl *Sema::ActOnVariableDeclarator(
68186818
// proper storage class for other tools to use even if we're not going
68196819
// to emit any code for it.
68206820
NewVD->setTSCSpec(TSCS);
6821+
} else if (getLangOpts().SYCLIsDevice) {
6822+
// While SYCL does not support TLS, emitting the diagnostic here
6823+
// prevents the compilation of header files with TLS declarations.
6824+
// When TLS objects are used in kernel code, they are diagnosed.
6825+
// We still need to mark the variable as TLS so it shows up in AST with
6826+
// proper storage class for other tools to use even if we're not going
6827+
// to emit any code for it.
6828+
NewVD->setTSCSpec(TSCS);
68216829
} else
68226830
Diag(D.getDeclSpec().getThreadStorageClassSpecLoc(),
68236831
diag::err_thread_unsupported);

clang/lib/Sema/SemaDeclAttr.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -2066,7 +2066,10 @@ bool Sema::CheckAttrNoArgs(const ParsedAttr &Attrs) {
20662066

20672067
bool Sema::CheckAttrTarget(const ParsedAttr &AL) {
20682068
// Check whether the attribute is valid on the current target.
2069-
if (!AL.existsInTarget(Context.getTargetInfo())) {
2069+
const TargetInfo *Aux = Context.getAuxTargetInfo();
2070+
if (!(AL.existsInTarget(Context.getTargetInfo()) ||
2071+
(Context.getLangOpts().SYCLIsDevice &&
2072+
Aux && AL.existsInTarget(*Aux)))) {
20702073
Diag(AL.getLoc(), diag::warn_unknown_attribute_ignored) << AL;
20712074
AL.setInvalid();
20722075
return true;
@@ -7017,8 +7020,11 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
70177020
// Unknown attributes are automatically warned on. Target-specific attributes
70187021
// which do not apply to the current target architecture are treated as
70197022
// though they were unknown attributes.
7023+
const TargetInfo *Aux = S.Context.getAuxTargetInfo();
70207024
if (AL.getKind() == ParsedAttr::UnknownAttribute ||
7021-
!AL.existsInTarget(S.Context.getTargetInfo())) {
7025+
!(AL.existsInTarget(S.Context.getTargetInfo()) ||
7026+
(S.Context.getLangOpts().SYCLIsDevice &&
7027+
Aux && AL.existsInTarget(*Aux)))) {
70227028
S.Diag(AL.getLoc(),
70237029
AL.isDeclspecAttribute()
70247030
? (unsigned)diag::warn_unhandled_ms_attribute_ignored

clang/lib/Sema/SemaSYCL.cpp

+126-2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,106 @@ static CXXRecordDecl *getKernelObjectType(FunctionDecl *Caller) {
8383
return (*Caller->param_begin())->getType()->getAsCXXRecordDecl();
8484
}
8585

86+
// This information is from Section 4.13 of the SYCL spec
87+
// https://www.khronos.org/registry/SYCL/specs/sycl-1.2.1.pdf
88+
// This function returns false if the math lib function
89+
// corresponding to the input builtin is not supported
90+
// for SYCL
91+
static bool IsSyclMathFunc(unsigned BuiltinID) {
92+
switch (BuiltinID) {
93+
case Builtin::BIlround:
94+
case Builtin::BI__builtin_lround:
95+
case Builtin::BIceill:
96+
case Builtin::BI__builtin_ceill:
97+
case Builtin::BIcopysignl:
98+
case Builtin::BI__builtin_copysignl:
99+
case Builtin::BIcosl:
100+
case Builtin::BI__builtin_cosl:
101+
case Builtin::BIexpl:
102+
case Builtin::BI__builtin_expl:
103+
case Builtin::BIexp2l:
104+
case Builtin::BI__builtin_exp2l:
105+
case Builtin::BIfabsl:
106+
case Builtin::BI__builtin_fabsl:
107+
case Builtin::BIfloorl:
108+
case Builtin::BI__builtin_floorl:
109+
case Builtin::BIfmal:
110+
case Builtin::BI__builtin_fmal:
111+
case Builtin::BIfmaxl:
112+
case Builtin::BI__builtin_fmaxl:
113+
case Builtin::BIfminl:
114+
case Builtin::BI__builtin_fminl:
115+
case Builtin::BIfmodl:
116+
case Builtin::BI__builtin_fmodl:
117+
case Builtin::BIlogl:
118+
case Builtin::BI__builtin_logl:
119+
case Builtin::BIlog10l:
120+
case Builtin::BI__builtin_log10l:
121+
case Builtin::BIlog2l:
122+
case Builtin::BI__builtin_log2l:
123+
case Builtin::BIpowl:
124+
case Builtin::BI__builtin_powl:
125+
case Builtin::BIrintl:
126+
case Builtin::BI__builtin_rintl:
127+
case Builtin::BIroundl:
128+
case Builtin::BI__builtin_roundl:
129+
case Builtin::BIsinl:
130+
case Builtin::BI__builtin_sinl:
131+
case Builtin::BIsqrtl:
132+
case Builtin::BI__builtin_sqrtl:
133+
case Builtin::BItruncl:
134+
case Builtin::BI__builtin_truncl:
135+
case Builtin::BIlroundl:
136+
case Builtin::BI__builtin_lroundl:
137+
case Builtin::BIceilf:
138+
case Builtin::BI__builtin_ceilf:
139+
case Builtin::BIcopysignf:
140+
case Builtin::BI__builtin_copysignf:
141+
case Builtin::BIcosf:
142+
case Builtin::BI__builtin_cosf:
143+
case Builtin::BIexpf:
144+
case Builtin::BI__builtin_expf:
145+
case Builtin::BIexp2f:
146+
case Builtin::BI__builtin_exp2f:
147+
case Builtin::BIfabsf:
148+
case Builtin::BI__builtin_fabsf:
149+
case Builtin::BIfloorf:
150+
case Builtin::BI__builtin_floorf:
151+
case Builtin::BIfmaf:
152+
case Builtin::BI__builtin_fmaf:
153+
case Builtin::BIfmaxf:
154+
case Builtin::BI__builtin_fmaxf:
155+
case Builtin::BIfminf:
156+
case Builtin::BI__builtin_fminf:
157+
case Builtin::BIfmodf:
158+
case Builtin::BI__builtin_fmodf:
159+
case Builtin::BIlogf:
160+
case Builtin::BI__builtin_logf:
161+
case Builtin::BIlog10f:
162+
case Builtin::BI__builtin_log10f:
163+
case Builtin::BIlog2f:
164+
case Builtin::BI__builtin_log2f:
165+
case Builtin::BIpowf:
166+
case Builtin::BI__builtin_powf:
167+
case Builtin::BIrintf:
168+
case Builtin::BI__builtin_rintf:
169+
case Builtin::BIroundf:
170+
case Builtin::BI__builtin_roundf:
171+
case Builtin::BIsinf:
172+
case Builtin::BI__builtin_sinf:
173+
case Builtin::BIsqrtf:
174+
case Builtin::BI__builtin_sqrtf:
175+
case Builtin::BItruncf:
176+
case Builtin::BI__builtin_truncf:
177+
case Builtin::BIlroundf:
178+
case Builtin::BI__builtin_lroundf:
179+
return false;
180+
default:
181+
break;
182+
}
183+
return true;
184+
}
185+
86186
class MarkDeviceFunction : public RecursiveASTVisitor<MarkDeviceFunction> {
87187
public:
88188
MarkDeviceFunction(Sema &S)
@@ -119,7 +219,28 @@ class MarkDeviceFunction : public RecursiveASTVisitor<MarkDeviceFunction> {
119219
SemaRef.addSyclDeviceDecl(Def);
120220
}
121221
}
122-
} else if (!SemaRef.getLangOpts().SYCLAllowFuncPtr &&
222+
if (auto const *FD = dyn_cast<FunctionDecl>(Callee)) {
223+
//FIXME: We need check all target specified attributes for error if that
224+
//function with attribute can not be called from sycl kernel. The info
225+
//is in ParsedAttr. We don't have to map from Attr to ParsedAttr
226+
//currently. Erich is currently working on that in LLVM, once that is
227+
//committed we need to change this".
228+
if (FD->hasAttr<DLLImportAttr>()) {
229+
SemaRef.Diag(e->getExprLoc(), diag::err_sycl_restrict)
230+
<< Sema::KernelCallDllimportFunction;
231+
SemaRef.Diag(FD->getLocation(), diag::note_callee_decl) << FD;
232+
}
233+
}
234+
// Specifically check if the math library function corresponding to this
235+
// builtin is supported for SYCL
236+
unsigned BuiltinID = (Callee ? Callee->getBuiltinID() : 0);
237+
if (BuiltinID && !IsSyclMathFunc(BuiltinID)) {
238+
StringRef Name = SemaRef.Context.BuiltinInfo.getName(BuiltinID);
239+
SemaRef.Diag(e->getExprLoc(),
240+
diag::err_builtin_target_unsupported)
241+
<< Name << "SYCL device";
242+
}
243+
} else if ((!SemaRef.getLangOpts().SYCLAllowFuncPtr) &&
123244
!e->isTypeDependent())
124245
SemaRef.Diag(e->getExprLoc(), diag::err_sycl_restrict)
125246
<< Sema::KernelCallFunctionPointer;
@@ -197,9 +318,12 @@ class MarkDeviceFunction : public RecursiveASTVisitor<MarkDeviceFunction> {
197318
SemaRef.Diag(E->getExprLoc(), diag::err_sycl_restrict)
198319
<< Sema::KernelNonConstStaticDataVariable;
199320
else if (!IsConst && VD->hasGlobalStorage() && !VD->isStaticLocal() &&
200-
!VD->isStaticDataMember() && !isa<ParmVarDecl>(VD))
321+
!VD->isStaticDataMember() && !isa<ParmVarDecl>(VD)) {
322+
if (VD->getTLSKind() != VarDecl::TLS_None)
323+
SemaRef.Diag(E->getLocation(), diag::err_thread_unsupported);
201324
SemaRef.Diag(E->getLocation(), diag::err_sycl_restrict)
202325
<< Sema::KernelGlobalVariable;
326+
}
203327
if (!VD->isLocalVarDeclOrParm() && VD->hasGlobalStorage()) {
204328
VD->addAttr(SYCLDeviceAttr::CreateImplicit(SemaRef.Context));
205329
SemaRef.addSyclDeviceDecl(VD);

clang/test/Driver/clang-offload-wrapper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,5 @@
164164
//
165165
// RUN: clang-offload-wrapper -o %t.wrapper.bc -host=x86_64-pc-linux-gnu -kind=sycl -target=spir64-unknown-linux-sycldevice %t1.tgt
166166
// RUN: %clang -target x86_64-pc-linux-gnu -c %t.wrapper.bc -o %t.wrapper.o
167-
// RUN: clang-offload-bundler --type=o --inputs=%t.wrapper.o --targets=host-x86_64-pc-linux-gnu,sycl-spir64-unknown-linux-sycldevice --outputs=%t.host.out,%t1.out --unbundle
167+
// RUN: clang-offload-bundler --type=o --inputs=%t.wrapper.o --targets=sycl-spir64-unknown-linux-sycldevice --outputs=%t1.out --unbundle
168168
// RUN: diff %t1.out %t1.tgt

clang/test/Driver/sycl-offload-intelfpga.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@
4848
// CHK-FPGA-LINK-LIB: clang-offload-bundler{{.*}} "-type=aoo" "-targets=host-x86_64-unknown-linux-gnu" "-inputs=[[INPUT]]" "-outputs=[[OUTPUT1:.+\.txt]]" "-unbundle"
4949
// CHK-FPGA-LINK-LIB: llvm-ar{{.*}} "cr" {{.*}} "@[[OUTPUT1]]"
5050

51+
/// -fintelfpga with AOCR library and additional object
52+
// RUN: touch %t2.o
53+
// RUN: %clang++ -### -target x86_64-unknown-linux-gnu -fsycl -fintelfpga %t.a %t2.o 2>&1 \
54+
// RUN: | FileCheck -check-prefixes=CHK-FPGA %s
55+
// CHK-FPGA: aoc{{.*}} "-o" {{.*}} "-sycl"
56+
// CHK-FPGA: llc{{.*}} "-filetype=obj" "-o" "[[FINALLINK:.*\.o]]"
57+
// CHK-FPGA: clang-offload-bundler{{.*}} "-type=o" "-targets=host-x86_64-unknown-linux-gnu,sycl-spir64_fpga-unknown-{{linux|windows}}-sycldevice" {{.*}} "-outputs=[[FINALLINK2:.+\.o]],[[OUTPUT1:.+\.o]]" "-unbundle"
58+
// CHK-FPGA: llvm-no-spir-kernel{{.*}} "[[OUTPUT1]]" "-o" "[[OUTPUT3:.+\.o]]"
59+
// CHK-FPGA: llvm-link{{.*}} "[[OUTPUT3]]" "-o" "[[OUTPUT4:.+\.bc]]"
60+
// CHK-FPGA: llvm-spirv{{.*}} "-o" "[[OUTPUT5:.+\.spv]]" "[[OUTPUT4]]"
61+
// CHK-FPGA: clang-offload-wrapper{{.*}} "-o=[[OUTPUT6:.+\.bc]]" "-host=x86_64-unknown-linux-gnu" "-kind=sycl" "[[OUTPUT5]]"
62+
// CHK-FPGA: llc{{.*}} "-filetype=obj" "-o" "[[FINALLINK3:.+\.o]]" "[[OUTPUT6]]"
63+
// CHK-FPGA: clang-offload-bundler{{.*}} "-type=aoo" "-targets=host-x86_64-unknown-linux-gnu" {{.*}} "-outputs=[[FINALLINK4:.+\.txt]]" "-unbundle"
64+
// CHK-FPGA: {{link|ld}}{{.*}} "@[[FINALLINK4]]" "[[FINALLINK2]]" "[[FINALLINK]]" "[[FINALLINK3]]"
65+
5166
/// -fintelfpga -fsycl-link from source
5267
// RUN: touch %t.cpp
5368
// RUN: %clang++ -### -target x86_64-unknown-linux-gnu -fsycl -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \

clang/test/Driver/sycl.c

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clang -### --sycl -c %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
22
// RUN: %clang -### --sycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
3+
// RUN: %clang -### -fsycl-device-only -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
34
// RUN: %clang -### --sycl -fno-sycl-use-bitcode -c %s 2>&1 | FileCheck %s --check-prefix=NO-BITCODE
45
// RUN: %clang -### -target spir64-unknown-linux-sycldevice -c -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=TARGET
56
// RUN: %clang -### --sycl -c -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=COMBINED
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// RUN: %clang_cc1 -triple spir64-unknown-linux-sycldevice -fms-extensions \
2+
// RUN: -aux-triple x86_64-unknown-linux-gnu -fsycl-is-device -fsyntax-only \
3+
// RUN: -DWARNCHECK %s -o /dev/null 2>&1 | FileCheck %s
4+
// check random triple aux-triple with sycl-device
5+
6+
// RUN: %clang_cc1 -triple spir64-unknown-windows-sycldevice -fsyntax-only \
7+
// RUN: -fms-extensions -DWARNCHECK %s -o /dev/null 2>&1 | FileCheck %s
8+
// check without -aux-triple but sycl-device
9+
10+
// RUN: %clang_cc1 -triple spir64-unknown-windows-sycldevice -fsycl-is-device \
11+
// RUN: -aux-triple x86_64-pc-windows-msvc -fms-extensions -fsyntax-only \
12+
// RUN: -DWARNCHECK %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes CHECKALL
13+
// check -aux-tripe without sycl-device
14+
15+
// RUN: %clang_cc1 -triple spir64-unknown-windows-sycldevice -fsyntax-only \
16+
// RUN: -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -fms-extensions \
17+
// RUN: -verify %s
18+
// check error message when dllimport function gets called in sycl-kernel cdoe
19+
20+
#if defined(WARNCHECK)
21+
// CHECK: warning: __declspec attribute 'dllexport' is not supported
22+
int __declspec(dllexport) foo(int a) {
23+
return a;
24+
}
25+
26+
// CHECK: warning: __declspec attribute 'dllimport' is not supported
27+
int __declspec(dllimport) bar();
28+
29+
30+
// CHECK: warning: unknown attribute 'dllimport' ignored
31+
int [[dllimport]]xoo();
32+
33+
// CHECKALL: warning: unknown attribute 'dllimport' ignored
34+
int zoo() __attribute__((dllimport));
35+
36+
#else
37+
38+
// emit error if dllimport function is called in sycl kernel
39+
int __declspec(dllexport) foo(int a) {
40+
return a;
41+
}
42+
// expected-note@+1 {{'bar' declared here}}
43+
int __declspec(dllimport) bar();
44+
// expected-note@+2 {{previous attribute is here}}
45+
// expected-note@+1 {{previous declaration is here}}
46+
int __declspec(dllimport) foobar();
47+
int foobar() // expected-warning {{'foobar' redeclared without 'dllimport' attribute: previous 'dllimport' ignored}}
48+
{
49+
return 10;
50+
}
51+
52+
template <typename name, typename Func>
53+
__attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) {
54+
kernelFunc();
55+
}
56+
57+
int main() {
58+
foo(10); // expected-no-error
59+
bar(); // expected-no-error
60+
kernel_single_task<class fake_kernel>([]() {
61+
foo(10);// expected-no-error
62+
bar(); // expected-error {{SYCL kernel cannot call a dllimport function}}
63+
foobar(); // expected-no-error
64+
});
65+
bar(); // expected-no-error
66+
return 0;
67+
}
68+
#endif

0 commit comments

Comments
 (0)