This thread is partly to announce that i will be adding to LDC
the ability to generate code for GPUs through OpenCL, CUDA (and
if i have time) Metal in my fork at
https://github.com/thewilsonator/ldc and partly to request the
reservation of the relevant Version identifiers. (Do I do this by
a pull request?)
IIUC the version identifiers are based of the C #define's.
The OpenCL #define's are CL_VERSION_X_Y and __OPENCL_VERSION__ =
XY0 (e.g. 220 for 2.2)
The cuda #define's are __CUDA__ and __CUDA_ARCH__ (similar to
above but indicates the compute capability as opposed to the
version)
BUT
That is sorta equivalent to the OS identifier. the arch
identifier SPIR(V) and NVPTX and their 64bit counterparts are
more indicative and useful to me earlier on (address space
mapping and whatnot). So my question is what identifiers should i
go with?

This thread is partly to announce that i will be adding to LDC
the ability to generate code for GPUs through OpenCL, CUDA (and
if i have time) Metal in my fork at
https://github.com/thewilsonator/ldc and partly to request the
reservation of the relevant Version identifiers. (Do I do this
by a pull request?)

What is your current status?
Is that SPIR-V or SPIR? I tought that LLVM did not have a SPIR-V
backend mainlined. Or are you using a out of tree one from
Khronos?
Do you have any examples?
Cheers, Jakob.

This thread is partly to announce that i will be adding to LDC
the ability to generate code for GPUs through OpenCL, CUDA
(and if i have time) Metal in my fork at
https://github.com/thewilsonator/ldc and partly to request the
reservation of the relevant Version identifiers. (Do I do this
by a pull request?)

What is your current status?

Just starting. But I know what i need to do ( in terms of
metadata)

Is that SPIR-V or SPIR?

SPRI-V

I tought that LLVM did not have a SPIR-V backend mainlined. Or
are you using a out of tree one from Khronos?

This thread is partly to announce that i will be adding to
LDC the ability to generate code for GPUs through OpenCL,
CUDA (and if i have time) Metal in my fork at
https://github.com/thewilsonator/ldc and partly to request
the reservation of the relevant Version identifiers. (Do I do
this by a pull request?)

What is your current status?

Just starting. But I know what i need to do ( in terms of
metadata)

Ah okay.

Is that SPIR-V or SPIR?

SPRI-V

I tought that LLVM did not have a SPIR-V backend mainlined. Or
are you using a out of tree one from Khronos?

Yes

That will be annoying, the LDC that works with SPIR-V wont be
able to produce MSVC compatible exes. Lets hope they mainline it
soon.
Thanks for the reply.
Cheers, Jakob.

That will be annoying, the LDC that works with SPIR-V wont be
able to produce MSVC compatible exes. Lets hope they mainline
it soon.

One possible solution for this would be a thin driver executable
that parses just enough of the command line to detect the target
triple used, and then forwards to the correct "real" compiler
executable.
Such a separate driver could then also be used as part of the
regular distribution to improve the performance on
memory-constrained all-at-once builds, by freeing all the
frontend/LLVM memory (i.e., terminating the process) before
invoking the linker, which can take a substantial amount of
memory for huge binaries too.
— David

Such a separate driver could then also be used as part of the
regular distribution to improve the performance on
memory-constrained all-at-once builds, by freeing all the
frontend/LLVM memory (i.e., terminating the process) before
invoking the linker, which can take a substantial amount of
memory for huge binaries too.

(This is not likely to be worth the trouble on Windows, where –
partly depending on the user's configuration – process creation
can take ages. — David)