diff options
author | Jongsoo Park <jongsoo@fb.com> | 2019-09-03 15:01:41 +0300 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-09-03 15:05:48 +0300 |
commit | e55a59653b70ef67e8f48373566756c477cda7b5 (patch) | |
tree | 41c48852375be4b1b1895a4abbb3c20f6908534b | |
parent | dc76fd4ce3094e929e2eda9c7860dcb8a559e098 (diff) |
disable clang formatting in a few array definitions (#121)
Summary:
Pull Request resolved: https://github.com/pytorch/FBGEMM/pull/121
By adding "// clang-format off" and "// clang-format on" we can still apply clang-format to these files.
Reviewed By: jianyuh
Differential Revision: D17159312
fbshipit-source-id: de523536df4c33f0efe332f9bc7b0290cdac1ba0
-rw-r--r-- | bench/DepthwiseBenchmark.cc | 2 | ||||
-rw-r--r-- | bench/GEMMsBenchmark.cc | 2 | ||||
-rw-r--r-- | bench/GEMMsTunableBenchmark.cc | 6 | ||||
-rw-r--r-- | bench/PackedFloatInOutBenchmark.cc | 2 | ||||
-rw-r--r-- | bench/PackedRequantizeAcc16Benchmark.cc | 2 | ||||
-rw-r--r-- | bench/PackedRequantizeAcc32Benchmark.cc | 2 | ||||
-rw-r--r-- | src/FbgemmFP16.cc | 2 | ||||
-rw-r--r-- | src/FbgemmI8DepthwiseAvx2.cc | 2 | ||||
-rw-r--r-- | src/QuantUtilsAvx2.cc | 4 | ||||
-rw-r--r-- | test/I8DepthwiseTest.cc | 2 | ||||
-rw-r--r-- | test/I8DepthwiseTest.h | 2 |
11 files changed, 26 insertions, 2 deletions
diff --git a/bench/DepthwiseBenchmark.cc b/bench/DepthwiseBenchmark.cc index 96921a1..e882890 100644 --- a/bench/DepthwiseBenchmark.cc +++ b/bench/DepthwiseBenchmark.cc @@ -34,6 +34,7 @@ int main() { #endif // From Xray OCR + // clang-format off vector<vector<int>> shapes = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -138,6 +139,7 @@ int main() { { 96, 544, 14, 14, 2, }, { 100, 544, 14, 14, 2, }, }; + // clang-format on // Depthwise is memory BW bound so we want to flush LLC. bool flush = true; diff --git a/bench/GEMMsBenchmark.cc b/bench/GEMMsBenchmark.cc index b404d8b..f493a96 100644 --- a/bench/GEMMsBenchmark.cc +++ b/bench/GEMMsBenchmark.cc @@ -28,6 +28,7 @@ using namespace std; using namespace fbgemm; void performance_test() { + // clang-format off static const vector<vector<int>> shapes = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -39,6 +40,7 @@ void performance_test() { {256, 512, 256}, {1024, 1024, 1024}, }; + // clang-format on bool flush = true; std::vector<char> llc; diff --git a/bench/GEMMsTunableBenchmark.cc b/bench/GEMMsTunableBenchmark.cc index a65b51f..2adc556 100644 --- a/bench/GEMMsTunableBenchmark.cc +++ b/bench/GEMMsTunableBenchmark.cc @@ -218,7 +218,8 @@ int main(int /* unused */, char** /* unused */) { } #endif - vector<vector<int>> shapes = { + // clang-format off + vector<vector<int>> shapes = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. // m, n, k @@ -266,7 +267,8 @@ int main(int /* unused */, char** /* unused */) { {128, 128, 128}, {256, 512, 256}, {1024, 1024, 1024}, -}; + }; + // clang-format on vector<int> MCBs; vector<int> NCBs; diff --git a/bench/PackedFloatInOutBenchmark.cc b/bench/PackedFloatInOutBenchmark.cc index 66ca67e..dcea65c 100644 --- a/bench/PackedFloatInOutBenchmark.cc +++ b/bench/PackedFloatInOutBenchmark.cc @@ -28,6 +28,7 @@ using namespace std; using namespace fbgemm; void performance_test() { + // clang-format off vector<vector<int>> shapes = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -66,6 +67,7 @@ void performance_test() { {1, 128, 2722}, {16, 256, 512}, }; + // clang-format on bool flush = true; std::vector<char> llc; diff --git a/bench/PackedRequantizeAcc16Benchmark.cc b/bench/PackedRequantizeAcc16Benchmark.cc index 8706f96..7194896 100644 --- a/bench/PackedRequantizeAcc16Benchmark.cc +++ b/bench/PackedRequantizeAcc16Benchmark.cc @@ -36,6 +36,7 @@ enum class BenchmarkType { }; void performance_test() { + // clang-format off vector<vector<int>> shapes = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -66,6 +67,7 @@ void performance_test() { {392, 2048, 512}, {392, 512, 2048}, }; + // clang-format on bool flush = true; std::vector<char> llc; diff --git a/bench/PackedRequantizeAcc32Benchmark.cc b/bench/PackedRequantizeAcc32Benchmark.cc index 2f04795..a61ef5a 100644 --- a/bench/PackedRequantizeAcc32Benchmark.cc +++ b/bench/PackedRequantizeAcc32Benchmark.cc @@ -28,6 +28,7 @@ using namespace std; using namespace fbgemm; void performance_test() { + // clang-format off vector<vector<int>> shapes = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -70,6 +71,7 @@ void performance_test() { {1, 128, 2722}, {16, 256, 512}, }; + // clang-format on bool flush = true; std::vector<char> llc; diff --git a/src/FbgemmFP16.cc b/src/FbgemmFP16.cc index 2c0eea3..71d4441 100644 --- a/src/FbgemmFP16.cc +++ b/src/FbgemmFP16.cc @@ -52,6 +52,7 @@ struct KernelInfo { // autotuned kernel splits for various cases m = 1:mb_max // may need re-autotuning for new uarch + // clang-format off static constexpr array<array<array<int, 2>, 2>, 121> partition = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -179,6 +180,7 @@ struct KernelInfo { {{ { 6, 20 }, { 0, 0 } } }, // 120 } }; + // clang-format on }; constexpr array<KernelInfo::knl_ptr, 7> KernelInfo::kernel; constexpr array<array<array<int, 2>, 2>, 121> KernelInfo::partition; diff --git a/src/FbgemmI8DepthwiseAvx2.cc b/src/FbgemmI8DepthwiseAvx2.cc index fb2f4b5..4c8d71d 100644 --- a/src/FbgemmI8DepthwiseAvx2.cc +++ b/src/FbgemmI8DepthwiseAvx2.cc @@ -17,6 +17,7 @@ using namespace std; namespace fbgemm { +// clang-format off static int masks[8][8] = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -29,6 +30,7 @@ static int masks[8][8] = { { -1, -1, -1, -1, -1, -1, 0, 0, }, { -1, -1, -1, -1, -1, -1, -1, 0, }, }; +// clang-format on template <int KERNEL_PROD> PackedDepthWiseConvMatrix<KERNEL_PROD>::PackedDepthWiseConvMatrix( diff --git a/src/QuantUtilsAvx2.cc b/src/QuantUtilsAvx2.cc index 4a5f458..0643ed6 100644 --- a/src/QuantUtilsAvx2.cc +++ b/src/QuantUtilsAvx2.cc @@ -592,6 +592,7 @@ void requantizeOutputProcessingAvx2( int remainder = block.col_start + block.col_size - j; if (remainder > 0) { + // clang-format off alignas(64) const int masks[8][8] = { // NOTE: clang-format wants to use a different formatting but the // current formatting should be easier to read. @@ -604,6 +605,7 @@ void requantizeOutputProcessingAvx2( { -1, -1, -1, -1, -1, -1, 0, 0, }, { -1, -1, -1, -1, -1, -1, -1, 0, }, }; + // clang-format on __m256i mask_v = _mm256_load_si256( reinterpret_cast<const __m256i*>(masks[remainder])); @@ -777,6 +779,7 @@ void requantizeForFloatAvx2( int remainder = block.col_start + block.col_size - j; if (remainder > 0) { + // clang-format off alignas(64) const int masks[8][8] = { // NOTE: clang-format wants to use a different formatting but the // current formatting should be easier to read. @@ -789,6 +792,7 @@ void requantizeForFloatAvx2( { -1, -1, -1, -1, -1, -1, 0, 0, }, { -1, -1, -1, -1, -1, -1, -1, 0, }, }; + // clang-format on __m256i mask_v = _mm256_load_si256( reinterpret_cast<const __m256i*>(masks[remainder])); diff --git a/test/I8DepthwiseTest.cc b/test/I8DepthwiseTest.cc index 0604879..ad74ede 100644 --- a/test/I8DepthwiseTest.cc +++ b/test/I8DepthwiseTest.cc @@ -22,6 +22,7 @@ using namespace std; namespace fbgemm { // From Xray OCR +// clang-format off static vector<vector<int>> shapes = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -67,6 +68,7 @@ static vector<vector<int>> shapes = { { 1, 8, 4, 4, 1, }, }; +// clang-format on namespace { diff --git a/test/I8DepthwiseTest.h b/test/I8DepthwiseTest.h index d65362a..cc8da9d 100644 --- a/test/I8DepthwiseTest.h +++ b/test/I8DepthwiseTest.h @@ -11,6 +11,7 @@ namespace fbgemm { // From ResNeXt-3D-101 +// clang-format off static std::vector<std::vector<int>> shapes_3d = { // NOTE: clang-format wants to use a different formatting but the current // formatting should be easier to read. @@ -35,5 +36,6 @@ static std::vector<std::vector<int>> shapes_3d = { { 1, 8, 4, 4, 4, 1, }, }; +// clang-format on } // namespace fbgemm |