@@ -105,9 +105,9 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramSourceNegativeBuild) {
105
105
// program Prg{Ctx};
106
106
107
107
// Prg.build_with_source("");
108
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
108
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
109
109
detail::KernelProgramCache::ProgramCache &Cache =
110
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
110
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
111
111
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for source programs" ;
112
112
}
113
113
@@ -117,9 +117,9 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramSourceNegativeBuildWithOpts) {
117
117
// program Prg{Ctx};
118
118
119
119
// Prg.build_with_source("", "-g");
120
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
120
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
121
121
detail::KernelProgramCache::ProgramCache &Cache =
122
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
122
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
123
123
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for source programs" ;
124
124
}
125
125
@@ -131,9 +131,9 @@ TEST_F(KernelAndProgramCacheTest,
131
131
132
132
// Prg.compile_with_source("");
133
133
// Prg.link();
134
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
134
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
135
135
detail::KernelProgramCache::ProgramCache &Cache =
136
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
136
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
137
137
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for source programs" ;
138
138
}
139
139
@@ -146,9 +146,9 @@ TEST_F(KernelAndProgramCacheTest,
146
146
147
147
// Prg.compile_with_source("");
148
148
// Prg.link();
149
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
149
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
150
150
detail::KernelProgramCache::ProgramCache &Cache =
151
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
151
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
152
152
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for source programs" ;
153
153
}
154
154
@@ -161,9 +161,9 @@ TEST_F(KernelAndProgramCacheTest, KernelBundleInputState) {
161
161
sycl::kernel_bundle KernelBundle1 =
162
162
sycl::get_kernel_bundle<sycl::bundle_state::input>(Ctx, {KernelID1});
163
163
164
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
164
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
165
165
detail::KernelProgramCache::ProgramCache &Cache =
166
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
166
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
167
167
168
168
EXPECT_EQ (Cache.size (), 0U )
169
169
<< " Expect empty cache for kernel_bundles build with input_state." ;
@@ -178,9 +178,9 @@ TEST_F(KernelAndProgramCacheTest, KernelBundleObjectState) {
178
178
sycl::kernel_bundle KernelBundle1 =
179
179
sycl::get_kernel_bundle<sycl::bundle_state::object>(Ctx, {KernelID1});
180
180
181
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
181
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
182
182
detail::KernelProgramCache::ProgramCache &Cache =
183
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
183
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
184
184
185
185
EXPECT_EQ (Cache.size (), 0U )
186
186
<< " Expect empty cache for kernel_bundles build with object_state." ;
@@ -198,9 +198,9 @@ TEST_F(KernelAndProgramCacheTest, KernelBundleExecutableState) {
198
198
sycl::kernel_bundle KernelBundle2 =
199
199
sycl::get_kernel_bundle<sycl::bundle_state::executable>(Ctx, {KernelID2});
200
200
201
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
201
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
202
202
detail::KernelProgramCache::ProgramCache &Cache =
203
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
203
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
204
204
205
205
EXPECT_EQ (Cache.size (), 1U )
206
206
<< " Expect non-empty cache for kernel_bundles with executable_state." ;
@@ -228,9 +228,9 @@ TEST_F(KernelAndProgramCacheTest, SpecConstantCacheNegative) {
228
228
EXPECT_EQ (KernelBundle2.get_specialization_constant <SpecConst1>(), 70 )
229
229
<< " Wrong specialization constant" ;
230
230
231
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
231
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
232
232
detail::KernelProgramCache::ProgramCache &Cache =
233
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
233
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
234
234
235
235
EXPECT_EQ (Cache.size (), 2U ) << " Expect an entry for each build in the cache." ;
236
236
}
@@ -251,9 +251,9 @@ TEST_F(KernelAndProgramCacheTest, KernelBundleJoin) {
251
251
KernelBundles {KernelBundle1, KernelBundle2};
252
252
sycl::kernel_bundle KernelBundle3 = sycl::join (KernelBundles);
253
253
254
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
254
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
255
255
detail::KernelProgramCache::ProgramCache &Cache =
256
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
256
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
257
257
258
258
EXPECT_EQ (Cache.size (), 1U )
259
259
<< " Expect no caching for kennel_bundle created via join." ;
@@ -278,9 +278,9 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramBuildPositiveBuildOpts) {
278
278
// Prg4.build_with_kernel_type<CacheTestKernel>();
279
279
// Prg5.build_with_kernel_type<CacheTestKernel2>("-a");
280
280
281
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
281
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
282
282
detail::KernelProgramCache::ProgramCache &Cache =
283
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
283
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
284
284
EXPECT_EQ (Cache.size (), 3U ) << " Expect non-empty cache for programs" ;
285
285
}
286
286
@@ -291,9 +291,9 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramBuildNegativeCompileOpts) {
291
291
292
292
// Prg.compile_with_kernel_type<CacheTestKernel>("-g");
293
293
// Prg.link();
294
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
294
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
295
295
detail::KernelProgramCache::ProgramCache &Cache =
296
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
296
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
297
297
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for programs" ;
298
298
}
299
299
@@ -304,93 +304,93 @@ TEST_F(KernelAndProgramCacheTest, DISABLED_ProgramBuildNegativeLinkOpts) {
304
304
305
305
// Prg.compile_with_kernel_type<CacheTestKernel>();
306
306
// Prg.link("-g");
307
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
307
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
308
308
detail::KernelProgramCache::ProgramCache &Cache =
309
- CtxImpl-> getKernelProgramCache ().acquireCachedPrograms ().get ();
309
+ CtxImpl. getKernelProgramCache ().acquireCachedPrograms ().get ();
310
310
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for programs" ;
311
311
}
312
312
313
313
// Check that kernels built without options are cached.
314
314
TEST_F (KernelAndProgramCacheTest, DISABLED_KernelPositive) {
315
315
context Ctx{Plt};
316
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
316
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
317
317
318
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
318
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
319
319
320
320
// program Prg{Ctx};
321
321
322
322
// Prg.build_with_kernel_type<CacheTestKernel>();
323
323
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
324
324
detail::KernelProgramCache::KernelCacheT &Cache =
325
- CtxImpl-> getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
325
+ CtxImpl. getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
326
326
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
327
327
}
328
328
329
329
// Check that kernels built with options are cached.
330
330
TEST_F (KernelAndProgramCacheTest, DISABLED_KernelPositiveBuildOpts) {
331
331
context Ctx{Plt};
332
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
332
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
333
333
334
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
334
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
335
335
336
336
// program Prg{Ctx};
337
337
338
338
// Prg.build_with_kernel_type<CacheTestKernel>("-g");
339
339
340
340
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
341
341
detail::KernelProgramCache::KernelCacheT &Cache =
342
- CtxImpl-> getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
342
+ CtxImpl. getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
343
343
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
344
344
}
345
345
346
346
// Check that kernels built with compile options are not cached.
347
347
TEST_F (KernelAndProgramCacheTest, DISABLED_KernelNegativeCompileOpts) {
348
348
context Ctx{Plt};
349
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
349
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
350
350
351
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
351
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
352
352
353
353
// program Prg{Ctx};
354
354
355
355
// Prg.compile_with_kernel_type<CacheTestKernel>("-g");
356
356
// Prg.link();
357
357
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
358
358
detail::KernelProgramCache::KernelCacheT &Cache =
359
- CtxImpl-> getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
359
+ CtxImpl. getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
360
360
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
361
361
}
362
362
363
363
// Check that kernels built with link options are not cached.
364
364
TEST_F (KernelAndProgramCacheTest, DISABLED_KernelNegativeLinkOpts) {
365
365
context Ctx{Plt};
366
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
366
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
367
367
368
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
368
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
369
369
370
370
// program Prg{Ctx};
371
371
372
372
// Prg.compile_with_kernel_type<CacheTestKernel>();
373
373
// Prg.link("-g");
374
374
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
375
375
detail::KernelProgramCache::KernelCacheT &Cache =
376
- CtxImpl-> getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
376
+ CtxImpl. getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
377
377
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
378
378
}
379
379
380
380
// Check that kernels created from source are not cached.
381
381
TEST_F (KernelAndProgramCacheTest, DISABLED_KernelNegativeSource) {
382
382
context Ctx{Plt};
383
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
383
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
384
384
385
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
385
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
386
386
387
387
// program Prg{Ctx};
388
388
389
389
// Prg.build_with_source("");
390
390
// kernel Ker = Prg.get_kernel("test");
391
391
392
392
detail::KernelProgramCache::KernelCacheT &Cache =
393
- CtxImpl-> getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
393
+ CtxImpl. getKernelProgramCache ().acquireKernelsPerProgramCache ().get ();
394
394
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
395
395
}
396
396
@@ -411,77 +411,77 @@ class MockKernelProgramCache : public detail::KernelProgramCache {
411
411
// Check that kernels built without options are cached.
412
412
TEST_F (KernelAndProgramFastCacheTest, DISABLED_KernelPositive) {
413
413
context Ctx{Plt};
414
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
414
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
415
415
416
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
416
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
417
417
418
418
// program Prg{Ctx};
419
419
420
420
// Prg.build_with_kernel_type<CacheTestKernel>();
421
421
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
422
422
detail::KernelProgramCache::FastKernelCacheT &Cache =
423
- MockKernelProgramCache::getFastCache (CtxImpl-> getKernelProgramCache ());
423
+ MockKernelProgramCache::getFastCache (CtxImpl. getKernelProgramCache ());
424
424
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
425
425
}
426
426
427
427
// Check that kernels built with options are cached.
428
428
TEST_F (KernelAndProgramFastCacheTest, DISABLED_KernelPositiveBuildOpts) {
429
429
context Ctx{Plt};
430
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
430
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
431
431
432
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
432
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
433
433
434
434
// program Prg{Ctx};
435
435
436
436
// Prg.build_with_kernel_type<CacheTestKernel>("-g");
437
437
438
438
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
439
439
detail::KernelProgramCache::FastKernelCacheT &Cache =
440
- MockKernelProgramCache::getFastCache (CtxImpl-> getKernelProgramCache ());
440
+ MockKernelProgramCache::getFastCache (CtxImpl. getKernelProgramCache ());
441
441
EXPECT_EQ (Cache.size (), 1U ) << " Expect non-empty cache for kernels" ;
442
442
}
443
443
444
444
// Check that kernels built with compile options are not cached.
445
445
TEST_F (KernelAndProgramFastCacheTest, DISABLED_KernelNegativeCompileOpts) {
446
446
context Ctx{Plt};
447
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
447
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
448
448
449
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
449
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
450
450
451
451
// program Prg{Ctx};
452
452
453
453
// Prg.compile_with_kernel_type<CacheTestKernel>("-g");
454
454
// Prg.link();
455
455
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
456
456
detail::KernelProgramCache::FastKernelCacheT &Cache =
457
- MockKernelProgramCache::getFastCache (CtxImpl-> getKernelProgramCache ());
457
+ MockKernelProgramCache::getFastCache (CtxImpl. getKernelProgramCache ());
458
458
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
459
459
}
460
460
461
461
// Check that kernels built with link options are not cached.
462
462
TEST_F (KernelAndProgramFastCacheTest, DISABLED_KernelNegativeLinkOpts) {
463
463
context Ctx{Plt};
464
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
464
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
465
465
466
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
466
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
467
467
468
468
// program Prg{Ctx};
469
469
470
470
// Prg.compile_with_kernel_type<CacheTestKernel>();
471
471
// Prg.link("-g");
472
472
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
473
473
detail::KernelProgramCache::FastKernelCacheT &Cache =
474
- MockKernelProgramCache::getFastCache (CtxImpl-> getKernelProgramCache ());
474
+ MockKernelProgramCache::getFastCache (CtxImpl. getKernelProgramCache ());
475
475
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
476
476
}
477
477
478
478
// Check that kernels are not cached if program is created from multiple
479
479
// programs.
480
480
TEST_F (KernelAndProgramFastCacheTest, DISABLED_KernelNegativeLinkedProgs) {
481
481
context Ctx{Plt};
482
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
482
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
483
483
484
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
484
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
485
485
486
486
// program Prg1{Ctx};
487
487
// program Prg2{Ctx};
@@ -492,23 +492,23 @@ TEST_F(KernelAndProgramFastCacheTest, DISABLED_KernelNegativeLinkedProgs) {
492
492
// kernel Ker = Prg.get_kernel<CacheTestKernel>();
493
493
494
494
detail::KernelProgramCache::FastKernelCacheT &Cache =
495
- MockKernelProgramCache::getFastCache (CtxImpl-> getKernelProgramCache ());
495
+ MockKernelProgramCache::getFastCache (CtxImpl. getKernelProgramCache ());
496
496
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
497
497
}
498
498
499
499
// Check that kernels created from source are not cached.
500
500
TEST_F (KernelAndProgramFastCacheTest, DISABLED_KernelNegativeSource) {
501
501
context Ctx{Plt};
502
- auto CtxImpl = detail::getSyclObjImpl (Ctx);
502
+ detail::context_impl & CtxImpl = * detail::getSyclObjImpl (Ctx);
503
503
504
- globalCtx.reset (new TestCtx{CtxImpl-> getHandleRef ()});
504
+ globalCtx.reset (new TestCtx{CtxImpl. getHandleRef ()});
505
505
506
506
// program Prg{Ctx};
507
507
508
508
// Prg.build_with_source("");
509
509
// kernel Ker = Prg.get_kernel("test");
510
510
511
511
detail::KernelProgramCache::FastKernelCacheT &Cache =
512
- MockKernelProgramCache::getFastCache (CtxImpl-> getKernelProgramCache ());
512
+ MockKernelProgramCache::getFastCache (CtxImpl. getKernelProgramCache ());
513
513
EXPECT_EQ (Cache.size (), 0U ) << " Expect empty cache for kernels" ;
514
514
}
0 commit comments