You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

matmul_parameter.h 1.9 kB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef MINDSPORE_LITE_NNACL_MATMUL_H_
  17. #define MINDSPORE_LITE_NNACL_MATMUL_H_
  18. #include "nnacl/op_base.h"
  19. typedef void (*MATMUL_OPT_R4_FUNC)(const int8_t *a, const int8_t *b, int *dst, int row_4, int col_4, int deep_16,
  20. const int *input_sum, const int *bias);
  21. typedef void (*MATMUL_OPT_R_FUNC)(const int8_t *a, const int8_t *b, int8_t *dst, size_t row, size_t col, size_t deep_4,
  22. size_t stride, const int32_t *input_sum, const int32_t *bias, int32_t *left_shift,
  23. int32_t *right_shift, int32_t *multiplier, int32_t output_zp, int32_t mini,
  24. int32_t maxi, size_t per_channel);
  25. typedef enum OutType { OutType_C8 = 0, OutType_Nhwc = 1, OutType_TileC8 = 2 } OutType;
  26. typedef struct MatMulParameter {
  27. OpParameter op_parameter_;
  28. int row_;
  29. int col_;
  30. int row_4_;
  31. int row_8_;
  32. int row_12_;
  33. int row_16_;
  34. int col_2_;
  35. int col_4_;
  36. int col_8_;
  37. int deep_;
  38. int deep_4_;
  39. int deep_16_;
  40. bool has_bias_;
  41. int batch;
  42. bool a_transpose_; /* false : row-major */
  43. bool b_transpose_; /* true : col-major */
  44. bool a_const_;
  45. bool b_const_;
  46. bool a_has_shape_;
  47. bool b_has_shape_;
  48. ActType act_type_;
  49. } MatMulParameter;
  50. #endif // MINDSPORE_LITE_NNACL_MATMUL_H_