Skip to content

Commit bc4be30

Browse files
committed
Add more clarifying comment
1 parent eb5abfb commit bc4be30

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sycl/unittests/kernel-and-program/MultipleDevsCache.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,11 @@ TEST_F(MultipleDeviceCacheTest, ProgramRetain) {
211211

212212
EXPECT_EQ(KernelCache.size(), (size_t)2) << "Expect 2 kernels in cache";
213213
}
214-
// Cache is cleared here, check kernel release
215-
// 3 kernel releases is expected because kernel_bundle::get_kernel() calls
216-
// piKernelRetain so one more kernel release is needed
214+
// First kernel creating is called in handler::single_task().
215+
// kernel_bundle::get_kernel() creates a kernel and shares it with created programs.
216+
// Also the kernel is retained in kernel_bundle::get_kernel().
217+
// A kernel is removed from cache if piKernelRelease was called for it,
218+
// so it will not be removed twice for the other programs.
219+
// As a result we must expect 3 piKernelRelease calls.
217220
EXPECT_EQ(KernelReleaseCounter, 3) << "Expect 3 piKernelRelease calls";
218221
}

0 commit comments

Comments
 (0)