void requireMinVersionValue(String feature, double minValue, double deprecationValue) { double value = getVersionValue(); if (value < minValue) { throw new CLVersionException(feature + " requires OpenCL version " + minValue + " (detected version is " + value + ")"); } else if (!Double.isNaN(deprecationValue) && featuresCheckedForVersion.add(feature)) { Level level = null; if (value < deprecationValue && JavaCL.verbose) level = Level.INFO; else if (value >= deprecationValue) level = Level.WARNING; if (level != null && shouldLog(level)) log(level, feature + " is deprecated from OpenCL version " + deprecationValue + " (detected version is " + value + ")"); } }
void requireMinVersionValue(String feature, double minValue, double deprecationValue) { double value = getVersionValue(); if (value < minValue) { throw new CLVersionException(feature + " requires OpenCL version " + minValue + " (detected version is " + value + ")"); } else if (!Double.isNaN(deprecationValue) && featuresCheckedForVersion.add(feature)) { Level level = null; if (value < deprecationValue && JavaCL.verbose) level = Level.INFO; else if (value >= deprecationValue) level = Level.WARNING; if (level != null && shouldLog(level)) log(level, feature + " is deprecated from OpenCL version " + deprecationValue + " (detected version is " + value + ")"); } }
/** * Allows the implementation to release the resources allocated by the OpenCL compiler for this platform. */ public void unloadPlatformCompiler() { if (getVersionValue() < 1.2) { requireMinVersionValue("clUnloadCompiler", 1.1, 1.2); error(CL.clUnloadCompiler()); } else { requireMinVersionValue("clUnloadPlatformCompiler", 1.2); error(CL.clUnloadPlatformCompiler(getEntity())); } }
/** * Allows the implementation to release the resources allocated by the OpenCL compiler for this platform. */ public void unloadPlatformCompiler() { if (getVersionValue() < 1.2) { requireMinVersionValue("clUnloadCompiler", 1.1, 1.2); error(CL.clUnloadCompiler()); } else { requireMinVersionValue("clUnloadPlatformCompiler", 1.2); error(CL.clUnloadPlatformCompiler(getEntity())); } }
if (context.getPlatform().getVersionValue() >= 1.2 || eventsToWaitFor != null && eventsToWaitFor.length > 0)
if (context.getPlatform().getVersionValue() >= 1.2 || eventsToWaitFor != null && eventsToWaitFor.length > 0)
/** * Calls <a href="http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clEnqueueBarrierWithWaitList.html">clEnqueueBarrierWithWaitList</a>.<br> * Enqueue a barrier operation.<br> * The enqueueBarrier() command ensures that all queued commands in command_queue have finished execution before the next batch of commands can begin execution. <br> * enqueueBarrier() is a synchronization point. * @param eventsToWaitFor Events that need to complete before this particular command can be executed. Special value {@link CLEvent#FIRE_AND_FORGET} can be used to avoid returning a CLEvent. * @return Event object that identifies this command and can be used to query or queue a wait for the command to complete, or null if eventsToWaitFor contains {@link CLEvent#FIRE_AND_FORGET}. */ public CLEvent enqueueBarrier(CLEvent... eventsToWaitFor) { if (context.getPlatform().getVersionValue() >= 1.2 || eventsToWaitFor != null && eventsToWaitFor.length > 0) { context.getPlatform().requireMinVersionValue("clEnqueueBarrierWithWaitList", 1.2); ReusablePointers ptrs = ReusablePointers.get(); int[] eventsInCount = ptrs.int1Array; Pointer<cl_event> eventsIn = CLAbstractEntity.copyNonNullEntities(eventsToWaitFor, eventsInCount, ptrs.events_in); Pointer<cl_event> eventOut = eventsToWaitFor == null || CLEvent.containsFireAndForget(eventsToWaitFor) ? null : ptrs.event_out; error(CL.clEnqueueBarrierWithWaitList( getEntity(), eventsInCount[0], getPeer(eventsIn) , getPeer(eventOut) )); return CLEvent.createEventFromPointer(this, eventOut) ; } else { context.getPlatform().requireMinVersionValue("clEnqueueBarrier", 1.1, 1.2); error(CL.clEnqueueBarrier(getEntity())); return null; } }
/** * Calls <a href="http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clEnqueueBarrierWithWaitList.html">clEnqueueBarrierWithWaitList</a>.<br> * Enqueue a barrier operation.<br> * The enqueueBarrier() command ensures that all queued commands in command_queue have finished execution before the next batch of commands can begin execution. <br> * enqueueBarrier() is a synchronization point. * @param eventsToWaitFor Events that need to complete before this particular command can be executed. Special value {@link CLEvent#FIRE_AND_FORGET} can be used to avoid returning a CLEvent. * @return Event object that identifies this command and can be used to query or queue a wait for the command to complete, or null if eventsToWaitFor contains {@link CLEvent#FIRE_AND_FORGET}. */ public CLEvent enqueueBarrier(CLEvent... eventsToWaitFor) { if (context.getPlatform().getVersionValue() >= 1.2 || eventsToWaitFor != null && eventsToWaitFor.length > 0) { context.getPlatform().requireMinVersionValue("clEnqueueBarrierWithWaitList", 1.2); ReusablePointers ptrs = ReusablePointers.get(); int[] eventsInCount = ptrs.int1Array; Pointer<cl_event> eventsIn = CLAbstractEntity.copyNonNullEntities(eventsToWaitFor, eventsInCount, ptrs.events_in); Pointer<cl_event> eventOut = eventsToWaitFor == null || CLEvent.containsFireAndForget(eventsToWaitFor) ? null : ptrs.event_out; error(CL.clEnqueueBarrierWithWaitList( getEntity(), eventsInCount[0], getPeer(eventsIn) , getPeer(eventOut) )); return CLEvent.createEventFromPointer(this, eventOut) ; } else { context.getPlatform().requireMinVersionValue("clEnqueueBarrier", 1.1, 1.2); error(CL.clEnqueueBarrier(getEntity())); return null; } }