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

Use default arch alignment as default alignment for xsimd::aligned_al… #1082

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/xsimd_benchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace xsimd
using duration_type = std::chrono::duration<double, std::milli>;

template <class T>
using bench_vector = std::vector<T, xsimd::aligned_allocator<T, default_arch::alignment()>>;
using bench_vector = std::vector<T, xsimd::aligned_allocator<T>>;

template <class T>
void init_benchmark(bench_vector<T>& lhs, bench_vector<T>& rhs, bench_vector<T>& res, size_t size)
Expand Down
2 changes: 1 addition & 1 deletion examples/mandelbrot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ int main()
const float y1 = 1;
const int maxIters = 256;

std::vector<int, xsimd::aligned_allocator<int, xsimd::default_arch::alignment()>> buf(width * height);
std::vector<int, xsimd::aligned_allocator<int>> buf(width * height);

auto bencher = pico_bench::Benchmarker<milliseconds> { 64, seconds { 10 } };

Expand Down
2 changes: 1 addition & 1 deletion include/xsimd/memory/xsimd_aligned_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace xsimd
* @tparam T type of objects to allocate.
* @tparam Align alignment in bytes.
*/
template <class T, size_t Align>
template <class T, size_t Align = std::conditional<std::is_same<unsupported, default_arch>::value, generic, default_arch>::type::alignment()>
class aligned_allocator
{
public:
Expand Down
Loading