Skip to content

Commit

Permalink
migrate simdForEach #1
Browse files Browse the repository at this point in the history
Summary:
Moving simdForEachAligning into folly/algorithm/simd.

Step 1. Just move the files.

Reviewed By: dmm-fb

Differential Revision: D59680837

fbshipit-source-id: ad04d5a881bf8dbda186d1fd5cb943dae011e7ac
  • Loading branch information
DenisYaroshevskiy authored and facebook-github-bot committed Aug 2, 2024
1 parent 558f312 commit 04dc57e
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 54 deletions.
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -712,19 +717,13 @@ 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

DIRECTORY detail/test/
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
Expand Down
9 changes: 9 additions & 0 deletions folly/algorithm/simd/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#pragma once

#include <folly/CPortability.h>
#include <folly/detail/UnrollUtils.h>
#include <folly/algorithm/simd/detail/UnrollUtils.h>

#include <array>
#include <cstdint>
Expand Down
14 changes: 14 additions & 0 deletions folly/algorithm/simd/detail/BUCK
Original file line number Diff line number Diff line change
@@ -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",
],
)
File renamed without changes.
14 changes: 14 additions & 0 deletions folly/algorithm/simd/detail/test/BUCK
Original file line number Diff line number Diff line change
@@ -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",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <folly/detail/UnrollUtils.h>
#include <folly/algorithm/simd/detail/UnrollUtils.h>

#include <folly/portability/GTest.h>

Expand Down
9 changes: 9 additions & 0 deletions folly/algorithm/simd/test/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <folly/detail/SimdForEach.h>
#include <folly/algorithm/simd/SimdForEach.h>

#include <folly/portability/GTest.h>

Expand Down
20 changes: 4 additions & 16 deletions folly/detail/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
Expand All @@ -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(
Expand Down Expand Up @@ -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",
],
)
Expand Down Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions folly/detail/SimdAnyOf.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#pragma once

#include <folly/CPortability.h>
#include <folly/detail/SimdForEach.h>
#include <folly/detail/UnrollUtils.h>
#include <folly/algorithm/simd/SimdForEach.h>
#include <folly/algorithm/simd/detail/UnrollUtils.h>

namespace folly {
namespace simd_detail {
Expand Down
2 changes: 1 addition & 1 deletion folly/detail/SimdCharPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <folly/Portability.h>
#include <folly/algorithm/simd/Movemask.h>
#include <folly/detail/SimdForEach.h>
#include <folly/algorithm/simd/SimdForEach.h>
#include <folly/lang/Bits.h>

#include <array>
Expand Down
2 changes: 1 addition & 1 deletion folly/detail/SplitStringSimdImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#include <folly/Portability.h>
#include <folly/Range.h>
#include <folly/algorithm/simd/SimdForEach.h>
#include <folly/detail/SimdCharPlatform.h>
#include <folly/detail/SimdForEach.h>
#include <folly/lang/Bits.h>

#if FOLLY_X64
Expand Down
22 changes: 0 additions & 22 deletions folly/detail/test/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 = [
Expand Down
6 changes: 3 additions & 3 deletions folly/somerge_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Generated by xplat/cross_plat_devx/somerge_maps/compute_merge_maps.py
@generated SignedSource<<8d3c487799486097777ae89d92b52656>>
@generated SignedSource<<d8267d0d95f80596336a16cb4006b97d>>
"""

# Entry Points:
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 04dc57e

Please sign in to comment.