| 41 | |
| 42 | template <typename ctype> |
| 43 | void get_mask_index( |
| 44 | const ctype* mask, const size_t OH, const size_t OW, unsigned int* maskInd, |
| 45 | size_t* maskN) { |
| 46 | size_t length = 0; |
| 47 | rep(oh, OH) rep(ow, OW) { |
| 48 | size_t idx = oh * OW + ow; |
| 49 | if (mask[idx]) { |
| 50 | maskInd[length++] = oh << 16 | ow; |
| 51 | } |
| 52 | } |
| 53 | *maskN = length; |
| 54 | } |
| 55 | |
| 56 | void index_to_dst( |
| 57 | const float* result, float* dst, const size_t OC, const size_t OH, |