diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a4bf741911..1336255897f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -644,8 +644,13 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS) apply_folly_compile_options_to_target(folly_test_support) folly_define_tests( + DIRECTORY algorithm/simd/detail/test/ + TEST unroll_utils_test SOURCES UnrollUtilsTest.cpp + DIRECTORY algorithm/simd/test/ TEST find_fixed_test SOURCES FindFixedTest.cpp + TEST movemask_test SOURCES MovemaskTest.cpp + TEST simd_for_each_test SOURCES SimdForEachTest.cpp DIRECTORY chrono/test/ TEST chrono_conv_test WINDOWS_DISABLED @@ -712,9 +717,6 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS) DIRECTORY detail/test/ TEST static_singleton_manager_test SOURCES StaticSingletonManagerTest.cpp - DIRECTORY detail/test/ - TEST simd_for_each_test SOURCES SimdForEachTest.cpp - DIRECTORY detail/test/ TEST simple_simd_string_utils_test SOURCES SimpleSimdStringUtilsTest.cpp @@ -722,9 +724,6 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS) TEST split_string_simd_test WINDOWS_DISABLED SOURCES SplitStringSimdTest.cpp - DIRECTORY detail/test/ - TEST unroll_utils_test SOURCES UnrollUtilsTest.cpp - DIRECTORY detail/base64_detail/tests/ TEST base64_detail_test WINDOWS_DISABLED SOURCES diff --git a/folly/algorithm/simd/BUCK b/folly/algorithm/simd/BUCK index c1057ab4e84..13e16f1697f 100644 --- a/folly/algorithm/simd/BUCK +++ b/folly/algorithm/simd/BUCK @@ -21,3 +21,12 @@ cpp_library( "//folly:portability", ], ) + +cpp_library( + name = "simd_for_each", + headers = ["SimdForEach.h"], + exported_deps = [ + "//folly:c_portability", + "//folly/algorithm/simd/detail:unroll_utils", + ], +) diff --git a/folly/detail/SimdForEach.h b/folly/algorithm/simd/SimdForEach.h similarity index 99% rename from folly/detail/SimdForEach.h rename to folly/algorithm/simd/SimdForEach.h index 482d3733353..a00c9186f36 100644 --- a/folly/detail/SimdForEach.h +++ b/folly/algorithm/simd/SimdForEach.h @@ -17,7 +17,7 @@ #pragma once #include -#include +#include #include #include diff --git a/folly/algorithm/simd/detail/BUCK b/folly/algorithm/simd/detail/BUCK new file mode 100644 index 00000000000..d62a470ff0c --- /dev/null +++ b/folly/algorithm/simd/detail/BUCK @@ -0,0 +1,14 @@ +###################################################################### +# Libraries + +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") + +oncall("fbcode_entropy_wardens_folly") + +cpp_library( + name = "unroll_utils", + headers = ["UnrollUtils.h"], + exported_deps = [ + "//folly:portability", + ], +) diff --git a/folly/detail/UnrollUtils.h b/folly/algorithm/simd/detail/UnrollUtils.h similarity index 100% rename from folly/detail/UnrollUtils.h rename to folly/algorithm/simd/detail/UnrollUtils.h diff --git a/folly/algorithm/simd/detail/test/BUCK b/folly/algorithm/simd/detail/test/BUCK new file mode 100644 index 00000000000..a0e1035ad1a --- /dev/null +++ b/folly/algorithm/simd/detail/test/BUCK @@ -0,0 +1,14 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("fbcode_entropy_wardens_folly") + +cpp_unittest( + name = "unroll_utils_test", + srcs = [ + "UnrollUtilsTest.cpp", + ], + deps = [ + "//folly/algorithm/simd/detail:unroll_utils", + "//folly/portability:gtest", + ], +) diff --git a/folly/detail/test/UnrollUtilsTest.cpp b/folly/algorithm/simd/detail/test/UnrollUtilsTest.cpp similarity index 98% rename from folly/detail/test/UnrollUtilsTest.cpp rename to folly/algorithm/simd/detail/test/UnrollUtilsTest.cpp index 0281ea63974..f1ac3199f79 100644 --- a/folly/detail/test/UnrollUtilsTest.cpp +++ b/folly/algorithm/simd/detail/test/UnrollUtilsTest.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include diff --git a/folly/algorithm/simd/test/BUCK b/folly/algorithm/simd/test/BUCK index 8df0df3e2b4..c1c310058c0 100644 --- a/folly/algorithm/simd/test/BUCK +++ b/folly/algorithm/simd/test/BUCK @@ -36,3 +36,12 @@ cpp_benchmark( "//folly/init:init", ], ) + +cpp_unittest( + name = "simd_for_each_test", + srcs = ["SimdForEachTest.cpp"], + deps = [ + "//folly/algorithm/simd:simd_for_each", + "//folly/portability:gtest", + ], +) diff --git a/folly/detail/test/SimdForEachTest.cpp b/folly/algorithm/simd/test/SimdForEachTest.cpp similarity index 99% rename from folly/detail/test/SimdForEachTest.cpp rename to folly/algorithm/simd/test/SimdForEachTest.cpp index 4f6578c1316..394d8627d6a 100644 --- a/folly/detail/test/SimdForEachTest.cpp +++ b/folly/algorithm/simd/test/SimdForEachTest.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include diff --git a/folly/detail/BUCK b/folly/detail/BUCK index d13686a0067..3397bac491f 100644 --- a/folly/detail/BUCK +++ b/folly/detail/BUCK @@ -244,9 +244,9 @@ cpp_library( name = "simd_char_platform", headers = ["SimdCharPlatform.h"], exported_deps = [ - ":simd_for_each", "//folly:portability", "//folly/algorithm/simd:movemask", + "//folly/algorithm/simd:simd_for_each", "//folly/lang:bits", ], ) @@ -255,19 +255,15 @@ cpp_library( name = "simd_any_of", headers = ["SimdAnyOf.h"], exported_deps = [ - ":simd_for_each", - ":unroll_utils", "//folly:c_portability", + "//folly/algorithm/simd:simd_for_each", + "//folly/algorithm/simd/detail:unroll_utils", ], ) cpp_library( name = "simd_for_each", headers = ["SimdForEach.h"], - exported_deps = [ - ":unroll_utils", - "//folly:c_portability", - ], ) cpp_library( @@ -298,9 +294,9 @@ cpp_library( ], exported_deps = [ ":simd_char_platform", - ":simd_for_each", "//folly:portability", "//folly:range", + "//folly/algorithm/simd:simd_for_each", "//folly/lang:bits", ], ) @@ -417,14 +413,6 @@ cpp_library( ], ) -cpp_library( - name = "unroll_utils", - headers = ["UnrollUtils.h"], - exported_deps = [ - "//folly:portability", - ], -) - cpp_library( name = "traponavx512", srcs = ["TrapOnAvx512.cpp"], diff --git a/folly/detail/SimdAnyOf.h b/folly/detail/SimdAnyOf.h index 9b240320623..3c3b42a704e 100644 --- a/folly/detail/SimdAnyOf.h +++ b/folly/detail/SimdAnyOf.h @@ -17,8 +17,8 @@ #pragma once #include -#include -#include +#include +#include namespace folly { namespace simd_detail { diff --git a/folly/detail/SimdCharPlatform.h b/folly/detail/SimdCharPlatform.h index dae27fe76c0..268e3b4603d 100644 --- a/folly/detail/SimdCharPlatform.h +++ b/folly/detail/SimdCharPlatform.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/folly/detail/SplitStringSimdImpl.h b/folly/detail/SplitStringSimdImpl.h index 9bec8a53475..e2dae8e5572 100644 --- a/folly/detail/SplitStringSimdImpl.h +++ b/folly/detail/SplitStringSimdImpl.h @@ -18,8 +18,8 @@ #include #include +#include #include -#include #include #if FOLLY_X64 diff --git a/folly/detail/test/BUCK b/folly/detail/test/BUCK index 1590a027bd9..013c53c96e0 100644 --- a/folly/detail/test/BUCK +++ b/folly/detail/test/BUCK @@ -71,17 +71,6 @@ cpp_unittest( ], ) -cpp_unittest( - name = "simd_for_each_test", - srcs = [ - "SimdForEachTest.cpp", - ], - deps = [ - "//folly/detail:simd_for_each", - "//folly/portability:gtest", - ], -) - cpp_unittest( name = "simple_simd_string_utils_test", srcs = [ @@ -109,17 +98,6 @@ cpp_unittest( ], ) -cpp_unittest( - name = "unroll_utils_test", - srcs = [ - "UnrollUtilsTest.cpp", - ], - deps = [ - "//folly/detail:unroll_utils", - "//folly/portability:gtest", - ], -) - cpp_unittest( name = "thread_local_detail_test", srcs = [ diff --git a/folly/somerge_defs.bzl b/folly/somerge_defs.bzl index 159337bd83d..d68e243a021 100644 --- a/folly/somerge_defs.bzl +++ b/folly/somerge_defs.bzl @@ -2,7 +2,7 @@ Generated by xplat/cross_plat_devx/somerge_maps/compute_merge_maps.py -@generated SignedSource<<8d3c487799486097777ae89d92b52656>> +@generated SignedSource<> """ # Entry Points: @@ -90,7 +90,9 @@ FOLLY_NATIVE_LIBRARY_MERGE_MAP = [ # //xplat/folly:logging_init # //xplat/folly:uri FOLLY_BASE_NATIVE_LIBRARY_MERGE_MAP = [ + "fbsource//xplat/folly/algorithm/simd/detail:unroll_utilsAndroid", "fbsource//xplat/folly/algorithm/simd:movemaskAndroid", + "fbsource//xplat/folly/algorithm/simd:simd_for_eachAndroid", "fbsource//xplat/folly/chrono:hardwareAndroid", "fbsource//xplat/folly/compression:compressionAndroid", "fbsource//xplat/folly/compression:compression_context_poolAndroid", @@ -139,7 +141,6 @@ FOLLY_BASE_NATIVE_LIBRARY_MERGE_MAP = [ "fbsource//xplat/folly/detail:memory_idlerAndroid", "fbsource//xplat/folly/detail:simd_any_ofAndroid", "fbsource//xplat/folly/detail:simd_char_platformAndroid", - "fbsource//xplat/folly/detail:simd_for_eachAndroid", "fbsource//xplat/folly/detail:simple_simd_string_utilsAndroid", "fbsource//xplat/folly/detail:singletonAndroid", "fbsource//xplat/folly/detail:socket_fast_openAndroid", @@ -149,7 +150,6 @@ FOLLY_BASE_NATIVE_LIBRARY_MERGE_MAP = [ "fbsource//xplat/folly/detail:thread_local_globalsAndroid", "fbsource//xplat/folly/detail:turn_sequencerAndroid", "fbsource//xplat/folly/detail:unique_instanceAndroid", - "fbsource//xplat/folly/detail:unroll_utilsAndroid", "fbsource//xplat/folly/executors/task_queue:blocking_queueAndroid", "fbsource//xplat/folly/executors/task_queue:lifo_sem_mpmc_queueAndroid", "fbsource//xplat/folly/executors/task_queue:priority_lifo_sem_mpmc_queueAndroid",