[Openmp-commits] [PATCH] D112504: [OpenMP] Wrap (v)printf in the new RT and use same handling for AMD

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Oct 26 06:33:21 PDT 2021


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



More information about the Openmp-commits mailing list