     } else if (alpha.x == 0.0f && alpha.y == 0.0f) {
         axpy_kernel0_run(n, y, incy);
     } else {
-        axpy_kernel_run(n, alpha, x, incx, y, incy);
+        if (incx == 1 && incy == 1) {
+            axpy_kernel_run_flat(n, alpha, x, y);
+        } else {
+            axpy_kernel_run(n, alpha, x, incx, y, incy);
+        }
     }
 }
 

// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

#include "egblas/axpy.hpp"

#include "complex.hpp"


    const auto stride = blockDim.x * gridDim.x;

    for (; index < n; index += stride) {
        y[incy * index] += alpha * x[incx * index];
    }
}

template <typename T>
__global__ void axpy_kernel_flat(size_t n, T alpha, const T* x, T* y) {
    auto index  = threadIdx.x + blockIdx.x * blockDim.x;
    const auto stride = blockDim.x * gridDim.x;

    for (; index < n; index += stride) {
        y[index] += alpha * x[index];
    }
}

