Skip to content
Permalink
Browse files

Upgrade Windows CI to Clang 9, C API tests

  • Loading branch information
dlevin256 committed Dec 4, 2019
1 parent 59b0865 commit 663dc63501c39c60f5080963fd6dad594ab11030
Showing with 262 additions and 29 deletions.
  1. +6 −13 CMakeLists.txt
  2. +12 −12 azure-pipelines.yml
  3. +3 −0 capi/capi.cpp
  4. +5 −0 include/kfr/capi.h
  5. +14 −4 tests/CMakeLists.txt
  6. +222 −0 tests/capi_test.cpp
@@ -165,19 +165,6 @@ if (X86)
target_set_arch(detect_cpu PRIVATE generic)
endif ()

if (ENABLE_TESTS)

if (MSVC)
else()
# disable exceptions and rtti
add_compile_options(-fno-exceptions -fno-rtti -fno-asynchronous-unwind-tables)
endif ()

add_subdirectory(examples)
add_subdirectory(tests)
add_subdirectory(tools)
endif ()

if (ENABLE_DFT)
add_library(kfr_dft ${KFR_DFT_SRC})
target_link_libraries(kfr_dft kfr use_arch)
@@ -198,6 +185,12 @@ if (ENABLE_DFT)
endif ()
endif()

if (ENABLE_TESTS)
add_subdirectory(examples)
add_subdirectory(tests)
add_subdirectory(tools)
endif ()

add_library(kfr_io ${KFR_IO_SRC})
target_link_libraries(kfr_io kfr)

