     for(; st < stEnd; ++st)
     {
         const float stage = stages(0, st);
-#if defined LOG_CUDA_CASCADE
-        printf("Stage: %f\n", stage);
-#endif
+        dprintf("Stage: %f\n", stage);
         {
             const int nId = st * 3;
 
             // work with root node
             const Node node = ((const Node*)nodes.ptr())[nId];
-#if defined LOG_CUDA_CASCADE
-            printf("Node: %d %f\n", node.feature, node.threshold);
-#endif
+
+            dprintf("Node: %d %f\n", node.feature, node.threshold);
+
             const Feature feature = ((const Feature*)features.ptr())[node.feature];
 
             uchar4 scaledRect = feature.rect;


//#define LOG_CUDA_CASCADE

namespace cv { namespace gpu { namespace device {

namespace icf {

float __device get(const int* __restrict__ hogluv, const int pitch,
                   const int x, const int y, int channel, uchar4 area)
{
    dprintf("feature box %d %d %d %d ", area.x, area.y, area.z, area.w);
    dprintf("get for channel %d\n", channel);
    dprintf("extract feature for: [%d %d] [%d %d] [%d %d] [%d %d]\n",
        x + area.x, y + area.y,  x + area.z, y + area.y,  x + area.z,y + area.w,
        x + area.x, y + area.w);
    dprintf("at point %d %d with offset %d\n", x, y, 0);

    const int* curr = hogluv + ((channel * 121) + y) * pitch;

