www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Using LDC2 with --march=amdgcn

reply realhet <real_het hotmail.com> writes:
Hello,

I noticed that the LDC2 compiler has an architecture target 
called "AMD GCN".

Is there an example code which is in D and generates a working 
binary of a hello world kernel.

I tried it, and just failed at the very beginning: How can I 
specify __kernel and __global in D?
Jul 24 2022
next sibling parent Johan <j j.nl> writes:
On Sunday, 24 July 2022 at 18:44:42 UTC, realhet wrote:
 Hello,

 I noticed that the LDC2 compiler has an architecture target 
 called "AMD GCN".

 Is there an example code which is in D and generates a working 
 binary of a hello world kernel.

 I tried it, and just failed at the very beginning: How can I 
 specify __kernel and __global in D?
This sounds like something Nicholas Wilson would know more about, i.e. "dcompute" with LDC (https://github.com/libmir/dcompute). I don't think dcompute supports the architecture yet though... -Johan
Jul 24 2022
prev sibling parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Sunday, 24 July 2022 at 18:44:42 UTC, realhet wrote:
 Hello,

 I noticed that the LDC2 compiler has an architecture target 
 called "AMD GCN".

 Is there an example code which is in D and generates a working 
 binary of a hello world kernel.

 I tried it, and just failed at the very beginning: How can I 
 specify __kernel and __global in D?
As mentioned by Johan, LDC in conjunction with dcompute is the closest thing. You can use LDC to generate SPIR-V binaries with which I believe you should be able to use with the OpenCL implementation for that platform using dcompute to drive OpenCL.
Jul 26 2022