diff options
Diffstat (limited to 'src/com/jogamp/opencl/CLEvent.java')
-rw-r--r-- | src/com/jogamp/opencl/CLEvent.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/com/jogamp/opencl/CLEvent.java b/src/com/jogamp/opencl/CLEvent.java index 928d0d92..d1bfeffc 100644 --- a/src/com/jogamp/opencl/CLEvent.java +++ b/src/com/jogamp/opencl/CLEvent.java @@ -29,11 +29,12 @@ package com.jogamp.opencl; import com.jogamp.opencl.impl.CLTLInfoAccessor; -import com.jogamp.opencl.impl.CLEventCallback; +import com.jogamp.opencl.llb.CLEventBinding; +import com.jogamp.opencl.llb.impl.CLEventCallback; import com.jogamp.common.nio.PointerBuffer; import java.nio.Buffer; -import static com.jogamp.opencl.CL.*; +import static com.jogamp.opencl.llb.CL.*; import static com.jogamp.opencl.CLException.*; /** @@ -44,13 +45,15 @@ import static com.jogamp.opencl.CLException.*; * {@link com.jogamp.opencl.CLCommandQueue.Mode#PROFILING_MODE}. * @author Michael Bien */ -public class CLEvent extends CLObject implements CLResource { +public class CLEvent extends CLObjectResource { private final CLEventInfoAccessor eventInfo; private final CLEventProfilingInfoAccessor eventProfilingInfo; + private final CLEventBinding binding; CLEvent(CLContext context, long id) { super(context, id); + binding = context.getPlatform().getEventBinding(); this.eventInfo = new CLEventInfoAccessor(); this.eventProfilingInfo = new CLEventProfilingInfoAccessor(); } @@ -64,7 +67,7 @@ public class CLEvent extends CLObject implements CLResource { // apparently only ExecutionStatus.COMPLETE is allowed -> private private void registerCallback(final CLEventListener callback, ExecutionStatus trigger) { - cl.clSetEventCallback(ID, trigger.STATUS, new CLEventCallback() { + binding.clSetEventCallback(ID, trigger.STATUS, new CLEventCallback() { @Override public void eventStateChanged(long event, int status) { callback.eventStateChanged(CLEvent.this, status); } @@ -73,7 +76,8 @@ public class CLEvent extends CLObject implements CLResource { @Override public void release() { - int ret = cl.clReleaseEvent(ID); + super.release(); + int ret = binding.clReleaseEvent(ID); checkForError(ret, "can not release event"); } @@ -144,7 +148,7 @@ public class CLEvent extends CLObject implements CLResource { @Override protected int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) { - return cl.clGetEventInfo(ID, name, valueSize, value, valueSizeRet); + return binding.clGetEventInfo(ID, name, valueSize, value, valueSizeRet); } } @@ -153,7 +157,7 @@ public class CLEvent extends CLObject implements CLResource { @Override protected int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) { - return cl.clGetEventProfilingInfo(ID, name, valueSize, value, valueSizeRet); + return binding.clGetEventProfilingInfo(ID, name, valueSize, value, valueSizeRet); } } |