Skip to content

Commit 2b05ef5

Browse files
sommerlukasbb-sycl
authored andcommitted
[SYCL][Fusion] Update test for circular dependency (intel#1557)
1 parent b5376f3 commit 2b05ef5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

SYCL/KernelFusion/sync_two_queues_requirement.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ int main() {
5757
[=](id<1> i) { accTmp[i] *= 2; });
5858
});
5959

60-
// KernelThree specifies a requirement on KernelOne. To avoid circular
61-
// dependencies between two fusions, the fusion for q1 needs to cancelled.
62-
assert(!fw1.is_in_fusion_mode() &&
63-
"Queue should not be in fusion mode anymore");
64-
60+
assert(fw1.is_in_fusion_mode() && "Queue should be in fusion mode");
6561
assert(fw2.is_in_fusion_mode() && "Queue should be in fusion mode");
6662

6763
q1.submit([&](handler &cgh) {
@@ -72,13 +68,17 @@ int main() {
7268
dataSize, [=](id<1> i) { accOut[i] = accTmp[i] * accIn3[i]; });
7369
});
7470

75-
// KernelTwo specifies a requirement on KernelThree, which leads to
76-
// cancellation of the fusion for q2.
71+
// KernelTwo specifies a requirement on KernelThree, which had already
72+
// specified a requirement on KernelOne. Therefore, a cyclic dependency
73+
// between the kernel fused from (KernelOne, KernelTwo) and KernelThree
74+
// would arise, so fusion needs to be cancelled for q1/fw1.
75+
fw1.complete_fusion({ext::codeplay::experimental::property::no_barriers{}});
76+
77+
// As KernelTwo has been enqueued for execution, it's synchronization with
78+
// KernelThree leads to the fusion for q2/fw2 to also be cancelled.
7779
assert(!fw2.is_in_fusion_mode() &&
7880
"Queue should not be in fusion mode anymore");
7981

80-
fw1.complete_fusion({ext::codeplay::experimental::property::no_barriers{}});
81-
8282
fw2.cancel_fusion();
8383
}
8484

@@ -90,5 +90,5 @@ int main() {
9090
return 0;
9191
}
9292

93-
// CHECK: WARNING: Aborting fusion because of requirement from a different fusion
93+
// CHECK: WARNING: Aborting fusion because it would create a circular dependency
9494
// CHECK-NEXT: WARNING: Aborting fusion because synchronization with one of the kernels in the fusion list was requested

0 commit comments

Comments
 (0)