@@ -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_ranks , 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_ranks , 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,18 +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_ranks * (this ->num_ranks + 3 ) / 2 ,
435
- 3 };
436
- this ->cache .init (this ->ref , this ->default_global_size ,
437
- this ->default_local_size );
438
- 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_ranks * (this ->num_ranks + 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 );
439
439
auto array_ptr =
440
440
generic_accessor::get_workspace (this ->cache ).get_const_data ();
441
441
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
442
442
443
- this ->cache .init ( this -> ref , second_global_size, second_local_size);
444
- 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 );
445
445
446
446
ASSERT_NE (second_buffer, nullptr );
447
447
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (), second_global_size);
@@ -460,14 +460,16 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithSizeAndType)
460
460
{
461
461
using value_type = typename TestFixture::value_type;
462
462
using another_type = gko::next_precision<value_type>;
463
- this ->cache .init ( this -> ref , this -> default_global_size ,
464
- this ->default_local_size );
465
- 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 );
466
466
auto array_ptr =
467
467
generic_accessor::get_workspace (this ->cache ).get_const_data ();
468
468
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
469
469
470
- 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 );
471
473
472
474
ASSERT_NE (second_buffer, nullptr );
473
475
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (),
@@ -497,16 +499,16 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithDifferentExecutor)
497
499
{
498
500
using value_type = typename TestFixture::value_type;
499
501
auto another_ref = gko::ReferenceExecutor::create ();
500
- this ->cache .init ( this -> ref , this -> default_global_size ,
501
- this ->default_local_size );
502
- 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 );
503
505
auto array_ptr =
504
506
generic_accessor::get_workspace (this ->cache ).get_const_data ();
505
507
auto array_size = generic_accessor::get_workspace (this ->cache ).get_size ();
506
508
507
- this ->cache .init (another_ref, this -> default_global_size ,
508
- this ->default_local_size );
509
- 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 );
510
512
511
513
ASSERT_NE (second_buffer, nullptr );
512
514
GKO_ASSERT_EQUAL_DIMENSIONS (second_buffer->get_size (),
@@ -524,9 +526,9 @@ TYPED_TEST(GenericVectorCache, GenericCanInitWithDifferentExecutor)
524
526
TYPED_TEST (GenericVectorCache, WorkspaceIsNotCopied)
525
527
{
526
528
using value_type = typename TestFixture::value_type;
527
- this ->cache .init ( this -> ref , this -> default_global_size ,
528
- this ->default_local_size );
529
- 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 );
530
532
531
533
gko::experimental::distributed::detail::GenericVectorCache cache (
532
534
this ->cache );
@@ -539,9 +541,9 @@ TYPED_TEST(GenericVectorCache, WorkspaceIsNotCopied)
539
541
TYPED_TEST (GenericVectorCache, WorkspaceIsNotMoved)
540
542
{
541
543
using value_type = typename TestFixture::value_type;
542
- this ->cache .init ( this -> ref , this -> default_global_size ,
543
- this ->default_local_size );
544
- 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 );
545
547
546
548
gko::experimental::distributed::detail::GenericVectorCache cache (
547
549
std::move (this ->cache ));
@@ -554,9 +556,9 @@ TYPED_TEST(GenericVectorCache, WorkspaceIsNotMoved)
554
556
TYPED_TEST (GenericVectorCache, WorkspaceIsNotCopyAssigned)
555
557
{
556
558
using value_type = typename TestFixture::value_type;
557
- this ->cache .init ( this -> ref , this -> default_global_size ,
558
- this ->default_local_size );
559
- 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 );
560
562
gko::experimental::distributed::detail::GenericVectorCache cache;
561
563
562
564
cache = this ->cache ;
@@ -569,9 +571,9 @@ TYPED_TEST(GenericVectorCache, WorkspaceIsNotCopyAssigned)
569
571
TYPED_TEST (GenericVectorCache, WorkspaceIsNotMoveAssigned)
570
572
{
571
573
using value_type = typename TestFixture::value_type;
572
- this ->cache .init ( this -> ref , this -> default_global_size ,
573
- this ->default_local_size );
574
- 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 );
575
577
gko::experimental::distributed::detail::GenericVectorCache cache;
576
578
577
579
cache = std::move (this ->cache );
0 commit comments