Skip to content

Commit 022ea0d

Browse files
committed
Rename builder.hpp > map.hpp
1 parent ee1498e commit 022ea0d

10 files changed

Lines changed: 33 additions & 33 deletions

File tree

‎benchmark/bench_map_unary.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <benchmark/benchmark.h>
1212

1313
#include "map_unary_utils.hpp"
14-
#include "xsimd_algorithm/builder.hpp"
14+
#include "xsimd_algorithm/map.hpp"
1515
#include "xsimd_test_utils/map_unary_data.hpp"
1616
#include "xsimd_test_utils/utils.hpp"
1717

@@ -21,8 +21,8 @@ namespace
2121
using xsimd::bench::bench_scalar;
2222
using xsimd::bench::bench_transform;
2323
using xsimd::bench::register_bench;
24-
using xsimd::builder::alignment_options;
25-
using xsimd::builder::map_options;
24+
using xsimd::alignment_options;
25+
using xsimd::map_options;
2626

2727
template <typename Op>
2828
void register_benches()

‎benchmark/bench_math.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace
1919
using xsimd::bench::bench_map_unary;
2020
using xsimd::bench::bench_scalar;
2121
using xsimd::bench::register_bench;
22-
using xsimd::builder::alignment_options;
22+
using xsimd::alignment_options;
2323

2424
/// Register math benchmarks.
2525
///

‎benchmark/map_unary_utils.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#include <benchmark/benchmark.h>
1616

1717
#include "bench_utils.hpp"
18-
#include "xsimd_algorithm/builder.hpp"
18+
#include "xsimd_algorithm/map.hpp"
1919
#include "xsimd_test_utils/utils.hpp"
2020

