Warp-wide sum via a shared-memory tree versus __shfl_down_sync

Both kernels below sum the 32 values held by a single warp's threads (one value per lane) down to a single result in lane 0. Which is the more accurate characterization?

kernel.cu
// Version A: shared-memory tree reduction
__shared__ float sdata[32];
sdata[threadIdx.x] = val;
__syncthreads();
for (int s = 16; s > 0; s >>= 1) {
    if (threadIdx.x < s) sdata[threadIdx.x] += sdata[threadIdx.x + s];
    __syncthreads();
}
// result in sdata[0]

// Version B: warp shuffle reduction
for (int offset = 16; offset > 0; offset >>= 1) {
    val += __shfl_down_sync(0xFFFFFFFF, val, offset);
}
// result in lane 0's val

17 of 46 in GPU / CUDA