Hi,
i’m using the (up to date) sample code from GitHub and implemented the function nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx at 4_CUDA_Libraries / batchedLabelMarkersAndLabelCompressionNPP / batchedLabelMarkersAndLabelCompressionNPP.cpp as pasted below.
This code snipped is placed right after the last cudaStreamSynchronize in the images loop at line 484.
While the results seems to be ok (nMarkerLabelPixelCount and oMarkerLabelBoundingBox) the function always returns NPP_CUDA_KERNEL_EXECUTION_ERROR (-1000).
When using the same code in my own test application, the same error is returned, but also the results are zero. But here I will have to do some more checks for my own before posting them.
Anyone worked with this functions already? I dont think this return value is OK, is somethng missing or am I doing something wrong?
I would really appreciate to have some sample code at GitHub for this functions, especially for the optional data which is NULL at my sample code (I guess I will need them later in my project)
Here is the code:
unsigned int nInfoListSize = 0;
nppStatus = nppiCompressedMarkerLabelsUFGetInfoListSize_32u_C1R(nCompressedLabelCount, &nInfoListSize);
NppiCompressedMarkerLabelsInfo* pMarkerLabelsInfoList, * pMarkerLabelsInfoListHost;
cudaError = cudaMalloc((void**)&pMarkerLabelsInfoList, nInfoListSize);
cudaError = cudaMallocHost((void**)&pMarkerLabelsInfoListHost, nInfoListSize);
nppStatus = nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx(
pUFLabelDev[nImage], oSizeROI[nImage].width * sizeof(Npp32u), oSizeROI[nImage],
nCompressedLabelCount, pMarkerLabelsInfoList,
NULL, 0,
NULL, 0,
NULL,
NULL,
NULL,
NULL,
NULL,
nppStreamCtx);
memset(pMarkerLabelsInfoListHost, 0, nInfoListSize);
cudaError = cudaMemcpy(
pMarkerLabelsInfoListHost,
pMarkerLabelsInfoList,
nInfoListSize,
cudaMemcpyDeviceToHost);
if (pMarkerLabelsInfoList != 0) cudaFree(pMarkerLabelsInfoList);
if (pMarkerLabelsInfoListHost != 0) cudaFreeHost(pMarkerLabelsInfoListHost);
Many thanks in advance,
Manfred
Im working on Win 10, VisualStudio 2022, CUDA Version 11.6, Quadro T2000, Driver Version 511.23