                 // prev value.
                 //prev_score = __shfl_down_sync(0x1, score, 31);//score;
 
-                if (thread_idx == 31)
+                if (thread_idx == (WARP_SIZE - 1))
                 {
                     prev_score[0] = score;
                 }


#include "cudapoa_kernels.cuh"
#include <stdio.h>

namespace nvidia {


                // prev value.
                //prev_score = __shfl_down_sync(0x1, score, 31);//score;

                if (thread_idx == (2 * WARP_SIZE - 1))
                {
                    prev_score[0] = score;
                }