@@ -25,7 +25,7 @@ jobs:
mkdir "$(Agent.TempDirectory)/sde-bin"
tar -C "$(Agent.TempDirectory)/sde-bin" -xjf "$(Agent.TempDirectory)/sde.tar.bz2" --strip 1
sudo ln -s $(Agent.TempDirectory)/sde-bin/sde64 /usr/bin/sde
ci/run.sh build-release -DARCH_TESTS=sse2,sse3,sse41,avx,avx2,avx512 -DCPU_ARCH=detect -DUSE_SDE=ON -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_BUILD_TYPE=Release
ci/run.sh build-release -DENABLE_CAPI_BUILD=ON -DARCH_TESTS=sse2,sse3,sse41,avx,avx2,avx512 -DCPU_ARCH=detect -DUSE_SDE=ON -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_BUILD_TYPE=Release
- job: Linux_x86_64_GCC7
timeoutInMinutes: 120
@@ -133,7 +133,7 @@ jobs:
set -e
/bin/bash -c "sudo xcode-select -s /Applications/Xcode_11.2.app/Contents/Developer"
brew install ninja
ci/run.sh build-release -DARCH_TESTS=sse2,sse3,sse41,avx -DCMAKE_BUILD_TYPE=Release
ci/run.sh build-release -DENABLE_CAPI_BUILD=ON -DARCH_TESTS=sse2,sse3,sse41,avx -DCMAKE_BUILD_TYPE=Release
- job: iOS_ARM_Clang_Release
timeoutInMinutes: 120
@@ -185,7 +185,7 @@ jobs:
call "%ANDROID_HOME%\tools\bin\sdkmanager.bat" "ndk-bundle" < %TMP%\always_yes
ci\run.cmd build-release -DCMAKE_TOOLCHAIN_FILE="%ANDROID_HOME%\ndk-bundle\build\cmake\android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_ARM_NEON=TRUE -DSKIP_TESTS=ON -DCMAKE_BUILD_TYPE=Release
- job: Windows_MinGW_x86_Clang701_Release
- job: Windows_MinGW_x86_Clang9_Release
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
@@ -194,13 +194,13 @@ jobs:
choco uninstall mingw
choco install msys2
choco install ninja
choco install llvm --version 7.0.1
choco install llvm
set PATH=C:\ProgramData\Chocolatey\bin;C:\Program Files\CMake\bin;C:\tools\msys64\usr\local\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\mingw32\bin;C:\windows;C:\windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0
call C:\tools\msys64\msys2_shell.cmd -defterm -mingw32 -no-start -full-path -here -c "pacman -S --noconfirm mingw32/mingw-w64-i686-gcc"
call C:\tools\msys64\msys2_shell.cmd -defterm -mingw32 -no-start -full-path -here -c "pacman -S --noconfirm mingw32/mingw-w64-i686-ninja"
call C:\tools\msys64\msys2_shell.cmd -defterm -mingw32 -no-start -full-path -here -c "ci/run.sh build-release -DCMAKE_CXX_COMPILER='C:/Program Files/LLVM/bin/clang++.exe' -DCPU_ARCH=detect -DCMAKE_CXX_FLAGS=--target=i686-w64-windows-gnu -DCMAKE_BUILD_TYPE=Release"
- job: Windows_MinGW_x86_64_Clang701_Release
- job: Windows_MinGW_x86_64_Clang9_Release
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
@@ -209,20 +209,20 @@ jobs:
choco uninstall mingw
choco install msys2
choco install ninja
choco install llvm --version 7.0.1
choco install llvm
set PATH=C:\ProgramData\Chocolatey\bin;C:\Program Files\CMake\bin;C:\tools\msys64\usr\local\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\mingw64\bin;C:\windows;C:\windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0
call C:\tools\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -full-path -here -c "pacman -S --noconfirm mingw64/mingw-w64-x86_64-gcc"
call C:\tools\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -full-path -here -c "pacman -S --noconfirm mingw64/mingw-w64-x86_64-ninja"
call C:\tools\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -full-path -here -c "ci/run.sh build-release -DCMAKE_CXX_COMPILER='C:/Program Files/LLVM/bin/clang++.exe' -DCPU_ARCH=detect -DCMAKE_CXX_FLAGS=--target=x86_64-w64-windows-gnu -DCMAKE_BUILD_TYPE=Release"
- job: Windows_MSVC_x86_64_AVX512_Clang701_Release
- job: Windows_MSVC_x86_64_AVX512_Clang9_Release
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
steps:
- script: |
choco install ninja
choco install llvm --version 7.0.1
choco install llvm
curl -o "$(Agent.TempDirectory)/sde.zip" -L $(SDEURL)
"C:\Program Files\7-Zip\7z.exe" x -oC:\sde "$(Agent.TempDirectory)/sde.zip"
@@ -232,16 +232,16 @@ jobs:
set PATH=%PATH:C:\Program Files\Git\mingw64\bin;=%
set PATH=%PATH:C:\Strawberry\c\bin;=%
set PATH=C:\sde;%PATH%
ci\run.cmd build-release -DARCH_TESTS=ON -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DUSE_SDE=ON -DCPU_ARCH=avx512 -DCMAKE_CXX_FLAGS=-m64 -DCMAKE_BUILD_TYPE=Release
ci\run.cmd build-release -DENABLE_CAPI_BUILD=ON -DARCH_TESTS=ON -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DUSE_SDE=ON -DCPU_ARCH=avx512 -DCMAKE_CXX_FLAGS=-m64 -DCMAKE_BUILD_TYPE=Release
- job: Windows_MSVC_x86_AVX512_Clang701_Release
- job: Windows_MSVC_x86_AVX512_Clang9_Release
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
steps:
- script: |
choco install ninja
choco install llvm --version 7.0.1
choco install llvm
curl -o "$(Agent.TempDirectory)/sde.zip" -L $(SDEURL)
"C:\Program Files\7-Zip\7z.exe" x -oC:\sde "$(Agent.TempDirectory)/sde.zip"
@@ -291,7 +291,7 @@ jobs:
set PATH=C:\sde;%PATH%
ci\run.cmd build-release -DARCH_TESTS=OFF -DUSE_SDE=ON -DCPU_ARCH=avx512 -DENABLE_DFT=OFF -DCMAKE_BUILD_TYPE=Release
- job: Windows_MSVC2019_x86_64_Clang_Release
- job: Windows_MSVC2019_x86_64_Clang9_Release
timeoutInMinutes: 120
pool:
vmImage: 'windows-2019'
@@ -335,6 +335,9 @@ extern "C"
reinterpret_cast<filter<double>*>(plan)->apply(output, input, size);
}

