@Override public void build(String args, Device... devices) throws KernelCompilationException { PointerBuffer deviceList = null; int deviceCount = 0; if (devices != null) { deviceList = PointerBuffer.allocateDirect(devices.length); for (Device d : devices) { deviceList.put(((JoclDevice) d).id); } deviceCount = devices.length; deviceList.rewind(); } int ret = cl.clBuildProgram(program, deviceCount, deviceList, args, null); if (ret != CL.CL_SUCCESS) { String log = Log(); LOG.log(Level.WARNING, "Unable to compile program:\n{0}", log); if (ret == CL.CL_BUILD_PROGRAM_FAILURE) { throw new KernelCompilationException("Failed to build program", ret, log); } else { Utils.checkError(ret, "clBuildProgram"); } } else { LOG.log(Level.INFO, "Program compiled:\n{0}", Log()); } }
@Override public void build(String args, Device... devices) throws KernelCompilationException { PointerBuffer deviceList = null; if (devices != null) { deviceList = PointerBuffer.allocateDirect(devices.length); deviceList.rewind(); for (Device d : devices) { deviceList.put(((LwjglDevice) d).getDevice()); } deviceList.flip(); } int ret = CL10.clBuildProgram(program, deviceList, args, null, 0); if (ret != CL10.CL_SUCCESS) { String log = Log(); LOG.log(Level.WARNING, "Unable to compile program:\n{0}", log); if (ret == CL10.CL_BUILD_PROGRAM_FAILURE) { throw new KernelCompilationException("Failed to build program", ret, log); } else { Utils.checkError(ret, "clBuildProgram"); } } else { LOG.log(Level.INFO, "Program compiled:\n{0}", Log()); } }
@Override public void build(String args, Device... devices) throws KernelCompilationException { PointerBuffer deviceList = null; if (devices != null) { deviceList = PointerBuffer.allocateDirect(devices.length); deviceList.rewind(); for (Device d : devices) { deviceList.put(((LwjglDevice) d).device.getPointer()); } deviceList.flip(); } int ret = CL10.clBuildProgram(program, deviceList, args, null); if (ret != CL10.CL_SUCCESS) { String log = Log(); LOG.log(Level.WARNING, "Unable to compile program:\n{0}", log); if (ret == CL10.CL_BUILD_PROGRAM_FAILURE) { throw new KernelCompilationException("Failed to build program", ret, log); } else { Utils.checkError(ret, "clBuildProgram"); } } else { LOG.log(Level.INFO, "Program compiled:\n{0}", Log()); } }
@Override public void build(String args, Device... devices) throws KernelCompilationException { PointerBuffer deviceList = null; if (devices != null) { deviceList = PointerBuffer.allocateDirect(devices.length); deviceList.rewind(); for (Device d : devices) { deviceList.put(((LwjglDevice) d).getDevice()); } deviceList.flip(); } int ret = CL10.clBuildProgram(program, deviceList, args, null, 0); if (ret != CL10.CL_SUCCESS) { String log = Log(); LOG.log(Level.WARNING, "Unable to compile program:\n{0}", log); if (ret == CL10.CL_BUILD_PROGRAM_FAILURE) { throw new KernelCompilationException("Failed to build program", ret, log); } else { Utils.checkError(ret, "clBuildProgram"); } } else { LOG.log(Level.INFO, "Program compiled:\n{0}", Log()); } }