Skip to content

Commit

Permalink
Move to new SIMD methodology (#61)
Browse files Browse the repository at this point in the history
Move to a new SIMD methodology which allows arm64ec to use neon instructions while keeping our code mostly intact.
  • Loading branch information
baconpaul authored Nov 1, 2024
1 parent 6514385 commit fa419fd
Show file tree
Hide file tree
Showing 40 changed files with 2,691 additions and 1,074 deletions.
39 changes: 33 additions & 6 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,47 @@ on:

jobs:
build_tests:
name: Test ${{ matrix.os }}
name: Test ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: ubuntu-latest
name: linux
runTest: true
testExe: build/tests/sst-filters-tests

- os: macos-latest
name: mac
name: mac-x86
runTest: true
testExe: build/tests/sst-filters-tests
cmakeArgs: -DCMAKE_OSX_ARCHITECTURES=x86_64

- os: macos-latest
name: mac-arm
cmakeArgs: -DCMAKE_OSX_ARCHITECTURES=arm64

- os: macos-latest
name: mac-arm-nonative
cmakeArgs: -DCMAKE_OSX_ARCHITECTURES=arm64 -DSST_BASIC_BLOCKS_SIMD_OMIT_NATIVE_ALIASES=TRUE

- os: windows-latest
name: win-x86
runTest: true
testExe: build/tests/Release/sst-filters-tests.exe

- os: windows-latest
name: win-arm64
cmakeArgs: -G"Visual Studio 17 2022" -A arm64 -DCMAKE_SYSTEM_VERSION=10

- os: windows-latest
name: win-arm64ec
cmakeArgs: -G"Visual Studio 17 2022" -A arm64ec -DCMAKE_SYSTEM_VERSION=10

- os: windows-latest
name: win
testExe: build/tests/Release/sst-filters-tests.exe
name: win-arm64-non-native
cmakeArgs: -G"Visual Studio 17 2022" -A arm64 -DCMAKE_SYSTEM_VERSION=10 -DSST_BASIC_BLOCKS_SIMD_OMIT_NATIVE_ALIASES=TRUE

steps:

Expand All @@ -32,10 +58,11 @@ jobs:

- name: Build Smoke test
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DSST_FILTERS_BUILD_TESTS=TRUE -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DSST_FILTERS_BUILD_TESTS=TRUE ${{ matrix.cmakeArgs }}
cmake --build ./build --config Release
- name: Run Smoke Test
if: ${{ matrix.runTest }}m
run: |
ls ${{ matrix.testExe }}
${{ matrix.testExe }}
37 changes: 19 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ set(CMAKE_CXX_STANDARD 17)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE include)

if(MSVC)
if (MSVC)
target_compile_definitions(${PROJECT_NAME}
INTERFACE
INTERFACE
_USE_MATH_DEFINES=1 # So that we can have M_PI on MSVC
)
endif()
endif ()

add_library(${PROJECT_NAME}-extras INTERFACE)
target_include_directories(${PROJECT_NAME}-extras INTERFACE include-extras)
Expand All @@ -30,42 +30,43 @@ option(SST_FILTERS_BUILD_EXAMPLES "Add targets for building and running sst-filt
if (SST_FILTERS_BUILD_TESTS OR SST_FILTERS_BUILD_EXAMPLES)
message(STATUS "Importing SIMDE with CPM")

if (NOT TARGET sst-basic-blocks)
CPMAddPackage(NAME sst-basic-blocks
GITHUB_REPOSITORY surge-synthesizer/sst-basic-blocks
GIT_TAG main
)
endif()

if (NOT TARGET simde)
CPMAddPackage(NAME simde
GITHUB_REPOSITORY simd-everywhere/simde
VERSION 0.7.2
)
)
add_library(simde INTERFACE)
target_include_directories(simde INTERFACE ${simde_SOURCE_DIR})
endif()
endif ()

if (NOT TARGET sst-basic-blocks)
CPMAddPackage(NAME sst-basic-blocks
GITHUB_REPOSITORY surge-synthesizer/sst-basic-blocks
GIT_TAG main
)
endif ()
endif ()

if (SST_GET_BASIC_BLOCKS)
CPMAddPackage(NAME sst-basic-blocks
GITHUB_REPOSITORY surge-synthesizer/sst-basic-blocks
GIT_TAG main
)
endif()
)
endif ()

if (NOT TARGET sst-basic-blocks)
message(FATAL_ERROR "sst-basic-blocks is not available in this context. Set SST_GET_BASIC_BLOCKS=1 or add it")
else()
else ()
target_link_libraries(${PROJECT_NAME} INTERFACE sst-basic-blocks)
endif()
endif ()

if (SST_FILTERS_BUILD_TESTS)
message(STATUS "Adding test targets")
add_subdirectory(tests)
endif ()

if(SST_FILTERS_BUILD_EXAMPLES)
if (SST_FILTERS_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
endif ()


Loading

0 comments on commit fa419fd

Please sign in to comment.