Skip to content

Commit

Permalink
insert memory fence to avoid AMD OpenCL compiler reordering the read/…
Browse files Browse the repository at this point in the history
…writes
  • Loading branch information
rosenrodt committed Jan 18, 2019
1 parent 2135633 commit 81dc8c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/boost/compute/algorithm/detail/radix_sort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ const char radix_sort_source[] =
" uint sum = 0;\n"
" for(uint i = 0; i < K2_BITS; i++){\n"
" uint x = global_offsets[i] + last_block_offsets[i];\n"
" mem_fence(CLK_GLOBAL_MEM_FENCE);\n" // work around the RX 500/Vega bug, see #811
" global_offsets[i] = sum;\n"
" sum += x;\n"
" mem_fence(CLK_GLOBAL_MEM_FENCE);\n" // work around the RX Vega bug, see #811
" }\n"
"}\n"

Expand Down

0 comments on commit 81dc8c7

Please sign in to comment.