ldc/dcompute nvptx intrinsics

Bruce Carneal bcarneal at gmail.com
Fri Feb 19 20:02:29 UTC 2021


LLVM appears to "know" about most if not all of the CUDA 
intrinsics as can be seen here: 
https://github.com/llvm-mirror/llvm/blob/master/lib/Target/NVPTX/NVPTXIntrinsics.td

I've successfully mimicked dcompute's pragma(LDC_intrinsic 
"llvm.nvvm...") idiom for some things but have not succeeded in 
implementing "ballot" or other important CUDA intrinsics that are 
commented out in dcompute.std.warp.d.  Perhaps I'm just not 
uttering the correct incantations...

I'd love to bring up some additional functionality but I'm new to 
LDC/LLVM so it's slow going at this point of the learning curve.  
Does anyone have additional LDC/dcompute CUDA intrinsics working 
or have some pointers for bringing up more CUDA/warp intrinsics 
generally?

I'm considering trying to merge a hand written PTX file in at 
build time and falling back to C++/CUDA if all else fails.  
Anything that will help me avoid a trip to the dark side would be 
much appreciated.



More information about the digitalmars-d-ldc mailing list