 void TrueBroadcastIntHelper<X>::exec(const nd4j::broadcast::IntOps opNum, const NDArray& xArr, const NDArray& yArr, NDArray& zArr) {
 
     dim3 launchDims;
-    launchDims.x = 128; //MAX_NUM_THREADS / 8;   // threadsPerBlock
-    launchDims.y = 256; //(zArr.lengthOf() + launchDims.x - 1) / launchDims.x;  // blocksPerGrid
-    launchDims.z = 1024; // sharedMem
+
+    launchDims.y = MAX_NUM_THREADS / 8;   // threadsPerBlock
+    launchDims.x = (zArr.lengthOf() + launchDims.y - 1) / launchDims.y;  // blocksPerGrid
+    launchDims.z = sizeof(Nd4jLong) * launchDims.y * (xArr.rankOf() + yArr.rankOf() + zArr.rankOf()) + 128; // sharedMe
 
     PointersManager manager(xArr.getContext(), "TrueBroadcastIntHelper<X>::exec");
 


        for(int ix = xRank - 1, iy = yRank - 1, iz = zRank - 1; iz >= 0; --iz) {

            if(ix >= 0) {
                if (xShapeInfo[ix + 1] == zShapeInfo[iz + 1])
                    xCoords[ix--] = zCoords[iz];
                else
                    xCoords[ix--] = 0;
            }

            if(iy >= 0) {
                if (yShapeInfo[iy + 1] == zShapeInfo[iz + 1])
                    yCoords[iy--] = zCoords[iz];
                else
                    yCoords[iy--] = 0;
            }
        }

        const auto xOffset = shape::getOffset(xShapeInfo, xCoords);


    dim3 launchDims;

    launchDims.y = MAX_NUM_THREADS / 8;   // threadsPerBlock
    launchDims.x = (zArr.lengthOf() + launchDims.y - 1) / launchDims.y;  // blocksPerGrid
    launchDims.z = sizeof(Nd4jLong) * launchDims.y * (xArr.rankOf() + yArr.rankOf() + zArr.rankOf()) + 128; // sharedMe

    PointersManager manager(xArr.getContext(), "TrueBroadcastHelper<X,Y,Z>::exec");

