public void apply(CLKernel kernel, int id) { if(type.equals("int")) { kernel.setArg(id, (Integer)value); } else if(type.equals("float")) { kernel.setArg(id, (Float)value); } else if(type.equals("short")) { kernel.setArg(id, (Short)value); } else if(type.equals("long")) { kernel.setArg(id, (Long)value); } else if(type.equals("double")) { kernel.setArg(id, (Double)value); } else if(type.equals("byte")) { kernel.setArg(id, (Byte)value); } else if(type.equals("clmem")) { kernel.setArg(id, (CLMem)value); } }
public void dispose() { if(type.equals("clmen")) { CL10.clReleaseMemObject((CLMem)value); } }
public GPUProgramObject(CLMem val) { value = val; type = "clmem"; }
public void read(GPUProgramObject o, FloatBuffer writeTo, boolean blocking) { CL10.clEnqueueReadBuffer(clQueue, (CLMem)o.value, blocking ? CL10.CL_TRUE : CL10.CL_FALSE, 0, writeTo, null, null); return; }