ldc/dcompute nvptx intrinsics

Johan Engelen j at j.nl
Sat Feb 20 12:38:35 UTC 2021


On Friday, 19 February 2021 at 20:02:29 UTC, Bruce Carneal wrote:
>
> 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?

Hi Bruce,
   You can write LLVM IR inside D code using ldc.llvmasm.__irEx. 
Perhaps that works as a quick workaround for defining calls to 
intrinsics.
Very quickly, something like this:

```
alias someFunction = __irEx!("forward declaration of intrinsic", 
"call intrinsic(%0,%1,%2)", int, long, void*);
```

-Johan



More information about the digitalmars-d-ldc mailing list