void kfr_filter_reset_f32(KFR_FILTER_F32* plan) { reinterpret_cast<filter<float>*>(plan)->reset(); }
void kfr_filter_reset_f64(KFR_FILTER_F64* plan) { reinterpret_cast<filter<double>*>(plan)->reset(); }

void kfr_filter_delete_plan_f32(KFR_FILTER_F32* plan) { delete reinterpret_cast<filter<f32>*>(plan); }
void kfr_filter_delete_plan_f64(KFR_FILTER_F64* plan) { delete reinterpret_cast<filter<f64>*>(plan); }
}
@@ -89,9 +89,11 @@ extern "C"
#if defined __STDC_IEC_559_COMPLEX__ && !defined KFR_NO_C_COMPLEX_TYPES
typedef float _Complex kfr_c32;
typedef double _Complex kfr_c64;
#define KFR_COMPLEX_SIZE_MULTIPLIER 1
#else
typedef float kfr_c32;
typedef double kfr_c64;
#define KFR_COMPLEX_SIZE_MULTIPLIER 2
#endif
typedef size_t kfr_size_t;
typedef int32_t kfr_int32_t;
@@ -236,6 +238,9 @@ typedef double kfr_c64;
size_t size);
KFR_API_SPEC void kfr_filter_process_f64(KFR_FILTER_F64* plan, kfr_f64* output, const kfr_f64* input,
size_t size);

KFR_API_SPEC void kfr_filter_reset_f32(KFR_FILTER_F32* plan);
KFR_API_SPEC void kfr_filter_reset_f64(KFR_FILTER_F64* plan);

KFR_API_SPEC void kfr_filter_delete_plan_f32(KFR_FILTER_F32* plan);
KFR_API_SPEC void kfr_filter_delete_plan_f64(KFR_FILTER_F64* plan);
@@ -52,6 +52,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/bin)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tests/cmake/")

if (ENABLE_CAPI_BUILD)
add_executable(capi_test capi_test.cpp)
target_include_directories(capi_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include)
target_link_libraries(capi_test PUBLIC kfr_capi)
endif ()

if (ENABLE_ASMTEST)
add_executable(asm_test asm_test.cpp)
target_link_libraries(asm_test kfr)
@@ -202,19 +208,23 @@ if (NOT SKIP_TESTS)

if (X86)
add_test(NAME multiarch
COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/multiarch)
COMMAND ${EMULATOR} multiarch)

if (ENABLE_CAPI_BUILD)
add_test(NAME capi_test COMMAND ${EMULATOR} capi_test)
endif ()
endif ()

if (ARCH_TESTS)
foreach(A IN LISTS ARCH_LIST)
if (USE_SDE)
add_test(NAME all_tests_${A} COMMAND ${SDE} ${SDE_ARCH_${A}} -- ${PROJECT_BINARY_DIR}/bin/all_tests_${A})
add_test(NAME all_tests_${A} COMMAND ${SDE} ${SDE_ARCH_${A}} -- all_tests_${A})
else ()
add_test(NAME all_tests_${A} COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/all_tests_${A})
add_test(NAME all_tests_${A} COMMAND ${EMULATOR} all_tests_${A})
endif ()
endforeach()
else ()
add_test(NAME all_tests
COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/all_tests)
COMMAND ${EMULATOR} all_tests)
endif ()
endif ()

0 comments on commit 663dc63

Please sign in to comment.
You can’t perform that action at this time.