digitalmars.D.ldc - Compiling to SPIR
- John Colvin (6/6) Oct 15 2014 How unrealistic would it be to compile a small subset of D, e.g.
- Kai Nacke (11/17) Oct 15 2014 As far as I know SPIR is a LLVM IR subset based on LLVM 3.0.
- John Colvin (3/22) Oct 16 2014 SPIR 2.0 is based on llvm 3.2 IIRC. Is ldc likely to require >3.2
How unrealistic would it be to compile a small subset of D, e.g. betterc, to OpenCL SPIR https://www.khronos.org/spir ? It would be fantastic to use all of D's code-generation and compile-time abstractions for writing opencl kernels. In addition, compile-time introspection of the kernel code would allow for significant improvements in the host API.
Oct 15 2014
Hi John! On Wednesday, 15 October 2014 at 18:14:22 UTC, John Colvin wrote:How unrealistic would it be to compile a small subset of D, e.g. betterc, to OpenCL SPIR https://www.khronos.org/spir ? It would be fantastic to use all of D's code-generation and compile-time abstractions for writing opencl kernels. In addition, compile-time introspection of the kernel code would allow for significant improvements in the host API.As far as I know SPIR is a LLVM IR subset based on LLVM 3.0. Currently, I don't know what needs to be done here. But in general it should be possible. Here is a tutorial which shows how to compile Ada to a CUDA kernel: http://markmail.org/download.xqy?id=4xfv2vajltcydmhi&number=1 This can be done with D, too. It requires some fiddeling with address spaces which is currently not implemented. Regards, Kai
Oct 15 2014
On Thursday, 16 October 2014 at 04:32:58 UTC, Kai Nacke wrote:Hi John! On Wednesday, 15 October 2014 at 18:14:22 UTC, John Colvin wrote:SPIR 2.0 is based on llvm 3.2 IIRC. Is ldc likely to require >3.2 any time soon?How unrealistic would it be to compile a small subset of D, e.g. betterc, to OpenCL SPIR https://www.khronos.org/spir ? It would be fantastic to use all of D's code-generation and compile-time abstractions for writing opencl kernels. In addition, compile-time introspection of the kernel code would allow for significant improvements in the host API.As far as I know SPIR is a LLVM IR subset based on LLVM 3.0. Currently, I don't know what needs to be done here.But in general it should be possible. Here is a tutorial which shows how to compile Ada to a CUDA kernel: http://markmail.org/download.xqy?id=4xfv2vajltcydmhi&number=1 This can be done with D, too. It requires some fiddeling with address spaces which is currently not implemented. Regards, Kai
Oct 16 2014