@@ -479,22 +479,8 @@ TEST(NDA, MemoryHandleShared) {
479479}
480480
481481TEST (NDA, TypeAlignmentInfoAlignment) {
482- #ifdef __AVX512F__
483- constexpr size_t correct_alignment = 64 ;
484- #else
485- #ifdef __AVX__
486- constexpr size_t correct_alignment = 32 ;
487- #else
488- #ifdef __SSE2__
489- constexpr size_t correct_alignment = 16 ;
490- #else
491- constexpr size_t correct_alignment = 0 ;
492- #endif
493- #endif
494- #endif
495-
496482 auto x = mem::type_alignment_info<int >::required_alignment;
497- EXPECT_EQ (x, correct_alignment );
483+ EXPECT_EQ (x, native_simd< int >:: arch_type::alignment () );
498484
499485 x = mem::type_alignment_info<int *>::required_alignment;
500486 EXPECT_EQ (x, 0 );
@@ -503,44 +489,30 @@ TEST(NDA, TypeAlignmentInfoAlignment) {
503489 EXPECT_EQ (x, 0 );
504490
505491 x = mem::type_alignment_info<std::complex <float >>::required_alignment;
506- EXPECT_EQ (x, correct_alignment );
492+ EXPECT_EQ (x, native_simd<std:: complex < float >>:: arch_type::alignment () );
507493
508494 x = mem::type_alignment_info<std::complex <double >>::required_alignment;
509- EXPECT_EQ (x, correct_alignment );
495+ EXPECT_EQ (x, native_simd<std:: complex < double >>:: arch_type::alignment () );
510496
511497 x = mem::type_alignment_info<array<int , 4 >>::required_alignment;
512498 EXPECT_EQ (x, 0 );
513499}
514500
515501TEST (NDA, TypeAlignmentInfoRequiredPadding) {
516- #ifdef __AVX512F__
517- constexpr size_t correct_alignment = 64 ;
518- #else
519- #ifdef __AVX__
520- constexpr size_t correct_alignment = 32 ;
521- #else
522- #ifdef __SSE2__
523- constexpr size_t correct_alignment = 16 ;
524- #else
525- constexpr size_t correct_alignment = 0 ;
526- #endif
527- #endif
528- #endif
529-
530502 auto x = mem::type_alignment_info<int >::required_padding;
531- EXPECT_EQ (x, correct_alignment / sizeof ( int ) );
503+ EXPECT_EQ (x, native_simd< int >::size );
532504
533505 x = mem::type_alignment_info<long >::required_padding;
534- EXPECT_EQ (x, correct_alignment / sizeof ( long ) );
506+ EXPECT_EQ (x, native_simd< long >::size );
535507
536508 x = mem::type_alignment_info<void >::required_padding;
537509 EXPECT_EQ (x, 0 );
538510
539- // x = mem::type_alignment_info<std::complex<float>>::required_padding;
540- // EXPECT_EQ(x, correct_alignment / sizeof( std::complex<float>) );
541- //
542- // x = mem::type_alignment_info<std::complex<double>>::required_padding;
543- // EXPECT_EQ(x, correct_alignment / sizeof( std::complex<double>) );
511+ x = mem::type_alignment_info<std::complex <float >>::required_padding;
512+ EXPECT_EQ (x, native_simd< std::complex <float >>::size );
513+
514+ x = mem::type_alignment_info<std::complex <double >>::required_padding;
515+ EXPECT_EQ (x, native_simd< std::complex <double >>::size );
544516
545517 x = mem::type_alignment_info<array<int , 4 >>::required_padding;
546518 EXPECT_EQ (x, 0 );
0 commit comments