From d78faf0ef678cc87f5220d2cb8eccbe173449541 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 22 Feb 2010 23:38:56 +0100 Subject: introduced CLObject as common superclass for all OpenCL objects. --- src/com/mbien/opencl/CLDevice.java | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/com/mbien/opencl/CLDevice.java') diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java index 941b8560..3c1c4e25 100644 --- a/src/com/mbien/opencl/CLDevice.java +++ b/src/com/mbien/opencl/CLDevice.java @@ -22,29 +22,19 @@ import static com.mbien.opencl.CL.*; * @see CLContext#getMaxFlopsDevice(com.mbien.opencl.CLDevice.Type) * @author Michael Bien */ -public final class CLDevice { +public final class CLDevice extends CLObject { - private final CL cl; - private CLContext context; private Set extensions; private final CLDeviceInfoAccessor deviceInfo; - /** - * OpenCL device id for this device. - */ - public final long ID; - CLDevice(CL cl, long id) { - this.cl = cl; - this.ID = id; + super(cl, id); this.deviceInfo = new CLDeviceInfoAccessor(); } CLDevice(CLContext context, long id) { - this.context = context; - this.cl = context.cl; - this.ID = id; + super(context, id); this.deviceInfo = new CLDeviceInfoAccessor(); } @@ -71,10 +61,6 @@ public final class CLDevice { throw new IllegalStateException("this device is not associated with a context"); return context.createCommandQueue(this, properties); } - - public CLContext getContext() { - return context; - } /*keep this package private*/ void setContext(CLContext context) { -- cgit v1.2.3