ashutosh-arm commented on code in PR #13097:
URL: https://github.com/apache/tvm/pull/13097#discussion_r997311238


##########
src/relay/backend/contrib/cmsisnn/buffer_size.cc:
##########
@@ -16,141 +16,198 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+/*!
+ * \file src/relay/backend/contrib/cmsisnn/buffer_size.cc
+ * \brief This file contains CMSIS-NN buffer size functions similar to present
+ *  here:
+ * 
https://github.com/ARM-software/CMSIS_5/tree/51263182d16c92649a48144ba56c0945f9fce60e/CMSIS/NN
+ */
 
 #include "buffer_size.h"
 
-#include <tvm/ir/attrs.h>
-#include <tvm/ir/transform.h>
-
-#include "compiler_attrs.h"
+#include <stdint.h>
 
 namespace tvm {
 namespace relay {
 namespace contrib {
 namespace cmsisnn {
 
-int Conv2dBufferSize(bool is_int16, Target target, int32_t padding_w, int32_t 
padding_h,
-                     int32_t input_n, int32_t input_h, int32_t input_c, 
int32_t output_h,
-                     int32_t output_w, int32_t stride_w, int32_t stride_h, 
int32_t dilation_w,
-                     int32_t dilation_h, int32_t filter_w, int32_t filter_h) {
-  int size = -1;
-  if (is_int16) {
-    size = Conv2dBufferSizeInt16(target, padding_w, padding_h, input_n, 
input_h, input_c, output_h,
-                                 output_w, stride_w, stride_h, dilation_w, 
dilation_h, filter_w,
-                                 filter_h);
+#define USE_FAST_DW_CONV_FUNCTION(dw_conv_params, filter_dims, input_dims) \
+  dw_conv_params->ch_mult == 1 && dw_conv_params->dilation.w == 1 &&       \
+      dw_conv_params->dilation.h == 1 && filter_dims->w * filter_dims->h * 
input_dims->c < 512
+
+#define CH_IN_BLOCK_MVE (124)
+
+int32_t AvgpoolS16GetBufferSize(bool has_mve, bool has_dsp, const int 
output_x, const int ch_src) {

Review Comment:
   This file is derived from one of the files in CMSIS-NN headers. There is a 
link to the appropriate file from which these APIs were taken keeping in mind 
no direct duplication. Do we still need to add comments?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to