Skip to content

Commit

Permalink
[3rdparty] Update KFR
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Apr 28, 2024
1 parent b3af159 commit c3f64e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/kfr
Submodule kfr updated 523 files
1 change: 1 addition & 0 deletions cmake/deps/kfr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ endif()
if(OSSIA_ENABLE_KFR)
if(NOT TARGET kfr)
add_subdirectory("${OSSIA_3RDPARTY_FOLDER}/kfr" "${CMAKE_CURRENT_BINARY_DIR}/kfr_build")
set_target_properties(kfr PROPERTIES UNITY_BUILD 0)
set_target_properties(kfr_dft PROPERTIES UNITY_BUILD 0)
endif()
endif()
Expand Down
7 changes: 4 additions & 3 deletions src/ossia/audio/fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,18 @@ namespace ossia
{
static_assert(sizeof(kfr::c64) == sizeof(fft_complex));
static const constexpr auto fft_real_allocator = pod_allocator_avx2<kfr::f64>{};
static const constexpr auto fft_cplx_allocator = pod_allocator_avx2<kfr::c64>{};

static const constexpr auto alloc_real
= [](std::size_t sz) { return fft_real_allocator.allocate(sz); };
// FIXME KFR 6: no more pod
static const constexpr auto alloc_complex
= [](std::size_t sz) { return fft_cplx_allocator.allocate(sz); };
= [](std::size_t sz) { return std::allocator<kfr::c64>{}.allocate(sz); };
static const constexpr struct
{
void operator()(fft_real* p) const noexcept { fft_real_allocator.deallocate(p, 0); }
void operator()(fft_complex* p) const noexcept
{
fft_cplx_allocator.deallocate(reinterpret_cast<kfr::c64*>(p), 0);
std::allocator<kfr::c64>{}.deallocate(reinterpret_cast<kfr::c64*>(p), 0);
}
} fft_free;
static const constexpr auto create_plan_r2c
Expand Down

0 comments on commit c3f64e4

Please sign in to comment.