Skip to content

Commit

Permalink
Restore preprocessor hash character in inline assembly macros (#390)
Browse files Browse the repository at this point in the history
Commit 319a19e removed a hash
character (#) that was used the HIPCUB_ASM_THREAD_LOAD/STORE macros
to ensure the preprocessor interpreted the wait_inst argument correctly.
At the time, the removal of this character did not cause build errors.

Compiler changes since then have made the hash necessary. This change
just adds it back in.
  • Loading branch information
umfranzw authored Aug 1, 2024
1 parent 6d62b9b commit cac6bcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ HIPCUB_DEVICE __forceinline__ T AsmThreadLoad(void * ptr)
{ \
interim_type retval; \
asm volatile(#asm_operator " %0, %1 " llvm_cache_modifier "\n\t" \
wait_inst wait_cmd "(%2)" \
#wait_inst wait_cmd "(%2)" \
: "=" #output_modifier(retval) \
: "v"(ptr), "I"(0x00)); \
return retval; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ HIPCUB_DEVICE __forceinline__ void AsmThreadStore(void * ptr, T val)
{ \
interim_type temp_val = val; \
asm volatile(#asm_operator " %0, %1 " llvm_cache_modifier "\n\t" \
wait_inst wait_cmd "(%2)" \
#wait_inst wait_cmd "(%2)" \
: : "v"(ptr), #output_modifier(temp_val), "I"(0x00)); \
}

Expand Down

0 comments on commit cac6bcd

Please sign in to comment.