ldc nvvm GPU intrinsics good news
Johan Engelen
j at j.nl
Sun Apr 25 22:26:06 UTC 2021
On Friday, 5 March 2021 at 00:03:26 UTC, Bruce Carneal wrote:
> After updating the first line to
> '@compute(CompileFor.hostAndDevice) module ...' and adding an
> 'import ldc.dcompute;' line, the
> runtime/import/ldc/gccbuiltins_nvvm.di file from a current LDC
> build apparently gives access to all manner of GPU intrinsics.
Hi Bruce,
Why not submit a PR that modifies `gen_gccbuiltins.cpp` such
that it adds the `@compute` attribute for the relevant intrinsics
files?
I think it's OK if `gen_gccbuiltins` contains some hacks like
that . Please add a small compile test case, so we verify that it
won't bitrot in the future.
Wouldn't `@compute(CompileFor.deviceOnly)` make more sense,
because the intrinsics will not be available on normal CPUs
anyway?
I hope all your work will land in either LDC or dcompute's
repositories, such that others can easily benefit from it.
cheers,
Johan
More information about the digitalmars-d-ldc
mailing list