diff --git a/benchmark/benchmark.cpp b/benchmark/benchmark.cpp index ed9a5a7..b51a9ab 100644 --- a/benchmark/benchmark.cpp +++ b/benchmark/benchmark.cpp @@ -14,16 +14,16 @@ #include static void BM_pack_mat_64(benchmark::State &state) { - const bnn::Mat a(1, 64, 64, 128, bnn::DataType::Float, 0); - bnn::Mat b(1, 64, 64, 128, bnn::DataType::Bit, 0); + const bnn::Mat a(1, 64, 64, 128, bnn::DataType::Float); + bnn::Mat b(1, 64, 64, 128, bnn::DataType::Bit); for (auto _ : state) { pack_mat_64(a, b); } } static void BM_pack_mat_128(benchmark::State &state) { - const bnn::Mat a(1, 64, 64, 128, bnn::DataType::Float, 0); - bnn::Mat b(1, 64, 64, 128, bnn::DataType::Bit, 0); + const bnn::Mat a(1, 64, 64, 128, bnn::DataType::Float); + bnn::Mat b(1, 64, 64, 128, bnn::DataType::Bit); for (auto _ : state) { pack_mat_128(a, b); } diff --git a/dabnn/mat.h b/dabnn/mat.h index 0d0a8dc..ea98f9d 100644 --- a/dabnn/mat.h +++ b/dabnn/mat.h @@ -254,7 +254,7 @@ inline Mat::Mat(int _n, int _w, int _h, int _c, void *_data, DataType data_type, if (require_align) { hstep = ncnn::alignSize(w * c * elemsize, 16) / elemsize; } else { - hstep = w * c * elemsize; + hstep = w * c; } BNN_ASSERT(hstep > 0, hstep); @@ -523,7 +523,7 @@ inline void Mat::create(int _n, int _w, int _h, int _c, DataType _data_type, if (require_align) { hstep = ncnn::alignSize(w * c * elemsize, 16) / elemsize; } else { - hstep = w * c * elemsize; + hstep = w * c; } BNN_ASSERT(hstep > 0, hstep);