From bf2f45f35cc0d7b6f420894652824a377f764714 Mon Sep 17 00:00:00 2001 From: Daya Khudia Date: Fri, 7 Jun 2019 10:03:21 -0700 Subject: Remove duplicated header and undo some changes in D15399811 Summary: Delete duplicated header Remove #ifndef and replace with pragma once. Reviewed By: jianyuh Differential Revision: D15669744 fbshipit-source-id: 8895f6c867e626ac5813a8952837435e76b09370 --- include/fbgemm/FbgemmI8DepthwiseAvx2.h | 5 +- src/FbgemmI8DepthwiseAvx2.h | 174 --------------------------------- 2 files changed, 1 insertion(+), 178 deletions(-) delete mode 100644 src/FbgemmI8DepthwiseAvx2.h diff --git a/include/fbgemm/FbgemmI8DepthwiseAvx2.h b/include/fbgemm/FbgemmI8DepthwiseAvx2.h index 432687c..069ff77 100644 --- a/include/fbgemm/FbgemmI8DepthwiseAvx2.h +++ b/include/fbgemm/FbgemmI8DepthwiseAvx2.h @@ -4,9 +4,8 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ +#pragma once -#ifndef I8DEPTHWISE_H -#define I8DEPTHWISE_H #include #include "fbgemm/FbgemmBuild.h" @@ -171,5 +170,3 @@ FBGEMM_API void depthwise_3x3x3_per_channel_quantization_pad_1( int num_threads = 1); } // namespace fbgemm - -#endif diff --git a/src/FbgemmI8DepthwiseAvx2.h b/src/FbgemmI8DepthwiseAvx2.h deleted file mode 100644 index e2730df..0000000 --- a/src/FbgemmI8DepthwiseAvx2.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. - */ -#ifndef I8DEPTHWISE_H -#define I8DEPTHWISE_H - -#include -#include "fbgemm/FbgemmBuild.h" - -namespace fbgemm { - -// KERNEL_PROD is the product of all kernels. -// For example, KERNEL_PROD = 9 for 3x3, and 27 for 3x3x3. -template -class FBGEMM_API PackedDepthWiseConvMatrix { - public: - // smat in RSG layout - PackedDepthWiseConvMatrix(int K, const std::int8_t* smat); - virtual ~PackedDepthWiseConvMatrix(); - - const std::int8_t* PackedMat() const { - return pmat_; - } - - private: - int K_; - std::int8_t* pmat_; -}; // Packed3x3ConvMatrix - -using Packed3x3ConvMatrix = PackedDepthWiseConvMatrix<3 * 3>; -using Packed3x3x3ConvMatrix = PackedDepthWiseConvMatrix<3 * 3 * 3>; - -/** - * Depth-wise 3x3 convolution with pad=1 and stride=1 and K a multiple of 8 - * @params A The input image in NHWK layout - * @params Bp The pre-packed filter - */ -FBGEMM_API void depthwise_3x3_pad_1( - int N, - int H, - int W, - int K, - int stride_h, - int stride_w, - std::int32_t A_zero_point, - const std::uint8_t* A, - const Packed3x3ConvMatrix& Bp, - std::int32_t* C, - int thread_id = 0, - int num_threads = 1); - -/** - * Depth-wise 3x3 convolution with pad=1 and stride=1 and K a multiple of 8 - * This version is fused with requantization. - * - * @col_offsets nullptr if col_offsets are folded into bias - */ -FBGEMM_API void depthwise_3x3_pad_1( - int N, - int H, - int W, - int K, - int stride_h, - int stride_w, - std::int32_t A_zero_point, - const std::uint8_t* A, - std::int32_t B_zero_point, - const Packed3x3ConvMatrix& Bp, - float C_multiplier, - std::int32_t C_zero_point, - std::uint8_t* C, - const std::int32_t* col_offsets, - const std::int32_t* bias, - bool fuse_relu = false, - int thread_id = 0, - int num_threads = 1); - -/** - * Depth-wise 3x3 convolution with pad=1 and stride=1 and K a multiple of 8 - * This version is fused with requantization and uses per-channel quantization. - * - * @col_offsets nullptr if col_offsets are folded into bias - */ -FBGEMM_API void depthwise_3x3_per_channel_quantization_pad_1( - int N, - int H, - int W, - int K, - int stride_h, - int stride_w, - std::int32_t A_zero_point, - const std::uint8_t* A, - const std::int32_t* B_zero_point, - const Packed3x3ConvMatrix& Bp, - const float* C_multiplier, - std::int32_t C_zero_point, - std::uint8_t* C, - const std::int32_t* col_offsets, - const std::int32_t* bias, - bool fuse_relu = false, - int thread_id = 0, - int num_threads = 1); - -FBGEMM_API void depthwise_3x3x3_pad_1( - int N, - int T, - int H, - int W, - int K, - int stride_t, - int stride_h, - int stride_w, - std::int32_t A_zero_point, - const std::uint8_t* A, - const Packed3x3x3ConvMatrix& Bp, - std::int32_t* C, - int thread_id = 0, - int num_threads = 1); - -/** - * @col_offsets nullptr if col_offsets are folded into bias - */ -FBGEMM_API void depthwise_3x3x3_pad_1( - int N, - int T, - int H, - int W, - int K, - int stride_t, - int stride_h, - int stride_w, - std::int32_t A_zero_point, - const std::uint8_t* A, - std::int32_t B_zero_point, - const Packed3x3x3ConvMatrix& Bp, - float C_multiplier, - std::int32_t C_zero_point, - std::uint8_t* C, - const std::int32_t* col_offsets, - const std::int32_t* bias, - bool fuse_relu = false, - int thread_id = 0, - int num_threads = 1); - -/** - * @col_offsets nullptr if col_offsets are folded into bias - */ -FBGEMM_API void depthwise_3x3x3_per_channel_quantization_pad_1( - int N, - int T, - int H, - int W, - int K, - int stride_t, - int stride_h, - int stride_w, - std::int32_t A_zero_point, - const std::uint8_t* A, - const std::int32_t* B_zero_point, - const Packed3x3x3ConvMatrix& Bp, - const float* C_multiplier, - std::int32_t C_zero_point, - std::uint8_t* C, - const std::int32_t* col_offsets, - const std::int32_t* bias, - bool fuse_relu = false, - int thread_id = 0, - int num_threads = 1); - -} // namespace fbgemm -#endif -- cgit v1.2.3