[ trivial ] Add doxygen tags for hgemm padding functions
authorskykongkong8 <ss.kong@samsung.com>
Wed, 10 Jul 2024 04:27:26 +0000 (13:27 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 30 Jul 2024 22:45:30 +0000 (07:45 +0900)
- Add doxygen tags for hgemm padding functions

**Self evaluation:**
1. Build test:     [X]Passed [ ]Failed [ ]Skipped
2. Run test:     [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: skykongkong8 <ss.kong@samsung.com>
nntrainer/tensor/hgemm/hgemm_padding_a.h
nntrainer/tensor/hgemm/hgemm_padding_b.cpp
nntrainer/tensor/hgemm/hgemm_padding_b.h

index 49dd8065e6181b31ea41029b13419c7d417fbfa5..f7b6885df35e3defc45a1741d4118b90ce4a61b7 100644 (file)
  *
  */
 
+/**
+ * @brief Padding function for matrix A in HGEMM
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param transA Whether the matrix A is transposed or not
+ */
 void hgemm_padding_A(const __fp16 *A, __fp16 *Ap, unsigned int M,
                      unsigned int K, unsigned int M8, unsigned int K8,
                      bool transA);
+
+/**
+ * @brief Padding function for non-transposed matrix A in HGEMM
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
 void hgemm_padding_A_noTrans(const __fp16 *A, __fp16 *Ap, unsigned int M,
                              unsigned int K, unsigned int M8, unsigned int K8);
-void hgemm_padding_A_noTrans_wrt_M(const __fp16 *A, __fp16 *Ap,
-                                   unsigned int M, unsigned int K,
-                                   unsigned int M8, unsigned int K8);
-void hgemm_padding_A_noTrans_wrt_K(const __fp16 *A, __fp16 *Ap,
-                                   unsigned int M, unsigned int K,
-                                   unsigned int M8, unsigned int K8);
-void hgemm_padding_A_noTrans_wrt_MK(const __fp16 *A, __fp16 *Ap,
-                                    unsigned int M, unsigned int K,
-                                    unsigned int M8, unsigned int K8);
+
+/**
+ * @brief Padding function for non-transposed matrix A in HGEMM w.r.t. M
+ * direction
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
+void hgemm_padding_A_noTrans_wrt_M(const __fp16 *A, __fp16 *Ap, unsigned int M,
+                                   unsigned int K, unsigned int M8,
+                                   unsigned int K8);
+/**
+ * @brief Padding function for non-transposed matrix A in HGEMM w.r.t. K
+ * direction
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
+void hgemm_padding_A_noTrans_wrt_K(const __fp16 *A, __fp16 *Ap, unsigned int M,
+                                   unsigned int K, unsigned int M8,
+                                   unsigned int K8);
+
+/**
+ * @brief Padding function for non-transposed matrix A in HGEMM w.r.t. M and K
+ * direction
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
+void hgemm_padding_A_noTrans_wrt_MK(const __fp16 *A, __fp16 *Ap, unsigned int M,
+                                    unsigned int K, unsigned int M8,
+                                    unsigned int K8);
+/**
+ * @brief Padding function for transposed matrix A in HGEMM
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
 void hgemm_padding_A_Trans(const __fp16 *A, __fp16 *Ap, unsigned int M,
                            unsigned int K, unsigned int M8, unsigned int K8);
-void hgemm_padding_A_Trans_wrt_M(const __fp16 *A, __fp16 *Ap,
-                                 unsigned int M, unsigned int K,
-                                 unsigned int M8, unsigned int K8);
-void hgemm_padding_A_Trans_wrt_K(const __fp16 *A, __fp16 *Ap,
-                                 unsigned int M, unsigned int K,
-                                 unsigned int M8, unsigned int K8);
-void hgemm_padding_A_Trans_wrt_MK(const __fp16 *A, __fp16 *Ap,
-                                  unsigned int M, unsigned int K,
-                                  unsigned int M8, unsigned int K8);
+/**
+ * @brief Padding function for transposed matrix A in HGEMM w.r.t. M direction
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
+void hgemm_padding_A_Trans_wrt_M(const __fp16 *A, __fp16 *Ap, unsigned int M,
+                                 unsigned int K, unsigned int M8,
+                                 unsigned int K8);
+/**
+ * @brief Padding function for transposed matrix A in HGEMM w.r.t. K direction
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
+void hgemm_padding_A_Trans_wrt_K(const __fp16 *A, __fp16 *Ap, unsigned int M,
+                                 unsigned int K, unsigned int M8,
+                                 unsigned int K8);
+/**
+ * @brief Padding function for transposed matrix A in HGEMM w.r.t. M and K
+ * direction
+ *
+ * @param A src matrix to pad
+ * @param Ap dst matrix after padding
+ * @param M row length of matrix A
+ * @param K col length of matrix A
+ * @param M8 Least multiple of 8 that is bigger than or equal to M
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ */
+void hgemm_padding_A_Trans_wrt_MK(const __fp16 *A, __fp16 *Ap, unsigned int M,
+                                  unsigned int K, unsigned int M8,
+                                  unsigned int K8);
index 78d07fec25f20f4fdd003de91e97acf94c554597..3eb4f188535a6e74bf2fabdb6be9960394198686 100644 (file)
@@ -56,7 +56,7 @@ void hgemm_padding_B_Trans(const __fp16 *B, __fp16 *Bp, unsigned int K,
 void hgemm_padding_B_noTrans_wrt_N(const __fp16 *B, __fp16 *Bp, unsigned int K,
                                    unsigned int N, unsigned int K8,
                                    unsigned int N16) {
-  std::cerr << "NYI : hgemm_padding_B_noTrans_wrt_N\n";
+  std::cerr << "Error : hgemm_padding_B_noTrans_wrt_N NYI!\n";
 }
 
 void hgemm_padding_B_noTrans_wrt_K(const __fp16 *B, __fp16 *Bp, unsigned int K,
@@ -79,13 +79,14 @@ void hgemm_padding_B_noTrans_wrt_K(const __fp16 *B, __fp16 *Bp, unsigned int K,
 void hgemm_padding_B_noTrans_wrt_KN(const __fp16 *B, __fp16 *Bp, unsigned int K,
                                     unsigned int N, unsigned int K8,
                                     unsigned int N16) {
-  std::cerr << "NYI : hgemm_padding_B_noTrans_wrt_KN\n";
+  std::cerr << "Error : hgemm_padding_B_noTrans_wrt_KN NYI!\n";
 }
 
+
 void hgemm_padding_B_Trans_wrt_N(const __fp16 *B, __fp16 *Bp, unsigned int K,
                                  unsigned int N, unsigned int K8,
                                  unsigned int N16) {
-  std::cerr << "NYI : hgemm_padding_B_Trans_wrt_N\n";
+  std::cerr << "Error : hgemm_padding_B_Trans_wrt_N NYI!\n";
 }
 
 void hgemm_padding_B_Trans_wrt_K(const __fp16 *B, __fp16 *Bp, unsigned int K,
@@ -110,5 +111,5 @@ void hgemm_padding_B_Trans_wrt_K(const __fp16 *B, __fp16 *Bp, unsigned int K,
 void hgemm_padding_B_Trans_wrt_KN(const __fp16 *B, __fp16 *Bp, unsigned int K,
                                   unsigned int N, unsigned int K8,
                                   unsigned int N16) {
-  std::cerr << "NYI : hgemm_padding_B_Trans_wrt_KN\n";
+  std::cerr << "Error : hgemm_padding_B_Trans_wrt_KN NYI!\n";
 }
index ccf547e0355f8e706aa5ba1ef1dc0afb07c7027e..53e16970cc08bd8b83357b6b0de14a4f060a9a9c 100644 (file)
  *
  */
 
+/**
+ * @brief Padding function for matrix B in HGEMM
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ * @param transB Whether the matrix B is transposed or not
+ */
 void hgemm_padding_B(const __fp16 *B, __fp16 *Bp, unsigned int K,
                      unsigned int N, unsigned int K8, unsigned int N16,
                      bool transB);
 
+/**
+ * @brief Padding function for non-transposed matrix B in HGEMM
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
 void hgemm_padding_B_noTrans(const __fp16 *B, __fp16 *Bp, unsigned int K,
                              unsigned int N, unsigned int K8, unsigned int N16);
-
-void hgemm_padding_B_noTrans_wrt_N(const __fp16 *B, __fp16 *Bp,
-                                   unsigned int K, unsigned int N,
-                                   unsigned int K8, unsigned int N16);
-
-void hgemm_padding_B_noTrans_wrt_K(const __fp16 *B, __fp16 *Bp,
-                                   unsigned int K, unsigned int N,
-                                   unsigned int K8, unsigned int N16);
-
-void hgemm_padding_B_noTrans_wrt_KN(const __fp16 *B, __fp16 *Bp,
-                                    unsigned int K, unsigned int N,
-                                    unsigned int K8, unsigned int N16);
-
+/**
+ * @brief Padding function for non-transposed matrix B in HGEMM w.r.t. N
+ * direction
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
+void hgemm_padding_B_noTrans_wrt_N(const __fp16 *B, __fp16 *Bp, unsigned int K,
+                                   unsigned int N, unsigned int K8,
+                                   unsigned int N16);
+/**
+ * @brief Padding function for non-transposed matrix B in HGEMM w.r.t. K
+ * direction
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
+void hgemm_padding_B_noTrans_wrt_K(const __fp16 *B, __fp16 *Bp, unsigned int K,
+                                   unsigned int N, unsigned int K8,
+                                   unsigned int N16);
+/**
+ * @brief Padding function for non-transposed matrix B in HGEMM w.r.t. N and K
+ * direction
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
+void hgemm_padding_B_noTrans_wrt_KN(const __fp16 *B, __fp16 *Bp, unsigned int K,
+                                    unsigned int N, unsigned int K8,
+                                    unsigned int N16);
+/**
+ * @brief Padding function for transposed matrix B in HGEMM
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
 void hgemm_padding_B_Trans(const __fp16 *B, __fp16 *Bp, unsigned int K,
                            unsigned int N, unsigned int K8, unsigned int N16);
+/**
+ * @brief Padding function for transposed matrix B in HGEMM w.r.t. N direction
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
+void hgemm_padding_B_Trans_wrt_N(const __fp16 *B, __fp16 *Bp, unsigned int K,
+                                 unsigned int N, unsigned int K8,
+                                 unsigned int N16);
+/**
+ * @brief Padding function for transposed matrix B in HGEMM w.r.t. K direction
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
+void hgemm_padding_B_Trans_wrt_K(const __fp16 *B, __fp16 *Bp, unsigned int K,
+                                 unsigned int N, unsigned int K8,
+                                 unsigned int N16);
 
-void hgemm_padding_B_Trans_wrt_N(const __fp16 *B, __fp16 *Bp,
-                                 unsigned int K, unsigned int N,
-                                 unsigned int K8, unsigned int N16);
-
-void hgemm_padding_B_Trans_wrt_K(const __fp16 *B, __fp16 *Bp,
-                                 unsigned int K, unsigned int N,
-                                 unsigned int K8, unsigned int N16);
-
-void hgemm_padding_B_Trans_wrt_KN(const __fp16 *B, __fp16 *Bp,
-                                  unsigned int K, unsigned int N,
-                                  unsigned int K8, unsigned int N16);
+/**
+ * @brief Padding function for transposed matrix B in HGEMM w.r.t. K and N
+ * direction
+ *
+ * @param B src matrix to pad
+ * @param Bp dst matrix after padding
+ * @param K row length of matrix B
+ * @param N col length of matrix B
+ * @param K8 Least multiple of 8 that is bigger than or equal to K
+ * @param N16 Least multiple of 16 that is bigger than or equal to N
+ */
+void hgemm_padding_B_Trans_wrt_KN(const __fp16 *B, __fp16 *Bp, unsigned int K,
+                                  unsigned int N, unsigned int K8,
+                                  unsigned int N16);