2121
namespace xsimd::bench
2222
{
23-
using xsimd::builder::alignment_options;
24-
using xsimd::builder::map_options;
23+
using xsimd::alignment_options;
24+
using xsimd::map_options;
2525

2626
template <typename Op, typename Alloc, typename Apply>
2727
void bench_unary(benchmark::State& state, Apply apply)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* The full license is in the file LICENSE, distributed with this software. *
77
****************************************************************************/
88

9-
#ifndef XSIMD_ALGORITHM_BUILDER_HPP
10-
#define XSIMD_ALGORITHM_BUILDER_HPP
9+
#ifndef XSIMD_ALGORITHM_MAP_HPP
10+
#define XSIMD_ALGORITHM_MAP_HPP
1111

1212
#include <algorithm>
1313
#include <array>
@@ -23,7 +23,7 @@
2323

2424
#include "./macros.hpp"
2525

26-
namespace xsimd::builder
26+
namespace xsimd
2727
{
2828
/// Return the pointer before the input with the given alignment or itself if aligned.
2929
template <typename T>

‎include/xsimd_algorithm/math.hpp‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,42 @@
1111

1212
#include <xsimd/xsimd.hpp>
1313

14-
#include "./builder.hpp"
14+
#include "./map.hpp"
1515

1616
namespace xsimd::algo
1717
{
1818
template <
19-
xsimd::builder::alignment_options align = xsimd::builder::alignment_options{},
19+
xsimd::alignment_options align = xsimd::alignment_options{},
2020
typename Arch = xsimd::default_arch,
2121
typename T>
2222
void sqrt(std::span<T const> in, std::span<T> out)
2323
{
24-
constexpr builder::map_options opts = { .unroll_factor = 4, .pure = true };
25-
return xsimd::builder::map_unary<align, opts, Arch>(
24+
constexpr map_options opts = { .unroll_factor = 4, .pure = true };
25+
return xsimd::map_unary<align, opts, Arch>(
2626
in, out, [](auto x)
2727
{ return sqrt(x); });
2828
}
2929

3030
template <
31-
xsimd::builder::alignment_options align = xsimd::builder::alignment_options{},
31+
xsimd::alignment_options align = xsimd::alignment_options{},
3232
typename Arch = xsimd::default_arch,
3333
typename T>
3434
void abs(std::span<T const> in, std::span<T> out)
3535
{
36-
constexpr builder::map_options opts = { .unroll_factor = 4, .pure = true };
37-
return xsimd::builder::map_unary<align, opts, Arch>(
36+
constexpr map_options opts = { .unroll_factor = 4, .pure = true };
37+
return xsimd::map_unary<align, opts, Arch>(
3838
in, out, [](auto x)
3939
{ return abs(x); });
4040
}
4141

4242
template <
43-
xsimd::builder::alignment_options align = xsimd::builder::alignment_options{},
43+
xsimd::alignment_options align = xsimd::alignment_options{},
4444
typename Arch = xsimd::default_arch,
4545
typename T>
4646
void exp(std::span<T const> in, std::span<T> out)
4747
{
48-
constexpr builder::map_options opts = { .unroll_factor = 4, .pure = true };
49-
return xsimd::builder::map_unary<align, opts, Arch>(
48+
constexpr map_options opts = { .unroll_factor = 4, .pure = true };
49+
return xsimd::map_unary<align, opts, Arch>(
5050
in, out, [](auto x)
5151
{ return exp(x); });
5252
}

‎test-utils/include/xsimd_test_utils/map_unary_data.hpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
#include <utility>
1717
#include <vector>
1818

19-
#include "xsimd_algorithm/builder.hpp"
19+
#include "xsimd_algorithm/map.hpp"
2020
#include "xsimd_algorithm/stl/transform.hpp"
2121

2222
#include "xsimd_test_utils/utils.hpp"
2323

2424
namespace xsimd::test
2525
{
26-
using xsimd::builder::alignment_options;
27-
using xsimd::builder::map_options;
26+
using xsimd::alignment_options;
27+
using xsimd::map_options;
2828

2929
/// Derives the scalar range application from the element-wise Derived::apply.
3030
template <typename Derived, typename In, typename Out = In>
@@ -51,7 +51,7 @@ namespace xsimd::test
5151
typename Arch = xsimd::default_arch>
5252
static void range_apply_map_unary(std::span<input_t const> in, std::span<output_t> out)
5353
{
54-
return xsimd::builder::map_unary<aligned, opts, Arch>(
54+
return xsimd::map_unary<aligned, opts, Arch>(
5555
in, out, [](auto x)
5656
{ return Derived::apply_batch(x); });
5757
}

‎test-utils/include/xsimd_test_utils/math_ops.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <span>
1515
#include <vector>
1616

17-
#include <xsimd_algorithm/builder.hpp>
17+
#include <xsimd_algorithm/map.hpp>
1818
#include <xsimd_algorithm/math.hpp>
1919

2020
#include "xsimd_test_utils/utils.hpp"
@@ -28,7 +28,7 @@ namespace xsimd::test
2828

2929
static constexpr auto name = "sqrt";
3030

31-
template <xsimd::builder::alignment_options aligned = xsimd::builder::alignment_options{}>
31+
template <xsimd::alignment_options aligned = xsimd::alignment_options{}>
3232
static void apply(std::span<T const> in, std::span<T> out)
3333
{
3434
xsimd::algo::sqrt<aligned>(in, out);
@@ -53,7 +53,7 @@ namespace xsimd::test
5353

5454
static constexpr auto name = "abs";
5555

56-
template <xsimd::builder::alignment_options aligned = xsimd::builder::alignment_options{}>
56+
template <xsimd::alignment_options aligned = xsimd::alignment_options{}>
5757
static void apply(std::span<T const> in, std::span<T> out)
5858
{
5959
xsimd::algo::abs<aligned>(in, out);

‎test/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ endif()
4848
set(XSIMD_ALGORITHM_TESTS
4949
main.cpp
5050
test_arange.cpp
51-
test_builder.cpp
51+
test_map.cpp
5252
test_iterator.cpp
5353
test_math.cpp
5454
test_reduce.cpp
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <doctest/doctest.h>
1414
#include <xsimd_test_utils/utils.hpp>
1515

16-
#include "xsimd_algorithm/builder.hpp"
16+
#include "xsimd_algorithm/map.hpp"
1717

1818
/// Map unary test where one input batch pairs with two output batches.
1919
TEST_CASE("map_unary int32 to int64")
@@ -30,7 +30,7 @@ TEST_CASE("map_unary int32 to int64")
3030
const auto func = [](auto const& x)
3131
{ return xsimd::widen(x + input_type { 1 }); };
3232

33-
xsimd::builder::map_unary(input, output, func);
33+
xsimd::map_unary(input, output, func);
3434

3535
for (std::size_t i = 0; i < size; ++i)
3636
{
@@ -71,7 +71,7 @@ TEST_CASE("map_unary int64 to int32")
7171
xsimd::make_batch_constant<std::uint32_t, low_halves>());
7272
};
7373

74-
xsimd::builder::map_unary(xsimd::test::as_span(input), xsimd::test::as_span(output), func);
74+
xsimd::map_unary(xsimd::test::as_span(input), xsimd::test::as_span(output), func);
7575

7676
for (std::size_t i = 0; i < size; ++i)
7777
{

‎test/test_math.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace
1818
{
19-
template <typename Op, typename Alloc, xsimd::builder::alignment_options aligned = xsimd::builder::alignment_options {}>
19+
template <typename Op, typename Alloc, xsimd::alignment_options aligned = xsimd::alignment_options {}>
2020
void check_unary_math()
2121
{
2222
// Not a multiple of the batch size, to exercise the tail.
@@ -58,7 +58,7 @@ TEST_CASE_TEMPLATE(
5858

5959
SUBCASE("aligned without header")
6060
{
61-
check_unary_math<Op, aligned_allocator, xsimd::builder::alignment_options { .start_aligned = true }>();
61+
check_unary_math<Op, aligned_allocator, xsimd::alignment_options { .start_aligned = true }>();
6262
}
6363

6464
SUBCASE("aligned with header")

0 commit comments

Comments
 (0)