Java 类org.lwjgl.opencl.CLMem 实例源码

项目:jglrEngine    文件:GPUProgramObject.java   
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);
    }
}
项目:jglrEngine    文件:GPUProgramObject.java   
public void dispose()
{
    if(type.equals("clmen"))
    {
        CL10.clReleaseMemObject((CLMem)value);
    }
}
项目:jglrEngine    文件:GPUProgramObject.java   
public GPUProgramObject(CLMem val)
{
    value = val;
    type = "clmem";
}
项目:jglrEngine    文件:GPUProgramResource.java   
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;
}