                               uint* gridMarkerIndex,
                               uint* cellStart,
                               uint* cellEnd,
-                              const size_t numFluidMarkers,
-                              const size_t numBounMarkers,
-                              const size_t numRigidMarkers,
-                              const size_t numAllMarkers,
                               volatile bool* isErrorD) {
     uint id = blockIdx.x * blockDim.x + threadIdx.x;
-    if (id >= numAllMarkers - numBounMarkers)
+    if (id >= numObjectsD.numAllMarkers - numObjectsD.numBoundaryMarkers)
         return;
 
     uint index = indexOfIndex[id];


    Real G_i[9] = {0.0};
    calc_G_Matrix(sortedPosRad, sortedVelMas, sortedRhoPreMu, G_i, cellStart, 
        cellEnd, numFluidMarkers, numBounMarkers, numRigidMarkers, indexOfIndex);

    // get address in grid
    int3 gridPos = calcGridPos(posRadA);

        calcKernelSupport<<<numBlocks, numThreads>>>(
            mR4CAST(sortedSphMarkersD->posRadD), mR4CAST(sortedSphMarkersD->rhoPresMuD),
            mR3CAST(sortedKernelSupport), U1CAST(markersProximityD->cellStartD),
            U1CAST(markersProximityD->cellEndD), isErrorD);
        ChUtilsDevice::Sync_CheckError(isErrorH, isErrorD, "calcKernelSupport");
    }

