Skip to content

Commit cd44c19

Browse files
committed
format
1 parent 650423e commit cd44c19

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

llvm/lib/SYCLLowerIR/SYCLPropagateAspectsUsage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ void processDeclaredVirtualFunctionSets(
666666
if (!F->hasFnAttribute("calls-indirectly"))
667667
return;
668668

669-
// "Construction" kernels which reference vtables but do not actually
670-
// perform any virtual calls have the calls-indirectly attribute
669+
// "Construction" kernels which reference vtables but do not actually
670+
// perform any virtual calls have the calls-indirectly attribute
671671
// attached by SYCLVirtualFunctionAnalysis pass. We do not want to
672672
// attach sycl_used_aspects metadata to such kernels.
673673
bool hasVirtualCall = false;
@@ -682,7 +682,7 @@ void processDeclaredVirtualFunctionSets(
682682
}
683683
if (!hasVirtualCall)
684684
return;
685-
685+
686686
Attribute CallsIndirectlyAttr = F->getFnAttribute("calls-indirectly");
687687
SmallVector<StringRef, 4> DeclaredVirtualFunctionSetNames;
688688
CallsIndirectlyAttr.getValueAsString().split(DeclaredVirtualFunctionSetNames,

sycl/test-e2e/VirtualFunctions/vf-optional-kernel-features.cpp

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,31 @@ int main() {
3232
Base *Obj = sycl::malloc_shared<Base>(1, Q);
3333

3434
Q.single_task<Constructor>([=]() {
35-
// Even though at LLVM IR level this kernel does reference 'Base::foo'
36-
// and 'Base::bar' through global variable containing `vtable` for `Base`,
37-
// we do not consider the kernel to be using `fp64` optional feature.
38-
new (Obj) Base;
39-
}).wait();
35+
// Even though at LLVM IR level this kernel does reference 'Base::foo'
36+
// and 'Base::bar' through global variable containing `vtable` for `Base`,
37+
// we do not consider the kernel to be using `fp64` optional feature.
38+
new (Obj) Base;
39+
}).wait();
4040

41-
Q.single_task<Use>(syclext::properties{syclext::assume_indirect_calls}, [=]() {
42-
// This kernel is not considered to be using any optional features, because
43-
// virtual functions in default set do not use any.
44-
Obj->foo();
45-
}).wait();
41+
Q.single_task<Use>(syclext::properties{syclext::assume_indirect_calls},
42+
[=]() {
43+
// This kernel is not considered to be using any optional
44+
// features, because virtual functions in default set do
45+
// not use any.
46+
Obj->foo();
47+
})
48+
.wait();
4649

4750
if (Q.get_device().has(sycl::aspect::fp64)) {
48-
Q.single_task<UseFP64>(syclext::properties{syclext::assume_indirect_calls_to<set_fp64>},
49-
[=]() {
50-
// This kernel is considered to be using 'fp64' optional feature, because
51-
// there is a virtual function in 'set_fp64' which uses double.
52-
Obj->bar();
53-
}).wait();
51+
Q.single_task<UseFP64>(
52+
syclext::properties{syclext::assume_indirect_calls_to<set_fp64>},
53+
[=]() {
54+
// This kernel is considered to be using 'fp64' optional feature,
55+
// because there is a virtual function in 'set_fp64' which uses
56+
// double.
57+
Obj->bar();
58+
})
59+
.wait();
5460
}
5561

5662
int nfails = 0;

sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ TEST(VirtualFunctions, DummyImages) {
370370

371371
CapturedLinkingData.clear();
372372

373-
EXPECT_EQ(Plt.get_devices().size(), 2);
373+
EXPECT_EQ(Plt.get_devices().size(), 2u);
374374
sycl::queue Q2(sycl::aspect_selector({}, {sycl::aspect::fp64}));
375375

376376
// We now repeat what we did launching KernelH but on another

0 commit comments

Comments
 (0)