26
26
27
27
using namespace sycl ;
28
28
29
- class TestKernel {
29
+ class CacheTestKernel {
30
30
public:
31
31
void operator ()(sycl::item<1 >){};
32
32
};
33
33
34
- class TestKernel2 {
34
+ class CacheTestKernel2 {
35
35
public:
36
36
void operator ()(sycl::item<1 >){};
37
37
};
@@ -51,11 +51,11 @@ struct MockKernelInfo {
51
51
static constexpr int64_t getKernelSize () { return 1 ; }
52
52
};
53
53
54
- template <> struct KernelInfo <TestKernel > : public MockKernelInfo {
55
- static constexpr const char *getName () { return " TestKernel " ; }
54
+ template <> struct KernelInfo <CacheTestKernel > : public MockKernelInfo {
55
+ static constexpr const char *getName () { return " CacheTestKernel " ; }
56
56
};
57
- template <> struct KernelInfo <TestKernel2 > : public MockKernelInfo {
58
- static constexpr const char *getName () { return " TestKernel2 " ; }
57
+ template <> struct KernelInfo <CacheTestKernel2 > : public MockKernelInfo {
58
+ static constexpr const char *getName () { return " CacheTestKernel2 " ; }
59
59
};
60
60
} // namespace detail
61
61
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
@@ -69,7 +69,7 @@ static sycl::unittest::PiImage generateDefaultImage() {
69
69
std::vector<unsigned char > Bin{0 , 1 , 2 , 3 , 4 , 5 }; // Random data
70
70
71
71
PiArray<PiOffloadEntry> Entries =
72
- makeEmptyKernels ({" TestKernel " , " TestKernel2 " });
72
+ makeEmptyKernels ({" CacheTestKernel " , " CacheTestKernel2 " });
73
73
74
74
PiImage Img{PI_DEVICE_BINARY_TYPE_SPIRV, // Format
75
75
__SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec
@@ -122,9 +122,9 @@ class KernelAndProgramCacheTest : public ::testing::Test {
122
122
// Check that programs built from source are not cached.
123
123
TEST_F (KernelAndProgramCacheTest, DISABLED_ProgramSourceNegativeBuild) {
124
124
context Ctx{Plt};
125
- // program Prg{Ctx};
125
+ // program Prg{Ctx};
126
126
127
- // Prg.build_with_source("");
127
+ // Prg.build_with_source("");
128
128
auto CtxImpl = detail::getSyclObjImpl (Ctx);
129
129
detail::KernelProgramCache::ProgramCacheT &Cache =
130
130
CtxImpl->getKernelProgramCache ().acquireCachedPrograms ().get ();
@@ -134,9 +134,9 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramSourceNegativeBuild) {
134
134
// Check that programs built from source with options are not cached.
135
135
TEST_F (KernelAndProgramCacheTest, DISABLED_ProgramSourceNegativeBuildWithOpts) {
136
136
context Ctx{Plt};
137
- // program Prg{Ctx};
137
+ // program Prg{Ctx};
138
138
139
- // Prg.build_with_source("", "-g");
139
+ // Prg.build_with_source("", "-g");
140
140
auto CtxImpl = detail::getSyclObjImpl (Ctx);
141
141
detail::KernelProgramCache::ProgramCacheT &Cache =
142
142
CtxImpl->getKernelProgramCache ().acquireCachedPrograms ().get ();
@@ -147,10 +147,10 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramSourceNegativeBuildWithOpts) {
147
147
TEST_F (KernelAndProgramCacheTest,
148
148
DISABLED_ProgramSourceNegativeCompileAndLink) {
149
149
context Ctx{Plt};
150
- // program Prg{Ctx};
150
+ // program Prg{Ctx};
151
151
152
- // Prg.compile_with_source("");
153
- // Prg.link();
152
+ // Prg.compile_with_source("");
153
+ // Prg.link();
154
154
auto CtxImpl = detail::getSyclObjImpl (Ctx);
155
155
detail::KernelProgramCache::ProgramCacheT &Cache =
156
156
CtxImpl->getKernelProgramCache ().acquireCachedPrograms ().get ();
@@ -162,10 +162,10 @@ TEST_F(KernelAndProgramCacheTest,
162
162
TEST_F (KernelAndProgramCacheTest,
163
163
DISABLED_ProgramSourceNegativeCompileAndLinkWithOpts) {
164
164
context Ctx{Plt};
165
- // program Prg{Ctx};
165
+ // program Prg{Ctx};
166
166
167
- // Prg.compile_with_source("");
168
- // Prg.link();
167
+ // Prg.compile_with_source("");
168
+ // Prg.link();
169
169
auto CtxImpl = detail::getSyclObjImpl (Ctx);
170
170
detail::KernelProgramCache::ProgramCacheT &Cache =
171
171
CtxImpl->getKernelProgramCache ().acquireCachedPrograms ().get ();
@@ -175,11 +175,11 @@ TEST_F(KernelAndProgramCacheTest,
175
175
// Check that programs built without options are cached.
176
176
TEST_F (KernelAndProgramCacheTest, DISABLED_ProgramBuildPositive) {
177
177
context Ctx{Plt};
178
- // program Prg1{Ctx};
179
- // program Prg2{Ctx};
178
+ // program Prg1{Ctx};
179
+ // program Prg2{Ctx};
180
180
181
- // Prg1.build_with_kernel_type<TestKernel >();
182
- // Prg2.build_with_kernel_type<TestKernel >();
181
+ // Prg1.build_with_kernel_type<CacheTestKernel >();
182
+ // Prg2.build_with_kernel_type<CacheTestKernel >();
183
183
auto CtxImpl = detail::getSyclObjImpl (Ctx);
184
184
detail::KernelProgramCache::ProgramCacheT &Cache =
185
185
CtxImpl->getKernelProgramCache ().acquireCachedPrograms ().get ();
@@ -189,21 +189,21 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramBuildPositive) {
189
189
// Check that programs built with options are cached.
190
190
TEST_F (KernelAndProgramCacheTest, DISABLED_ProgramBuildPositiveBuildOpts) {
191
191
context Ctx{Plt};
192
- // program Prg1{Ctx};
193
- // program Prg2{Ctx};
194
- // program Prg3{Ctx};
195
- // program Prg4{Ctx};
196
- // program Prg5{Ctx};
192
+ // program Prg1{Ctx};
193
+ // program Prg2{Ctx};
194
+ // program Prg3{Ctx};
195
+ // program Prg4{Ctx};
196
+ // program Prg5{Ctx};
197
197
198
198
/* Build 5 instances of the same program. It is expected that there will be 3
199
199
* instances of the program in the cache because Build of Prg1 is equal to
200
200
* build of Prg5 and build of Prg2 is equal to build of Prg3.
201
201
* */
202
- // Prg1.build_with_kernel_type<TestKernel >("-a");
203
- // Prg2.build_with_kernel_type<TestKernel >("-b");
204
- // Prg3.build_with_kernel_type<TestKernel >("-b");
205
- // Prg4.build_with_kernel_type<TestKernel >();
206
- // Prg5.build_with_kernel_type<TestKernel2 >("-a");
202
+ // Prg1.build_with_kernel_type<CacheTestKernel >("-a");
203
+ // Prg2.build_with_kernel_type<CacheTestKernel >("-b");
204
+ // Prg3.build_with_kernel_type<CacheTestKernel >("-b");
205
+ // Prg4.build_with_kernel_type<CacheTestKernel >();
206
+ // Prg5.build_with_kernel_type<CacheTestKernel2 >("-a");
207
207
208
208
auto CtxImpl = detail::getSyclObjImpl (Ctx);
209
209
detail::KernelProgramCache::ProgramCacheT &Cache =
@@ -214,10 +214,10 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramBuildPositiveBuildOpts) {
214
214
// Check that programs built with compile options are not cached.
215
215
TEST_F (KernelAndProgramCacheTest, DISABLED_ProgramBuildNegativeCompileOpts) {
216
216
context Ctx{Plt};
217
- // program Prg{Ctx};
217
+ // program Prg{Ctx};
218
218
219
- // Prg.compile_with_kernel_type<TestKernel >("-g");
220
- // Prg.link();
219
+ // Prg.compile_with_kernel_type<CacheTestKernel >("-g");
220
+ // Prg.link();
221
221
auto CtxImpl = detail::getSyclObjImpl (Ctx);
222
222
detail::KernelProgramCache::ProgramCacheT &Cache =
223
223
CtxImpl->getKernelProgramCache ().acquireCachedPrograms ().get ();
@@ -227,10 +227,10 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramBuildNegativeCompileOpts) {
227
227
// Check that programs built with link options are not cached.
228
228
TEST_F (KernelAndProgramCacheTest, DISABLED_ProgramBuildNegativeLinkOpts) {
229
229
context Ctx{Plt};
230
- // program Prg{Ctx};
230
+ // program Prg{Ctx};
231
231
232
- // Prg.compile_with_kernel_type<TestKernel >();
233
- // Prg.link("-g");
232
+ // Prg.compile_with_kernel_type<CacheTestKernel >();
233
+ // Prg.link("-g");
234
234
auto CtxImpl = detail::getSyclObjImpl (Ctx);
235
235
detail::KernelProgramCache::ProgramCacheT &Cache =
236
236
CtxImpl->getKernelProgramCache ().acquireCachedPrograms ().get ();
@@ -244,10 +244,10 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_KernelPositive) {
244
244
245
245
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
246
246
247
- // program Prg{Ctx};
247
+ // program Prg{Ctx};
248
248
249
- // Prg.build_with_kernel_type<TestKernel >();
250
- // kernel Ker = Prg.get_kernel<TestKernel >();
249
+ // Prg.build_with_kernel_type<CacheTestKernel >();
250
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
251
251
detail::KernelProgramCache::KernelCacheT &Cache =
252
252
CtxImpl->getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
253
253
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
@@ -260,11 +260,11 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_KernelPositiveBuildOpts) {
260
260
261
261
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
262
262
263
- // program Prg{Ctx};
263
+ // program Prg{Ctx};
264
264
265
- // Prg.build_with_kernel_type<TestKernel >("-g");
265
+ // Prg.build_with_kernel_type<CacheTestKernel >("-g");
266
266
267
- // kernel Ker = Prg.get_kernel<TestKernel >();
267
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
268
268
detail::KernelProgramCache::KernelCacheT &Cache =
269
269
CtxImpl->getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
270
270
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
@@ -277,11 +277,11 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_KernelNegativeCompileOpts) {
277
277
278
278
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
279
279
280
- // program Prg{Ctx};
280
+ // program Prg{Ctx};
281
281
282
- // Prg.compile_with_kernel_type<TestKernel >("-g");
283
- // Prg.link();
284
- // kernel Ker = Prg.get_kernel<TestKernel >();
282
+ // Prg.compile_with_kernel_type<CacheTestKernel >("-g");
283
+ // Prg.link();
284
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
285
285
detail::KernelProgramCache::KernelCacheT &Cache =
286
286
CtxImpl->getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
287
287
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
@@ -294,11 +294,11 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_KernelNegativeLinkOpts) {
294
294
295
295
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
296
296
297
- // program Prg{Ctx};
297
+ // program Prg{Ctx};
298
298
299
- // Prg.compile_with_kernel_type<TestKernel >();
300
- // Prg.link("-g");
301
- // kernel Ker = Prg.get_kernel<TestKernel >();
299
+ // Prg.compile_with_kernel_type<CacheTestKernel >();
300
+ // Prg.link("-g");
301
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
302
302
detail::KernelProgramCache::KernelCacheT &Cache =
303
303
CtxImpl->getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
304
304
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
@@ -312,13 +312,13 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_KernelNegativeLinkedProgs) {
312
312
313
313
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
314
314
315
- // program Prg1{Ctx};
316
- // program Prg2{Ctx};
315
+ // program Prg1{Ctx};
316
+ // program Prg2{Ctx};
317
317
318
- // Prg1.compile_with_kernel_type<TestKernel >();
319
- // Prg2.compile_with_kernel_type<TestKernel2 >();
320
- // program Prg({Prg1, Prg2});
321
- // kernel Ker = Prg.get_kernel<TestKernel >();
318
+ // Prg1.compile_with_kernel_type<CacheTestKernel >();
319
+ // Prg2.compile_with_kernel_type<CacheTestKernel2 >();
320
+ // program Prg({Prg1, Prg2});
321
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
322
322
323
323
detail::KernelProgramCache::KernelCacheT &Cache =
324
324
CtxImpl->getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
@@ -332,10 +332,10 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_KernelNegativeSource) {
332
332
333
333
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
334
334
335
- // program Prg{Ctx};
335
+ // program Prg{Ctx};
336
336
337
- // Prg.build_with_source("");
338
- // kernel Ker = Prg.get_kernel("test");
337
+ // Prg.build_with_source("");
338
+ // kernel Ker = Prg.get_kernel("test");
339
339
340
340
detail::KernelProgramCache::KernelCacheT &Cache =
341
341
CtxImpl->getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
@@ -363,10 +363,10 @@ TEST_F(KernelAndProgramFastCacheTest, DISABLED_KernelPositive) {
363
363
364
364
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
365
365
366
- // program Prg{Ctx};
366
+ // program Prg{Ctx};
367
367
368
- // Prg.build_with_kernel_type<TestKernel >();
369
- // kernel Ker = Prg.get_kernel<TestKernel >();
368
+ // Prg.build_with_kernel_type<CacheTestKernel >();
369
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
370
370
detail::KernelProgramCache::KernelFastCacheT &Cache =
371
371
MockKernelProgramCache::getFastCache (CtxImpl->getKernelProgramCache ());
372
372
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
@@ -379,11 +379,11 @@ TEST_F(KernelAndProgramFastCacheTest, DISABLED_KernelPositiveBuildOpts) {
379
379
380
380
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
381
381
382
- // program Prg{Ctx};
382
+ // program Prg{Ctx};
383
383
384
- // Prg.build_with_kernel_type<TestKernel >("-g");
384
+ // Prg.build_with_kernel_type<CacheTestKernel >("-g");
385
385
386
- // kernel Ker = Prg.get_kernel<TestKernel >();
386
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
387
387
detail::KernelProgramCache::KernelFastCacheT &Cache =
388
388
MockKernelProgramCache::getFastCache (CtxImpl->getKernelProgramCache ());
389
389
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
@@ -396,11 +396,11 @@ TEST_F(KernelAndProgramFastCacheTest, DISABLED_KernelNegativeCompileOpts) {
396
396
397
397
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
398
398
399
- // program Prg{Ctx};
399
+ // program Prg{Ctx};
400
400
401
- // Prg.compile_with_kernel_type<TestKernel >("-g");
402
- // Prg.link();
403
- // kernel Ker = Prg.get_kernel<TestKernel >();
401
+ // Prg.compile_with_kernel_type<CacheTestKernel >("-g");
402
+ // Prg.link();
403
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
404
404
detail::KernelProgramCache::KernelFastCacheT &Cache =
405
405
MockKernelProgramCache::getFastCache (CtxImpl->getKernelProgramCache ());
406
406
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
@@ -413,11 +413,11 @@ TEST_F(KernelAndProgramFastCacheTest, DISABLED_KernelNegativeLinkOpts) {
413
413
414
414
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
415
415
416
- // program Prg{Ctx};
416
+ // program Prg{Ctx};
417
417
418
- // Prg.compile_with_kernel_type<TestKernel >();
419
- // Prg.link("-g");
420
- // kernel Ker = Prg.get_kernel<TestKernel >();
418
+ // Prg.compile_with_kernel_type<CacheTestKernel >();
419
+ // Prg.link("-g");
420
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
421
421
detail::KernelProgramCache::KernelFastCacheT &Cache =
422
422
MockKernelProgramCache::getFastCache (CtxImpl->getKernelProgramCache ());
423
423
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
@@ -431,13 +431,13 @@ TEST_F(KernelAndProgramFastCacheTest, DISABLED_KernelNegativeLinkedProgs) {
431
431
432
432
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
433
433
434
- // program Prg1{Ctx};
435
- // program Prg2{Ctx};
434
+ // program Prg1{Ctx};
435
+ // program Prg2{Ctx};
436
436
437
- // Prg1.compile_with_kernel_type<TestKernel >();
438
- // Prg2.compile_with_kernel_type<TestKernel2 >();
439
- // program Prg({Prg1, Prg2});
440
- // kernel Ker = Prg.get_kernel<TestKernel >();
437
+ // Prg1.compile_with_kernel_type<CacheTestKernel >();
438
+ // Prg2.compile_with_kernel_type<CacheTestKernel2 >();
439
+ // program Prg({Prg1, Prg2});
440
+ // kernel Ker = Prg.get_kernel<CacheTestKernel >();
441
441
442
442
detail::KernelProgramCache::KernelFastCacheT &Cache =
443
443
MockKernelProgramCache::getFastCache (CtxImpl->getKernelProgramCache ());
@@ -451,10 +451,10 @@ TEST_F(KernelAndProgramFastCacheTest, DISABLED_KernelNegativeSource) {
451
451
452
452
globalCtx.reset (new TestCtx{CtxImpl->getHandleRef ()});
453
453
454
- // program Prg{Ctx};
454
+ // program Prg{Ctx};
455
455
456
- // Prg.build_with_source("");
457
- // kernel Ker = Prg.get_kernel("test");
456
+ // Prg.build_with_source("");
457
+ // kernel Ker = Prg.get_kernel("test");
458
458
459
459
detail::KernelProgramCache::KernelFastCacheT &Cache =
460
460
MockKernelProgramCache::getFastCache (CtxImpl->getKernelProgramCache ());
0 commit comments