hl_matrix_stub.h 5.5 KB
Newer Older
1
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Z
zhangjinchao01 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

#ifndef HL_MATRIX_STUB_H_
#define HL_MATRIX_STUB_H_

#include "hl_matrix.h"

inline void hl_matrix_add(real* A_d,
                          real* B_d,
                          real* C_d,
                          int dimM,
                          int dimN,
                          real alpha,
                          real beta) {}

28
inline void hl_matrix_softmax(real* A_d, real* C_d, int dimM, int dimN) {}
Z
zhangjinchao01 已提交
29

30 31
inline void hl_sequence_softmax_forward(real* A_d,
                                        real* C_d,
Z
zhangjinchao01 已提交
32 33 34
                                        const int* index,
                                        int numSequence) {}

35 36 37
inline void hl_matrix_softmax_derivative(
    real* grad_d, real* output_d, real* sftmaxSum_d, int dimM, int dimN) {}

38 39 40 41 42 43 44 45 46 47
inline void hl_matrix_classification_error(real* topVal,
                                           int ldv,
                                           int* topIds,
                                           real* src,
                                           int lds,
                                           int dim,
                                           int topkSize,
                                           int numSamples,
                                           int* label,
                                           real* recResult) {}
48 49 50 51 52 53 54 55 56 57 58 59

inline void hl_matrix_cross_entropy(
    real* A_d, real* C_d, int* label_d, int dimM, int dimN) {}

inline void hl_matrix_cross_entropy_bp(
    real* grad_d, real* output_d, int* label_d, int dimM, int dimN) {}

inline void hl_matrix_multi_binary_cross_entropy(
    real* output, real* entropy, hl_sparse_matrix_s mat, int dimM, int dimN) {}

inline void hl_matrix_multi_binary_cross_entropy_bp(
    real* output, real* grad, hl_sparse_matrix_s mat, int dimM, int dimN) {}
60

Z
zhangjinchao01 已提交
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
inline void hl_matrix_zero_mem(real* data, int num) {}

inline void hl_param_relu_forward(real* output,
                                  real* input,
                                  real* w,
                                  int width,
                                  int height,
                                  int partial_sum) {}

inline void hl_param_relu_backward_w(real* grad_w,
                                     real* grad_o,
                                     real* input,
                                     int width,
                                     int height,
                                     int partial_sum) {}

inline void hl_param_relu_backward_diff(real* grad_o,
                                        real* input,
                                        real* w,
                                        real* diff,
                                        int width,
                                        int height,
                                        int partial_sum) {}

85 86 87 88 89 90 91 92 93 94 95 96 97
inline void hl_matrix_add_shared_bias(real* A_d,
                                      real* B_d,
                                      const int channel,
                                      const int dimM,
                                      const int dimN,
                                      real scale) {}

inline void hl_matrix_collect_shared_bias(real* B_d,
                                          real* A_d,
                                          const int channel,
                                          const int dimM,
                                          const int dimN,
                                          real scale) {}
H
Haonan 已提交
98 99

inline void hl_matrix_rotate(
H
Haonan 已提交
100
    real* mat, real* matRot, int dimM, int dimN, bool clockWise) {}
H
Haonan 已提交
101

C
chengduoZH 已提交
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
inline void hl_matrix_vol2Col(const real* dataSrc,
                              int channels,
                              int depth,
                              int height,
                              int width,
                              int filterD,
                              int filterH,
                              int filterW,
                              int strideD,
                              int strideH,
                              int strideW,
                              int paddingD,
                              int paddingH,
                              int paddingW,
                              real* dataDst) {}

inline void hl_matrix_col2Vol(real* dataDst,
                              int channels,
                              int depth,
                              int height,
                              int width,
                              int filterD,
                              int filterH,
                              int filterW,
                              int strideD,
                              int strideH,
                              int strideW,
                              int paddingD,
                              int paddingH,
                              int paddingW,
                              const real* dataSrc,
                              real alpha,
                              real beta) {}
C
chengduoZH 已提交
135

Z
zhangjinchao01 已提交
136
#endif  // HL_MATRIX_STUB_H_