Do nppiTranspose have image size limit?

I don’t see any specific limit mentioned in the documentation. The size of the operation is governed by the oSrcROI parameter, which is an NppSize type, which contains two int quantities to indicate the horizontal and vertical size of the transpose operation. Therefore my assumption would be that you want to choose image dimensions that can be “safely” represented in int type, including the product of the horizontal and vertical dimension, i.e. as if you were indexing into it with a single index.

With that proviso, a transpose of dimensions 32,768x32,768 (which comes out to 1 GB of data, for one channel Npp8u image pixel type) seems to work properly for me:

# cat t250.cu
#include <npp.h>
#include <iostream>

const int idim=32768;
const int s = idim*idim;

int main(){

  Npp8u *h, *d, *o;
  h = new Npp8u[s];
  cudaMalloc(&d, sizeof(d[0])*s);
  cudaMalloc(&o, sizeof(o[0])*s);
  for (int i = 0; i < s; i++) h[i] = i%3;
  cudaMemcpy(d, h, s, cudaMemcpyHostToDevice);
  NppiSize ns = {idim, idim};
  NppStatus stat = nppiTranspose_8u_C1R(d, idim, o, idim, ns);
  if (stat != NPP_SUCCESS) std::cout << "Npp error: " << (int)stat << std::endl;
  cudaMemcpy(h, o, s, cudaMemcpyDeviceToHost);
  for (int i = 0; i < idim; i++)
    for (int j = 0; j < idim; j++)
      if (h[j*idim+i] != (i*idim+j)%3) {std::cout << "Mismatch at: " << j*idim+i << " was: " << h[j*idim+i] << " should be: " << (i*idim+j)%3 << std::endl; return 0;}
  std::cout << "Success" << std::endl;
  return 0;
}

# nvcc -o t250 t250.cu -lnppidei
# compute-sanitizer ./t250
========= COMPUTE-SANITIZER
Success
========= ERROR SUMMARY: 0 errors
#