Skip to content

Commit

Permalink
Test SVE2
Browse files Browse the repository at this point in the history
  • Loading branch information
jfalcou committed Feb 1, 2024
1 parent 4577346 commit ca4dfb7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ jobs:
- { comp: gcc , arch: aarch64 , opts: -Wno-psabi, mode: Release }
- { comp: gcc , arch: aarch64.sve , opts: -Wno-psabi, mode: Debug }
- { comp: gcc , arch: aarch64.sve , opts: -Wno-psabi, mode: Release }
- { comp: gcc , arch: aarch64.sve2, opts: -Wno-psabi, mode: Debug }
- { comp: gcc , arch: aarch64.sve2, opts: -Wno-psabi, mode: Release }
- { comp: gcc , arch: ppc64 , opts: -Wno-psabi, mode: Debug }
- { comp: gcc , arch: ppc64 , opts: -Wno-psabi, mode: Release }
steps:
Expand Down
19 changes: 12 additions & 7 deletions test/simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ int main()
std::cout << "ARM SIMD status: " << std::boolalpha << (spy::simd_instruction_set == spy::arm_simd_ ) << std::endl;
std::cout << "NEON status: " << std::boolalpha << (spy::simd_instruction_set >= spy::neon_ ) << std::endl;
std::cout << "ASIMD status: " << std::boolalpha << (spy::simd_instruction_set >= spy::asimd_) << std::endl;
std::cout << "SVE status: " << std::boolalpha << (spy::simd_instruction_set >= spy::sve_);
if constexpr(spy::simd_instruction_set.has_fixed_cardinal())
{
std::cout << " - fixed size: " << spy::simd_instruction_set.width << " bits" << std::endl;
}
else

std::cout << "SVE status: " << std::boolalpha << (spy::simd_instruction_set == spy::sve_ ) << std::endl;
std::cout << "SVE status: " << std::boolalpha << (spy::simd_instruction_set == spy::sve2_) << std::endl;
if constexpr(spy::simd_instruction_set >= spy::sve_)
{
std::cout << " - flexible size" << std::endl;
if constexpr(spy::simd_instruction_set.has_fixed_cardinal())
{
std::cout << "SVE uses fixed size: " << spy::simd_instruction_set.width << " bits" << std::endl;
}
else
{
std::cout << "SVE uses flexible size" << std::endl;
}
}
}
std::cout << std::endl;
Expand Down
13 changes: 13 additions & 0 deletions test/toolchain/gcc.aarch64.sve2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
##==================================================================================================
## SPY - C++ Informations Broker
## Copyright : SPY Project Contributors
## SPDX-License-Identifier: BSL-1.0
##==================================================================================================
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc-12 )
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-12 )
set(CMAKE_CXX_FLAGS "-march=armv8-a+sve2 -msve-vector-bits=512" )

set(CMAKE_CROSSCOMPILING_CMD qemu-aarch64)

0 comments on commit ca4dfb7

Please sign in to comment.