NPP Sobel example

Hi,
Do you have an example of a Sobel function usage ?
I would like to use the following function but constantly get error -14 (memset_error).
nppiFilterSobelHoriz_8u16s_C1R();

Here is example how I use it:
// Allocate the device memroy.
CUDAMEM_CHECK(cudaMalloc((void **)(&pDst_Horiz), sizeof(Npp16s) * wh)); //allocate memory for horizontal values
CUDAMEM_CHECK(cudaMalloc((void **)(&pDst_Vert), sizeof(Npp16s) * w
h)); //allocate memory for vertical values
CUDAMEM_CHECK(cudaMalloc((void **)(&pSrc), sizeof(Npp8u) * w*h)); //allocate memory for the source values

 CUDAMEM_CHECK(cudaMemcpy(pSrc, pInp, sizeof(Npp8u) * w*h, cudaMemcpyHostToDevice));

 printf("----START\nSrcStride = %d DstStride = %d\n",SrcStride,DstStride );

 NPP_CHECK(nppiFilterSobelHoriz_8u16s_C1R (pSrc, SrcStride-1, pDst_Horiz, DstStride-1, oSizeROI, NPP_MASK_SIZE_3_X_3 ));
 NPP_CHECK(nppiFilterSobelVert_8u16s_C1R  (pSrc, SrcStride-1, pDst_Vert,  DstStride-1, oSizeROI, NPP_MASK_SIZE_3_X_3 ));

 cudaDeviceSynchronize();

Thank you.

Dear yaroslav.taran,
Could you check https://devtalk.nvidia.com/default/topic/1056633/gpu-accelerated-libraries/nppifiltersobelhoriz_8u16s_c1r-crashes-after-cudadevicereset/ if you have same issue?