Skip to content
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

FFT api with custom allocators #9

Merged
merged 17 commits into from
Jul 20, 2021
Merged

FFT api with custom allocators #9

merged 17 commits into from
Jul 20, 2021

Conversation

Lagrang3
Copy link
Collaborator

No description provided.

@@ -354,7 +355,7 @@
// auto _1 = T{1};

int nbits = 0;
std::vector<T> e2{e};
::boost::container::static_vector<T,32> e2{e};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quickest way I found to get rid of heap memory here was to introduce the static_vector. I would have used an std::array but the class T doesn't necessarily have a default constructor.

@@ -273,8 +279,7 @@ namespace my_modulo_lib
public:
constexpr mint() : x{0} {}

template <typename int_type>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason having this template constructor breaks the compilation.

@Lagrang3
Copy link
Collaborator Author

Clang with gnu++2a is failing with once we added allocators. I will try to find a simple failing case to pinpoint the problem.

} // namespace detail

template<class RingType, class Allocator_t = std::allocator<RingType> >
using bsl_dft = detail::dft< detail::bsl_backend<RingType,Allocator_t> >;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that in order to accommodate the allocator template I've changed the API. We will come back very soon to review the state of the API to answer the comments on the previous PR.

void test_inverse(int N, int tolerance)
{
std::array<std::byte,200000> buf;
std::pmr::monotonic_buffer_resource
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the C++17 polymorphic memory resource (pmr) feature, creating custom allocators is very simple. Our custom allocator interface integrates with pmr out-of-the-box.

@Lagrang3 Lagrang3 merged commit e83ad6f into develop Jul 20, 2021
@Lagrang3 Lagrang3 deleted the fft-allocators branch August 14, 2021 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant