Fix copyright lines for Bits.h and move BitsBenchmark.cpp
authorYedidya Feldblum <yfeldblum@fb.com>
Tue, 2 Jan 2018 00:46:40 +0000 (16:46 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 2 Jan 2018 00:52:04 +0000 (16:52 -0800)
Summary: [Folly] Fix copyright lines for `Bits.h` and move `BitsBenchmark.cpp`.

Reviewed By: spalamarchuk

Differential Revision: D6648828

fbshipit-source-id: 5eed558ac2d47a1497d64173bc84a4ca27d79764

folly/lang/Bits.h
folly/lang/test/BitsBenchmark.cpp [new file with mode: 0644]
folly/lang/test/BitsTest.cpp
folly/test/BitsBenchmark.cpp [deleted file]
folly/test/Makefile.am

index 889b3a0b0c2d6852cef8a0c9c623b6806a123ee8..b0af3714bf0f8185f5c3d96872eb69e1e61dedd1 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2011-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/folly/lang/test/BitsBenchmark.cpp b/folly/lang/test/BitsBenchmark.cpp
new file mode 100644 (file)
index 0000000..754cf00
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2016-present Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// @author Tudor Bosman (tudorb@fb.com)
+
+#include <folly/lang/Bits.h>
+
+#include <folly/Benchmark.h>
+
+using namespace folly;
+
+BENCHMARK(nextPowTwoClz, iters) {
+  for (unsigned long i = 0; i < iters; ++i) {
+    auto x = folly::nextPowTwo(iters);
+    folly::doNotOptimizeAway(x);
+  }
+}
+
+BENCHMARK_DRAW_LINE();
+BENCHMARK(isPowTwo, iters) {
+  bool b;
+  for (unsigned long i = 0; i < iters; ++i) {
+    b = folly::isPowTwo(i);
+    folly::doNotOptimizeAway(b);
+  }
+}
+
+BENCHMARK_DRAW_LINE();
+BENCHMARK(reverse, iters) {
+  uint64_t b = 0;
+  for (unsigned long i = 0; i < iters; ++i) {
+    b = folly::bitReverse(i + b);
+    folly::doNotOptimizeAway(b);
+  }
+}
+
+int main(int argc, char** argv) {
+  gflags::ParseCommandLineFlags(&argc, &argv, true);
+  folly::runBenchmarks();
+  return 0;
+}
+
+/*
+Benchmarks run on dual Xeon X5650's @ 2.67GHz w/hyperthreading enabled
+  (12 physical cores, 12 MB cache, 72 GB RAM)
+
+============================================================================
+folly/test/BitsBenchmark.cpp                    relative  time/iter  iters/s
+============================================================================
+nextPowTwoClz                                                0.00fs  Infinity
+----------------------------------------------------------------------------
+isPowTwo                                                   731.61ps    1.37G
+----------------------------------------------------------------------------
+reverse                                                      4.84ns  206.58M
+============================================================================
+*/
index e2708f8bd4494cf13b2a2eb38ea937758534f919..2619befdd4169da1c5c559feafa4c28641d0baa3 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2011-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/folly/test/BitsBenchmark.cpp b/folly/test/BitsBenchmark.cpp
deleted file mode 100644 (file)
index da0cab4..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2017 Facebook, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// @author Tudor Bosman (tudorb@fb.com)
-
-#include <folly/lang/Bits.h>
-
-#include <folly/Benchmark.h>
-
-using namespace folly;
-
-BENCHMARK(nextPowTwoClz, iters) {
-  for (unsigned long i = 0; i < iters; ++i) {
-    auto x = folly::nextPowTwo(iters);
-    folly::doNotOptimizeAway(x);
-  }
-}
-
-BENCHMARK_DRAW_LINE();
-BENCHMARK(isPowTwo, iters) {
-  bool b;
-  for (unsigned long i = 0; i < iters; ++i) {
-    b = folly::isPowTwo(i);
-    folly::doNotOptimizeAway(b);
-  }
-}
-
-BENCHMARK_DRAW_LINE();
-BENCHMARK(reverse, iters) {
-  uint64_t b = 0;
-  for (unsigned long i = 0; i < iters; ++i) {
-    b = folly::bitReverse(i + b);
-    folly::doNotOptimizeAway(b);
-  }
-}
-
-int main(int argc, char** argv) {
-  gflags::ParseCommandLineFlags(&argc, &argv, true);
-  folly::runBenchmarks();
-  return 0;
-}
-
-/*
-Benchmarks run on dual Xeon X5650's @ 2.67GHz w/hyperthreading enabled
-  (12 physical cores, 12 MB cache, 72 GB RAM)
-
-============================================================================
-folly/test/BitsBenchmark.cpp                    relative  time/iter  iters/s
-============================================================================
-nextPowTwoClz                                                0.00fs  Infinity
-----------------------------------------------------------------------------
-isPowTwo                                                   731.61ps    1.37G
-----------------------------------------------------------------------------
-reverse                                                      4.84ns  206.58M
-============================================================================
-*/
index 9a47a30b207d6ced51f98007675f101ecb5ea8e4..9fb035f0edf0ca0e5c5c796d41c8c13f5fe3aaf6 100644 (file)
@@ -162,7 +162,7 @@ math_test_SOURCES = MathTest.cpp
 math_test_LDADD = libfollytestmain.la $(top_builddir)/libfollybenchmark.la
 TESTS += math_test
 
 math_test_LDADD = libfollytestmain.la $(top_builddir)/libfollybenchmark.la
 TESTS += math_test
 
-bits_test_SOURCES = BitsTest.cpp
+bits_test_SOURCES = ../lang/test/BitsTest.cpp
 bits_test_LDADD = libfollytestmain.la $(top_builddir)/libfollybenchmark.la
 TESTS += bits_test
 
 bits_test_LDADD = libfollytestmain.la $(top_builddir)/libfollybenchmark.la
 TESTS += bits_test