jdoerfert added inline comments.

================
Comment at: clang/lib/CodeGen/CGGPUBuiltin.cpp:128
   return RValue::get(Builder.CreateCall(
       VprintfFunc, {Args[0].getRValue(*this).getScalarVal(), BufferPtr}));
 }
----------------
>>! In D112504#3086474, @JonChesterfield wrote:
> That's an interesting approach.
> 
> Do you happen to know where I can find details of the data format behind that 
> void*? Have been meaning to look at writing printf for amdgpu as host side 
> decoding of that buffer. If the compiler knows how long it is, that would be 
> a useful third argument.

We actually do know. Above we allocate and fill the buffer. For the OpenMP 
wrapper you could easily add a third argument later in order to facilitate an 
OpenMP runtime printf impl. I would even like it to be target agnostic (e.g., 
replace the default CUDA route on request). That said, we should tackle that 
separately, wdyt?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112504/new/

https://reviews.llvm.org/D112504

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to