diff options
-rw-r--r-- | src/runtime/NEON/functions/NEConvolutionLayer.cpp | 5 | ||||
-rw-r--r-- | tests/validation/fixtures/ConvolutionLayerFixture.h | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index 40862fc2d8..f34f497436 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -190,8 +190,9 @@ void NEConvolutionLayer::configure(const ITensor *input, const ITensor *weights, { if(_are_weights_reshaped) { - mat_weights_cols = weights_info.num_kernels(); - mat_weights_rows = weights->info()->dimension(0) / 4 + (_has_bias ? 1 : 0); + const unsigned int transpose_width = 16 / input->info()->element_size(); + mat_weights_cols = weights_info.num_kernels(); + mat_weights_rows = weights->info()->dimension(0) / transpose_width + (_has_bias ? 1 : 0); } else { diff --git a/tests/validation/fixtures/ConvolutionLayerFixture.h b/tests/validation/fixtures/ConvolutionLayerFixture.h index 434291b58e..fe206997b8 100644 --- a/tests/validation/fixtures/ConvolutionLayerFixture.h +++ b/tests/validation/fixtures/ConvolutionLayerFixture.h @@ -88,7 +88,12 @@ protected: { // Check if its a "fully connected" convolution const bool is_fully_connected_convolution = (output_shape.x() == 1 && output_shape.y() == 1); - const bool is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU >= CPUTarget::ARMV7 && data_type == DataType::F32; + bool is_optimised = false; +#if defined(__arm__) + is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU == CPUTarget::ARMV7 && data_type == DataType::F32; +#elif defined(__aarch64__) + is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU >= CPUTarget::ARMV8 && data_type == DataType::F32; +#endif /* defined(__arm__) || defined(__aarch64__) */ reshaped_weights_shape.collapse(3); @@ -143,7 +148,12 @@ protected: if(!reshape_weights) { const bool is_fully_connected_convolution = (output_shape.x() == 1 && output_shape.y() == 1); - const bool is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU >= CPUTarget::ARMV7 && data_type == DataType::F32; + bool is_optimised = false; +#if defined(__arm__) + is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU == CPUTarget::ARMV7 && data_type == DataType::F32; +#elif defined(__aarch64__) + is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU >= CPUTarget::ARMV8 && data_type == DataType::F32; +#endif /* defined(__arm__) || defined(__aarch64__) */ TensorShape tmp_weights_shape(weights_shape); SimpleTensor<T> tmp_weights(tmp_weights_shape, data_type, 1, fixed_point_position); |