1 module dcompute.driver.util; 2 3 import std.traits; 4 import std.meta; 5 import ldc.dcompute : Pointer; 6 import dcompute.driver.ocl.buffer : Buffer; 7 template HostArgsOf(F) 8 { 9 import std.traits; 10 // TODO substitute Pointer!(n,T) with Buffer!T, Image etc. 11 template toBuffer(T) 12 { 13 static if(is(T : Pointer!(n,U), uint n,U)) 14 alias toBuffer = Buffer!U; 15 else 16 alias toBuffer = T; 17 } 18 alias HostArgsOf = staticMap!(toBuffer,Parameters!F); 19 }