From 320584f4a5a07b5ff708ce569914418ce1b0b825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BDkora?= Date: Sat, 21 Oct 2023 23:07:35 +0200 Subject: [PATCH] Mark the cache/perf counter experiments as x86-64/Linux only. (#23) Mark the cache/perf counter experiments as x86-64/Linux only. * The experimental code depends on x86-64 specific intrinsics, and breaks the build on Apple silicon and other non-x86 platforms. * The perf counter access via the benchmark tool is Linux-specific. --- gematria/experiments/access_pattern_bm/BUILD | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gematria/experiments/access_pattern_bm/BUILD b/gematria/experiments/access_pattern_bm/BUILD index c971537b..6f05edf7 100644 --- a/gematria/experiments/access_pattern_bm/BUILD +++ b/gematria/experiments/access_pattern_bm/BUILD @@ -27,6 +27,10 @@ cc_library( srcs = ["linked_list.cc"], hdrs = ["linked_list.h"], copts = FEATURE_OPTS, + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], ) cc_test( @@ -49,6 +53,10 @@ cc_library( srcs = ["contiguous_matrix.cc"], hdrs = ["contiguous_matrix.h"], copts = FEATURE_OPTS, + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], deps = ["@com_google_absl//absl/base:core_headers"], ) @@ -72,6 +80,10 @@ cc_library( srcs = ["vec_of_vec_matrix.cc"], hdrs = ["vec_of_vec_matrix.h"], copts = FEATURE_OPTS, + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], deps = ["@com_google_absl//absl/base:core_headers"], ) @@ -99,6 +111,10 @@ cc_test( "stl_container_test.cc", ], copts = BALANCE_FLUSHING_TIME_OPTS + FEATURE_OPTS, # Since templated functions using _mm_clflushopt are defined in the header. + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], deps = [ "@com_github_google_benchmark//:benchmark_main", ], @@ -113,6 +129,10 @@ cc_test( "stl_assoc_container_test.cc", ], copts = BALANCE_FLUSHING_TIME_OPTS + FEATURE_OPTS, # Since templated functions using _mm_clflushopt are defined in the header. + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], deps = [ "@com_github_google_benchmark//:benchmark_main", ],