@@ -359,10 +359,9 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithSize)
359
359
{
360
360
using value_type = typename TestFixture::value_type;
361
361
362
- this ->cache .init (this ->ref , this ->default_global_size ,
363
- this ->default_local_size );
364
- // only initialize when knowning the type
365
- auto buffer = this ->cache .template get <value_type>(this ->comm );
362
+ auto buffer = this ->cache .template get <value_type>(
363
+ this ->ref , this ->comm , this ->default_global_size ,
364
+ this ->default_local_size );
366
365
367
366
ASSERT_NE (buffer, nullptr );
368
367
GKO_ASSERT_EQUAL_DIMENSIONS (buffer->get_size (), this ->default_global_size );
@@ -376,14 +375,16 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithSize)
376
375
TYPED_TEST (GenericVectorCache, SecondInitWithSameSizeIsNoOp)
377
376
{
378
377
using value_type = typename TestFixture::value_type;
379
- this ->cache .init ( this -> ref , this -> default_global_size ,
380
- this ->default_local_size );
381
- auto buffer = this -> cache . template get <value_type>( this ->comm );
378
+ auto buffer = this ->cache .template get <value_type>(
379
+ this -> ref , this -> comm , this ->default_global_size ,
380
+ this ->default_local_size );
382
381
auto array_ptr =
383
382
generic_accessor::get_workspace (this ->cache ).get_const_data ();
384
383
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
385
384
386
- auto second_buffer = this ->cache .template get <value_type>(this ->comm );
385
+ auto second_buffer = this ->cache .template get <value_type>(
386
+ this ->ref , this ->comm , this ->default_global_size ,
387
+ this ->default_local_size );
387
388
388
389
ASSERT_NE (second_buffer, nullptr );
389
390
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (),
@@ -402,17 +403,17 @@ TYPED_TEST(GenericVectorCache, SecondInitWithSameSizeIsNoOp)
402
403
TYPED_TEST (GenericVectorCache, SecondInitWithTheSmallEqSizeIsNoOp)
403
404
{
404
405
using value_type = typename TestFixture::value_type;
405
- gko::dim<2 > second_local_size{ 1 , 1 } ;
406
- gko::dim<2 > second_global_size{ this ->num , 1 } ;
407
- this ->cache .init ( this -> ref , this -> default_global_size ,
408
- this ->default_local_size );
409
- auto buffer = this -> cache . template get <value_type>( this ->comm );
406
+ gko::dim<2 > second_local_size ( 1 , 1 ) ;
407
+ gko::dim<2 > second_global_size ( this ->num , 1 ) ;
408
+ auto buffer = this ->cache .template get <value_type>(
409
+ this -> ref , this -> comm , this ->default_global_size ,
410
+ this ->default_local_size );
410
411
auto array_ptr =
411
412
generic_accessor::get_workspace (this ->cache ).get_const_data ();
412
413
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
413
414
414
- this ->cache .init ( this -> ref , second_global_size, second_local_size);
415
- auto second_buffer = this ->cache . template get <value_type>( this ->comm );
415
+ auto second_buffer = this ->cache .template get <value_type>(
416
+ this ->ref , this ->comm , second_global_size, second_local_size );
416
417
417
418
ASSERT_NE (second_buffer, nullptr );
418
419
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (), second_global_size);
@@ -430,17 +431,17 @@ TYPED_TEST(GenericVectorCache, SecondInitWithTheSmallEqSizeIsNoOp)
430
431
TYPED_TEST (GenericVectorCache, SecondInitWithTheLargerSizeRecreate)
431
432
{
432
433
using value_type = typename TestFixture::value_type;
433
- gko::dim<2 > second_local_size{ this ->rank + 2 , 3 } ;
434
- gko::dim<2 > second_global_size{ this ->num * (this ->num + 3 ) / 2 , 3 } ;
435
- this ->cache .init ( this -> ref , this -> default_global_size ,
436
- this ->default_local_size );
437
- auto buffer = this -> cache . template get <value_type>( this ->comm );
434
+ gko::dim<2 > second_local_size ( this ->rank + 2 , 3 ) ;
435
+ gko::dim<2 > second_global_size ( this ->num * (this ->num + 3 ) / 2 , 3 ) ;
436
+ auto buffer = this ->cache .template get <value_type>(
437
+ this -> ref , this -> comm , this ->default_global_size ,
438
+ this ->default_local_size );
438
439
auto array_ptr =
439
440
generic_accessor::get_workspace (this ->cache ).get_const_data ();
440
441
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
441
442
442
- this ->cache .init ( this -> ref , second_global_size, second_local_size);
443
- auto second_buffer = this ->cache . template get <value_type>( this ->comm );
443
+ auto second_buffer = this ->cache .template get <value_type>(
444
+ this ->ref , this ->comm , second_global_size, second_local_size );
444
445
445
446
ASSERT_NE (second_buffer, nullptr );
446
447
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (), second_global_size);
@@ -459,14 +460,16 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithSizeAndType)
459
460
{
460
461
using value_type = typename TestFixture::value_type;
461
462
using another_type = gko::next_precision<value_type>;
462
- this ->cache .init ( this -> ref , this -> default_global_size ,
463
- this ->default_local_size );
464
- auto buffer = this -> cache . template get <value_type>( this ->comm );
463
+ auto buffer = this ->cache .template get <value_type>(
464
+ this -> ref , this -> comm , this ->default_global_size ,
465
+ this ->default_local_size );
465
466
auto array_ptr =
466
467
generic_accessor::get_workspace (this ->cache ).get_const_data ();
467
468
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
468
469
469
- auto second_buffer = this ->cache .template get <another_type>(this ->comm );
470
+ auto second_buffer = this ->cache .template get <another_type>(
471
+ this ->ref , this ->comm , this ->default_global_size ,
472
+ this ->default_local_size );
470
473
471
474
ASSERT_NE (second_buffer, nullptr );
472
475
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (),
@@ -496,16 +499,16 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithDifferentExecutor)
496
499
{
497
500
using value_type = typename TestFixture::value_type;
498
501
auto another_ref = gko::ReferenceExecutor::create ();
499
- this ->cache .init ( this -> ref , this -> default_global_size ,
500
- this ->default_local_size );
501
- auto buffer = this -> cache . template get <value_type>( this ->comm );
502
+ auto buffer = this ->cache .template get <value_type>(
503
+ this -> ref , this -> comm , this ->default_global_size ,
504
+ this ->default_local_size );
502
505
auto array_ptr =
503
506
generic_accessor::get_workspace (this ->cache ).get_const_data ();
504
507
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
505
508
506
- this ->cache .init (another_ref, this -> default_global_size ,
507
- this ->default_local_size );
508
- auto second_buffer = this -> cache . template get <value_type>( this ->comm );
509
+ auto second_buffer = this ->cache .template get <value_type>(
510
+ another_ref, this -> comm , this ->default_global_size ,
511
+ this ->default_local_size );
509
512
510
513
ASSERT_NE (second_buffer, nullptr );
511
514
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (),
@@ -523,9 +526,9 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithDifferentExecutor)
523
526
TYPED_TEST (GenericVectorCache, WorkspaceIsNotCopied)
524
527
{
525
528
using value_type = typename TestFixture::value_type;
526
- this ->cache .init ( this -> ref , this -> default_global_size ,
527
- this ->default_local_size );
528
- auto buffer = this -> cache . template get <value_type>( this ->comm );
529
+ auto buffer = this ->cache .template get <value_type>(
530
+ this -> ref , this -> comm , this ->default_global_size ,
531
+ this ->default_local_size );
529
532
530
533
gko::experimental::distributed::detail::GenericVectorCache cache (
531
534
this ->cache );
@@ -538,9 +541,9 @@ TYPED_TEST(GenericVectorCache, WorkspaceIsNotCopied)
538
541
TYPED_TEST (GenericVectorCache, WorkspaceIsNotMoved)
539
542
{
540
543
using value_type = typename TestFixture::value_type;
541
- this ->cache .init ( this -> ref , this -> default_global_size ,
542
- this ->default_local_size );
543
- auto buffer = this -> cache . template get <value_type>( this ->comm );
544
+ auto buffer = this ->cache .template get <value_type>(
545
+ this -> ref , this -> comm , this ->default_global_size ,
546
+ this ->default_local_size );
544
547
545
548
gko::experimental::distributed::detail::GenericVectorCache cache (
546
549
std::move (this ->cache ));
@@ -553,9 +556,9 @@ TYPED_TEST(GenericVectorCache, WorkspaceIsNotMoved)
553
556
TYPED_TEST (GenericVectorCache, WorkspaceIsNotCopyAssigned)
554
557
{
555
558
using value_type = typename TestFixture::value_type;
556
- this ->cache .init ( this -> ref , this -> default_global_size ,
557
- this ->default_local_size );
558
- auto buffer = this -> cache . template get <value_type>( this ->comm );
559
+ auto buffer = this ->cache .template get <value_type>(
560
+ this -> ref , this -> comm , this ->default_global_size ,
561
+ this ->default_local_size );
559
562
gko::experimental::distributed::detail::GenericVectorCache cache;
560
563
561
564
cache = this ->cache ;
@@ -568,9 +571,9 @@ TYPED_TEST(GenericVectorCache, WorkspaceIsNotCopyAssigned)
568
571
TYPED_TEST (GenericVectorCache, WorkspaceIsNotMoveAssigned)
569
572
{
570
573
using value_type = typename TestFixture::value_type;
571
- this ->cache .init ( this -> ref , this -> default_global_size ,
572
- this ->default_local_size );
573
- auto buffer = this -> cache . template get <value_type>( this ->comm );
574
+ auto buffer = this ->cache .template get <value_type>(
575
+ this -> ref , this -> comm , this ->default_global_size ,
576
+ this ->default_local_size );
574
577
gko::experimental::distributed::detail::GenericVectorCache cache;
575
578
576
579
cache = std::move (this ->cache );
0 commit comments