Jump to page: 1 2
Thread overview
DCompute - Native heterogeneous computing for D - is here!
Feb 26, 2017
Nicholas Wilson
Feb 26, 2017
Rory McGuire
Feb 26, 2017
jmh530
Feb 27, 2017
Nicholas Wilson
Feb 27, 2017
Mike Parker
Feb 27, 2017
Nicholas Wilson
Feb 27, 2017
Nicholas Wilson
Feb 27, 2017
Mike Parker
Feb 27, 2017
Mike Parker
Feb 27, 2017
Guillaume Piolat
Feb 27, 2017
Nicholas Wilson
Feb 27, 2017
Guillaume Piolat
Feb 28, 2017
Nicholas Wilson
February 26, 2017
DCompute is an extension to LDC capable of generating code (with no language changes*) for NVIDIA's NVPTX for use with CUDA, SPIRV for use with the OpenCL runtime, and of course the host, all at the same time! It is also possible to share implementation of algorithms across the host and device.
This will enable writing kernels in D utilising all of D's meta programming goodness across the device divide and will allow launching those kernels with a level of ease on par with CUDA's <<<...>>> syntax. I hope to be giving a talk at DConf2017 about this ;), what it enables us to do, what still needs to be done and future plans.

DCompute supports all of OpenCL except Images and Pipes (support is planned though).
I haven't done any test for CUDA so I'm not sure about the extent of support for it, all of the math stuff works, images/textures not so sure.

Many thanks to the ldc team (especially Johan) for their guidance and patience, Ilya for reminding me that I should upstream my work and John Colvin for his DConf2016 talk for making me think 'surely compiler support can't be too hard'. 10 months later: here it is!

The DCompute compiler is available at the dcompute branch of ldc [0], you will need my fork of llvm here[1] and the SPIRV submodule that comes with it [2] as the llvm to link against. There is also a tool for interconversion [3] (I've mucked up the submodules a bit, sorry, just clone it into 'tools/llvm-spirv', it's not necessary anyway). The device standard library and drivers (both WIP) are available here[4].

Please sent bug reports to their respective components, although I'm sure I'll see them anyway regardless of where they go.

[0]: https://github.com/ldc-developers/ldc/tree/dcompute
[1]: https://github.com/thewilsonator/llvm/tree/compute
[2]: https://github.com/thewilsonator/llvm-target-spirv
[3]: https://github.com/thewilsonator/llvm-tool-spirv
[4]: https://github.com/libmir/dcompute

* modulo one hack related to resolving intrinsics because there is no static context (i.e. static if) for the device(s). Basically a 'codegen time if'.
February 26, 2017
On Sun, Feb 26, 2017 at 10:37 AM, Nicholas Wilson via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> DCompute is an extension to LDC capable of generating code (with no language changes*) for NVIDIA's NVPTX for use with CUDA, SPIRV for use with the OpenCL runtime, and of course the host, all at the same time! It is also possible to share implementation of algorithms across the host and device. This will enable writing kernels in D utilising all of D's meta programming goodness across the device divide and will allow launching those kernels with a level of ease on par with CUDA's <<<...>>> syntax. I hope to be giving a talk at DConf2017 about this ;), what it enables us to do, what still needs to be done and future plans.
>

Awesome! Been wanting this feature since ldc started catching up to dmd.
February 26, 2017
On Sunday, 26 February 2017 at 08:37:29 UTC, Nicholas Wilson wrote:
> DCompute is an extension to LDC capable of generating code (with no language changes*) for NVIDIA's NVPTX for use with CUDA, SPIRV for use with the OpenCL runtime, and of course the host, all at the same time! It is also possible to share implementation of algorithms across the host and device.
> This will enable writing kernels in D utilising all of D's meta programming goodness across the device divide and will allow launching those kernels with a level of ease on par with CUDA's <<<...>>> syntax. I hope to be giving a talk at DConf2017 about this ;), what it enables us to do, what still needs to be done and future plans.

Great work.


February 27, 2017
On Sunday, 26 February 2017 at 08:37:29 UTC, Nicholas Wilson wrote:
> DCompute is an extension to LDC capable of generating code (with no language changes*) for NVIDIA's NVPTX for use with

