diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/CL/kernels/CLGEMMTranspose1xWKernel.cpp | 5 | ||||
-rw-r--r-- | src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/core/CL/kernels/CLGEMMTranspose1xWKernel.cpp b/src/core/CL/kernels/CLGEMMTranspose1xWKernel.cpp index 27b215f2c8..5057c8ff21 100644 --- a/src/core/CL/kernels/CLGEMMTranspose1xWKernel.cpp +++ b/src/core/CL/kernels/CLGEMMTranspose1xWKernel.cpp @@ -57,8 +57,7 @@ void CLGEMMTranspose1xWKernel::configure(const ICLTensor *input, ICLTensor *outp ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT(input, output); const unsigned int num_elems_processed_per_iteration = 16 / input->info()->element_size(); - const float scale_x = num_elems_processed_per_iteration; - ARM_COMPUTE_ERROR_ON((0 == static_cast<int>(input->info()->dimension(0) * (1.f / scale_x)))); + const int scale_x = num_elems_processed_per_iteration; _input = input; _output = output; @@ -80,6 +79,8 @@ void CLGEMMTranspose1xWKernel::configure(const ICLTensor *input, ICLTensor *outp // Configure window Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration)); + ARM_COMPUTE_ERROR_ON_MSG((win.x().end() / scale_x) == 0, "Transposed shape would be 0 in the second dimension"); + AccessWindowHorizontal input_access(input->info(), 0, num_elems_processed_per_iteration); AccessWindowTranspose output_access(output->info(), 0, 0, num_elems_processed_per_iteration, 1, scale_x, 1.f / scale_x); diff --git a/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp b/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp index 881ef122a1..95063a7875 100644 --- a/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp @@ -60,14 +60,16 @@ void NEGEMMTranspose1xWKernel::configure(const ITensor *input, ITensor *output) ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT(input, output); const unsigned int num_elems_processed_per_iteration = 16 / input->info()->element_size(); - const float scale_x = num_elems_processed_per_iteration; - ARM_COMPUTE_ERROR_ON((0 == static_cast<int>(input->info()->dimension(0) * (1.f / scale_x)))); + const int scale_x = num_elems_processed_per_iteration; _input = input; _output = output; // Configure kernel window - Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration)); + Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration)); + + ARM_COMPUTE_ERROR_ON_MSG((win.x().end() / scale_x) == 0, "Transposed shape would be 0 in the second dimension"); + AccessWindowTranspose output_access(output->info(), 0, 0, num_elems_processed_per_iteration, 1, scale_x, 1.f / scale_x); update_window_and_padding(win, |