 float __device icf::Cascade::rescale(const icf::Level& level, uchar4& scaledRect,
                                      const int channel, const float threshold) const
 {
-#if defined LOG_CUDA_CASCADE
-    printf("feature %d box %d %d %d %d\n", channel, scaledRect.x, scaledRect.y, scaledRect.z, scaledRect.w);
-    printf("rescale: %f [%f %f]\n",level.relScale, level.scaling[0], level.scaling[1]);
-#endif
+    dprintf("feature %d box %d %d %d %d\n", channel, scaledRect.x, scaledRect.y, scaledRect.z, scaledRect.w);
+    dprintf("rescale: %f [%f %f]\n",level.relScale, level.scaling[0], level.scaling[1]);
 
     float relScale = level.relScale;
     float farea = (scaledRect.z - scaledRect.x) * (scaledRect.w - scaledRect.y);


            float sum = get(hogluv,pitch, x, y, feature.channel, scaledRect);

#if defined LOG_CUDA_CASCADE
            printf("root feature %d %f\n",feature.channel, sum);
#endif
            int next = 1 + (int)(sum >= threshold);

#if defined LOG_CUDA_CASCADE
            printf("go: %d (%f >= %f)\n\n" ,next, sum, threshold);
#endif
            // leaves
            const Node leaf = ((const Node*)nodes.ptr())[nId + next];
            const Feature fLeaf = ((const Feature*)features.ptr())[leaf.feature];

    const int x = blockIdx.x * blockDim.x + threadIdx.x;
    // if (x > 0 || y > 0) return;

    Level level = lls[blockIdx.z];
    if (x >= level.workRect.x || y >= level.workRect.y) return;

    dprintf("level: %d (%f %f) [%f %f] (%d %d) (%d %d)\n", level.octave, level.relScale, level.shrScale,
        level.scaling[0], level.scaling[1], level.workRect.x, level.workRect.y, level.objSize.x, level.objSize.y);

    const Octave octave = ((const Octave*)octaves.ptr())[level.octave];
    // printf("Octave: %d %d %d (%d %d) %f\n", octave.index, octave.stages,
