Hi,
I am having an issue with Npp channel copy giving me back the -14 error (NPP_STEP_ERROR), even though debugging shows that these are correctly assigned.
Npp8u* meanDevBuf;
Npp32f* cudaPtr;
Npp32f* cudaC1Ptr;
Npp64f *mean, *dev;
NppiSize size{ w, h };
int bufSize{ 0 };
nppiMeanStdDevGetBufferHostSize_32f_C1R(size, &bufSize);
cudaMalloc((void **)(&meanDevBuf), bufSize);
cudaMallocManaged( ( void ** )( &mean ), sizeof(Npp64f) );
cudaMallocManaged( ( void ** )( &dev ), sizeof(Npp64f) );
cudaDeviceSynchronize();
int stepBytes{ 0 };
cudaPtr = nppiMalloc_32f_C4(size.width, size.height, &stepBytes);
// this code is copying our source data from our buffer, I verified it and it works
auto cuSource = std::dynamic_pointer_cast<CudaImage>(source);
cuSource->getCuImage()->copyToDevice(cudaPtr, stepBytes);
int stepBytesC1{ 0 };
cudaC1Ptr = nppiMalloc_32f_C1(size.width, size.height, &stepBytesC1);
std::vector<float> avgVector(4), devVector(4);
for (int i = 0; i < 3; i++) {
// this copy throws an error
nppiCopy_32f_C4CR(cudaPtr + i, stepBytes, cudaC1Ptr, stepBytesC1, size);
nppiMean_StdDev_32f_C1R(cudaC1Ptr, stepBytesC1, size, meanDevBuf, mean, dev);
cudaDeviceSynchronize();
avgVector[i] = static_cast<float>( *mean );
devVector[i] = static_cast<float>( *dev );
}
Any suggestions would be welcome.