Browse Source

add C1-4 of bool, uint64 and int64

tags/v1.1.0
jiangzhiwen 5 years ago
parent
commit
92ccbef65e
2 changed files with 17 additions and 4 deletions
  1. +2
    -4
      mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc
  2. +15
    -0
      mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/lite_mat.h

+ 2
- 4
mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc View File

@@ -716,7 +716,7 @@ inline void MergeImpl(const std::vector<LiteMat> &mv, T *dst_ptr, int height, in
} }


bool Merge(const std::vector<LiteMat> &mv, LiteMat &dst) { bool Merge(const std::vector<LiteMat> &mv, LiteMat &dst) {
if (mv.empty() || mv.size() > 4) return false;
if (mv.size() != 1 && mv.size() != 3 && mv.size() != 4) return false;


int width = mv[0].width_; int width = mv[0].width_;
int height = mv[0].height_; int height = mv[0].height_;
@@ -972,9 +972,7 @@ bool Subtract(const LiteMat &src1, const LiteMat &src2, LiteMat &dst) {


size_t total_size = src1.height_ * src1.width_ * src1.channel_; size_t total_size = src1.height_ * src1.width_ * src1.channel_;


if (src1.data_type_ == LDataType::BOOL) {
SubtractImpl<bool>(src1, src2, dst, total_size);
} else if (src1.data_type_ == LDataType::INT8) {
if (src1.data_type_ == LDataType::INT8) {
SubtractImpl<int8_t>(src1, src2, dst, total_size); SubtractImpl<int8_t>(src1, src2, dst, total_size);
} else if (src1.data_type_ == LDataType::UINT8) { } else if (src1.data_type_ == LDataType::UINT8) {
SubtractImpl<uint8_t>(src1, src2, dst, total_size); SubtractImpl<uint8_t>(src1, src2, dst, total_size);


+ 15
- 0
mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/lite_mat.h View File

@@ -55,6 +55,11 @@ struct Chn4 {
T c4; T c4;
}; };


using BOOL_C1 = Chn1<bool>;
using BOOL_C2 = Chn2<bool>;
using BOOL_C3 = Chn3<bool>;
using BOOL_C4 = Chn4<bool>;

using UINT8_C1 = Chn1<uint8_t>; using UINT8_C1 = Chn1<uint8_t>;
using UINT8_C2 = Chn2<uint8_t>; using UINT8_C2 = Chn2<uint8_t>;
using UINT8_C3 = Chn3<uint8_t>; using UINT8_C3 = Chn3<uint8_t>;
@@ -85,6 +90,16 @@ using INT32_C2 = Chn2<int32_t>;
using INT32_C3 = Chn3<int32_t>; using INT32_C3 = Chn3<int32_t>;
using INT32_C4 = Chn4<int32_t>; using INT32_C4 = Chn4<int32_t>;


using UINT64_C1 = Chn1<uint64_t>;
using UINT64_C2 = Chn2<uint64_t>;
using UINT64_C3 = Chn3<uint64_t>;
using UINT64_C4 = Chn4<uint64_t>;

using INT64_C1 = Chn1<int64_t>;
using INT64_C2 = Chn2<int64_t>;
using INT64_C3 = Chn3<int64_t>;
using INT64_C4 = Chn4<int64_t>;

using FLOAT32_C1 = Chn1<float>; using FLOAT32_C1 = Chn1<float>;
using FLOAT32_C2 = Chn2<float>; using FLOAT32_C2 = Chn2<float>;
using FLOAT32_C3 = Chn3<float>; using FLOAT32_C3 = Chn3<float>;


Loading…
Cancel
Save