On Friday, 8 December 2017 at 03:41:05 UTC, Walter Bright wrote:
bar.d: module bar; string generateString(T)() { return T.stringof ~ " foo;"; } enum s = generateString!int(); a.d: @compute(CompileFor.deviceOnly) module a; int baz() { import bar; bar.s; return foo; }
That requires that I know what instantiations I will have a head of time or I have to maintain a "header file" of named instantiations. Both of which I consider subpar solutions. Also while it may not bloat the GPU binary it will still bloat the host binary.