def METHOD_NAME(res):
    sm = cuda.shared.array(32, int32)
    i = cuda.grid(1)
    sm[i] = i
    cuda.syncwarp()
    if i < 16:
        sm[i] = sm[i] + sm[i + 16]
        cuda.syncwarp(0xFFFF)
    if i < 8:
        sm[i] = sm[i] + sm[i + 8]
        cuda.syncwarp(0xFF)
    if i < 4:
        sm[i] = sm[i] + sm[i + 4]
        cuda.syncwarp(0xF)
    if i < 2:
        sm[i] = sm[i] + sm[i + 2]
        cuda.syncwarp(0x3)
    if i == 0:
        res[0] = sm[0] + sm[1]