Skip to content

Commit 8a24547

Browse files
committed
LLVM AMDGPU inline asm
1 parent 124999d commit 8a24547

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/scope/do_not_optimize.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ do_not_optimize(Tp const &value) {
88
}
99

1010
// https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints
11+
// https://github.com/ROCm-Developer-Tools/HIP/tree/master/samples/2_Cookbook/10_inline_asm
1112
template <class Tp>
1213
__device__ void __attribute__((always_inline)) do_not_optimize(Tp &value) {
1314
#if defined(__HIP_DEVICE_COMPILE__)
14-
asm volatile("" : "+v"(value) : : "memory");
15+
asm volatile("" : "=v,m"(value) : : "memory");
1516
#else
1617
asm volatile("" : "+r,m"(value) : : "memory");
1718
#endif

0 commit comments

Comments
 (0)