Nppi resize doesn't work with 1x1px

Hi,

When I run an nppi resize (nppiResize_8u_C3R) function, setting an source image size to a very small number (eg, 1x1 px, 2x2 px) returns an NPP_RESIZE_NO_OPERATION_ERROR. However, the same code will work with images of larger sizes. Why does this happen?

    cv::Mat image = cv::imread("pur.png");
    int outheight = 10;
    int outwidth = 10;
    int outSize = outwidth * outheight * sizeof(uchar3);

    int inheight = image.rows;
    int inwidth = image.cols;
    int memSize = inwidth * inheight * sizeof(uchar3);

    NppiSize srcsize = {inwidth, inheight};
    NppiRect srcroi = {0, 0, inwidth, inheight};
    NppiSize dstsize = {outwidth, outheight};
    NppiRect dstroi = {0, 0, outwidth, outheight};

    uchar3* d_src = NULL;
    uchar3* d_dst = NULL;
    cudaMalloc((void**)&d_src, memSize);
    cudaMalloc((void**)&d_dst, outSize);
    cudaMemcpy(d_src, image.data, memSize, cudaMemcpyHostToDevice);

    NppStatus status = nppiResize_8u_C3R( (Npp8u*) d_src, inwidth*3, srcsize, srcroi,
                       (Npp8u*) d_dst, outwidth*3, dstsize, dstroi,
            NPPI_INTER_LINEAR);

    cv::Mat newImage(outheight, outwidth, CV_8UC3);
    cudaMemcpy(newImage.data, d_dst, outSize, cudaMemcpyDeviceToHost);
    cv::imwrite("qqqgpu.jpg", newImage);
    cudaFree(d_src);
    cudaFree(d_dst);

Dear @syther666
Thank you for contacting NVIDIA developer forum. This query does not come under NvAPI SDK ownership. Let me find the correct section for this topic and move it there for further assistance.

Thanks,
NVAPI Forum Moderator

Hello @syther666,

I am going to move this topic to the CUDA Programming and Performance category for CUDA support to look at.

I don’t have any trouble with 2x2 pixel case on CUDA 11.4.1

With 1x1 input size, I do see the -201 error. (I see it if either input dimension is 1). If this is a concern for you, I suggest filing a bug.

My guess would be that this is a documentation issue, and the documentation may be updated to reflect that this function is not usable when either input dimension is 1.

If you can demonstrate that the equivalent ipp function does something different for this kind of input case, that would bolster any claims you might make to lobby for a change in behavior. You should provide that info in the bug you file.