Hmm, I appear to have really mucked up the git submodules. Unfortunately I have a cold at the moment and fighting git is beyond me at the best of times but I'm completely stumped here, PRs appreciated. Once this is sorted I'll do a tag and release.

Thanks for the appreciation, please let me know about your experiences/bug reports.
February 27, 2017
On Monday, 27 February 2017 at 08:37:56 UTC, Nicholas Wilson wrote:
> On Sunday, 26 February 2017 at 08:37:29 UTC, Nicholas Wilson wrote:
>> DCompute is an extension to LDC capable of generating code (with no language changes*) for NVIDIA's NVPTX for use with
>
> Hmm, I appear to have really mucked up the git submodules. Unfortunately I have a cold at the moment and fighting git is beyond me at the best of times but I'm completely stumped here, PRs appreciated. Once this is sorted I'll do a tag and release.
>
> Thanks for the appreciation, please let me know about your experiences/bug reports.

Give the thumbs up on this and I'll put it on reddit in the next window.
February 27, 2017
On Monday, 27 February 2017 at 09:13:22 UTC, Mike Parker wrote:
> On Monday, 27 February 2017 at 08:37:56 UTC, Nicholas Wilson wrote:
>> On Sunday, 26 February 2017 at 08:37:29 UTC, Nicholas Wilson wrote:
>>> DCompute is an extension to LDC capable of generating code (with no language changes*) for NVIDIA's NVPTX for use with
>>
>> Hmm, I appear to have really mucked up the git submodules. Unfortunately I have a cold at the moment and fighting git is beyond me at the best of times but I'm completely stumped here, PRs appreciated. Once this is sorted I'll do a tag and release.
>>
>> Thanks for the appreciation, please let me know about your experiences/bug reports.
>
> Give the thumbs up on this and I'll put it on reddit in the next window.

Once I get the submodule stuff fixed and do a release of llvm I'll let you know.
Hopefully some time tomorrow morning (UTC+8), but maybe in the afternoon.
February 27, 2017
On Monday, 27 February 2017 at 09:13:22 UTC, Mike Parker wrote:
> On Monday, 27 February 2017 at 08:37:56 UTC, Nicholas Wilson wrote:
>> On Sunday, 26 February 2017 at 08:37:29 UTC, Nicholas Wilson wrote:
>>> DCompute is an extension to LDC capable of generating code (with no language changes*) for NVIDIA's NVPTX for use with
>>
>> Hmm, I appear to have really mucked up the git submodules. Unfortunately I have a cold at the moment and fighting git is beyond me at the best of times but I'm completely stumped here, PRs appreciated. Once this is sorted I'll do a tag and release.
>>
>> Thanks for the appreciation, please let me know about your experiences/bug reports.
>
> Give the thumbs up on this and I'll put it on reddit in the next window.

Actually I've got the submodules working so feel free to go ahead, the release is only for OSX for ldc's CI. If you could let me know when that window is I could post an AMA if I'm awake then.
February 27, 2017
On Monday, 27 February 2017 at 13:19:00 UTC, Nicholas Wilson wrote:

>
> Actually I've got the submodules working so feel free to go ahead, the release is only for OSX for ldc's CI. If you could let me know when that window is I could post an AMA if I'm awake then.

Now is a great time.

February 27, 2017
On Monday, 27 February 2017 at 13:19:00 UTC, Nicholas Wilson wrote:

>
> Actually I've got the submodules working so feel free to go ahead, the release is only for OSX for ldc's CI. If you could let me know when that window is I could post an AMA if I'm awake then.

Direct your AMA here:

https://www.reddit.com/r/programming/comments/5wgqmb/dcompute_native_heterogeneous_computing_for_d_is/
February 27, 2017
On Sunday, 26 February 2017 at 08:37:29 UTC, Nicholas Wilson wrote:
> This will enable writing kernels in D utilising all of D's meta programming goodness across the device divide and will allow launching those kernels with a level of ease on par with CUDA's <<<...>>> syntax.

Interesting to write kernels in D, since a limitation of CUDA is that you need to multiply the entry points to instantiate a template differently, and a limitation of OpenCL C is that you need templates and includes in the first place.

How does this work?
Does the host code need something like DerelictCL to work?
« First   ‹ Prev
1 2