File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -1557,30 +1557,19 @@ __kernel void reduction_##bin_op##_##type(__global type* buffer,\
1557
1557
int group_id = get_group_id(0);\
1558
1558
int local_id = get_local_id(0);\
1559
1559
int group_size = get_local_size(0);\
1560
- \
1561
1560
if (global_id < count)\
1562
- {\
1563
- *(shared_mem + local_id) = buffer[global_id];\
1564
- }\
1561
+ shared_mem[local_id] = buffer[global_id];\
1565
1562
else\
1566
- {\
1567
- *(shared_mem + local_id) = neutral_##bin_op##_##type;\
1568
- }\
1569
- \
1563
+ shared_mem[local_id] = neutral_##bin_op##_##type;\
1570
1564
barrier(CLK_LOCAL_MEM_FENCE);\
1571
1565
for (int i = group_size / 2; i > 0; i >>= 1)\
1572
1566
{\
1573
1567
if (local_id < i)\
1574
- {\
1575
- *(shared_mem + local_id) = bin_op(shared_mem[local_id], shared_mem[local_id + i]);\
1576
- }\
1568
+ shared_mem[local_id] = bin_op(shared_mem[local_id], shared_mem[local_id + i]);\
1577
1569
barrier(CLK_LOCAL_MEM_FENCE);\
1578
1570
}\
1579
- \
1580
1571
if (local_id == 0)\
1581
- {\
1582
1572
atomic_##bin_op##_##type(out, shared_mem[0]);\
1583
- }\
1584
1573
}
1585
1574
1586
1575
// --------------------- NORMALIZATION ------------------------
@@ -1594,9 +1583,7 @@ __kernel void buffer_normalization_##type(__global type* input,\
1594
1583
{\
1595
1584
int global_id = get_global_id(0);\
1596
1585
if (global_id < count)\
1597
- {\
1598
1586
output[global_id] = input[global_id] / (max - min);\
1599
- }\
1600
1587
}
1601
1588
1602
1589
// Do not change the order
You can’t perform that action at this time.
0 commit comments