Skip to content

Span API support #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/android-ndk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths-ignore: ["README.md"]

pull_request:
branches: [master]
branches: [master, develop]

env:
BUILD_TYPE: Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths-ignore: ["README.md"]

pull_request:
branches: [master]
branches: [master, develop]

env:
BUILD_TYPE: Debug
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths-ignore: ["README.md"]

pull_request:
branches: [master]
branches: [master, develop]

env:
BUILD_TYPE: Release
Expand Down
68 changes: 68 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"version": 8,
"cmakeMinimumRequired": {
"major": 3,
"minor": 18,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"DSPLIB_BUILD_TESTS": "OFF",
"DSPLIB_BUILD_BENCHS": "OFF",
"DSPLIB_BUILD_EXAMPLES": "OFF",
"DSPLIB_USE_FLOAT32": "OFF",
"DSPLIB_EXCLUDE_FFT": "OFF",
"DSPLIB_ASAN_ENABLED": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
},
"environment": {
"CC": "clang",
"CXX": "clang++"
},
"architecture": {
"value": "x64",
"strategy": "external"
}
},
{
"name": "tests",
"inherits": "default",
"cacheVariables": {
"DSPLIB_BUILD_TESTS": "ON",
"DSPLIB_ASAN_ENABLED": "ON"
}
},
{
"name": "benchs-float64",
"inherits": "default",
"cacheVariables": {
"DSPLIB_BUILD_BENCHS": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "benchs-float32",
"inherits": "default",
"cacheVariables": {
"DSPLIB_BUILD_BENCHS": "ON",
"CMAKE_BUILD_TYPE": "Release",
"DSPLIB_USE_FLOAT32": "ON"
}
},
{
"name": "examples",
"inherits": "default",
"cacheVariables": {
"DSPLIB_BUILD_EXAMPLES": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
}
]
}
6 changes: 3 additions & 3 deletions examples/fftw-backend/fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FFTWPlanC : public FftPlanC
fftw_free(in_);
}

dsplib::arr_cmplx solve(const dsplib::arr_cmplx& x) const final {
dsplib::arr_cmplx solve(span_t<cmplx_t> x) const final {
DSPLIB_ASSERT(x.size() == n_, "input size must be equal `n`");
std::memcpy(in_, x.data(), n_ * sizeof(x[0]));
fftw_execute(plan_);
Expand Down Expand Up @@ -66,7 +66,7 @@ class FFTWPlanR : public FftPlanR
fftw_free(in_);
}

dsplib::arr_cmplx solve(const dsplib::arr_real& x) const final {
dsplib::arr_cmplx solve(span_t<real_t> x) const final {
DSPLIB_ASSERT(x.size() == n_, "input size must be equal `n`");
std::memcpy(in_, x.data(), n_ * sizeof(x[0]));
fftw_execute(plan_);
Expand Down Expand Up @@ -105,7 +105,7 @@ class IFFTWPlanR : public IfftPlanR
fftw_free(in_);
}

dsplib::arr_real solve(const dsplib::arr_cmplx& x) const final {
dsplib::arr_real solve(span_t<cmplx_t> x) const final {
const int n2 = n_ / 2 + 1;
DSPLIB_ASSERT((x.size() == n_) || (x.size() == n2), "input size must be equal `n` or `n/2+1`");
std::memcpy(in_, x.data(), n2 * sizeof(x[0]));
Expand Down
Loading