diff options
author | Sven Gothel <[email protected]> | 2011-06-28 14:13:22 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-06-28 14:13:22 +0200 |
commit | da0378be055d5c304b0a0b5e1b5f3ca66122ebf8 (patch) | |
tree | 26ca2e70da90e0c43c30a51d8d0cbe6c9ca2809f /src/com/jogamp/opencl/CLDevice.java | |
parent | 368f062ec9d6bbb89129739adb59cf042dd0bf78 (diff) | |
parent | 08a479b22d4ba9da9ee79fc938ac4de7fb83dc5a (diff) |
Fix last merge of mbien/master
Diffstat (limited to 'src/com/jogamp/opencl/CLDevice.java')
-rw-r--r-- | src/com/jogamp/opencl/CLDevice.java | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/src/com/jogamp/opencl/CLDevice.java b/src/com/jogamp/opencl/CLDevice.java index 95f9d1a6..07f7c5f2 100644 --- a/src/com/jogamp/opencl/CLDevice.java +++ b/src/com/jogamp/opencl/CLDevice.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 - 2010 JogAmp Community. All rights reserved. + * Copyright (c) 2009 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: @@ -29,8 +29,7 @@ package com.jogamp.opencl; import com.jogamp.opencl.util.CLUtil; -import com.jogamp.common.nio.PointerBuffer; -import java.nio.Buffer; +import com.jogamp.opencl.spi.CLInfoAccessor; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.Collections; @@ -51,23 +50,23 @@ import static com.jogamp.opencl.CL.*; * @see CLContext#getMaxFlopsDevice(com.jogamp.opencl.CLDevice.Type) * @author Michael Bien */ -public final class CLDevice extends CLObject { +public class CLDevice extends CLObject { private Set<String> extensions; - private final CLDeviceInfoAccessor deviceInfo; + private final CLInfoAccessor deviceInfo; private final CLPlatform platform; - CLDevice(CL cl, CLPlatform platform, long id) { + protected CLDevice(CL cl, CLPlatform platform, long id) { super(cl, id); this.platform = platform; - this.deviceInfo = new CLDeviceInfoAccessor(cl, id); + this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(cl, id); } - CLDevice(CLContext context, long id) { + protected CLDevice(CLContext context, long id) { super(context, id); this.platform = context.getPlatform(); - this.deviceInfo = new CLDeviceInfoAccessor(context.getCL(), id); + this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(cl, id); } public CLCommandQueue createCommandQueue() { @@ -691,21 +690,8 @@ public final class CLDevice extends CLObject { return CLUtil.obtainDeviceProperties(this); } - private final static class CLDeviceInfoAccessor extends CLInfoAccessor { - - private final CL cl; - private final long ID; - - private CLDeviceInfoAccessor(CL cl, long id) { - this.cl = cl; - this.ID = id; - } - - @Override - protected int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) { - return cl.clGetDeviceInfo(ID, name, valueSize, value, valueSizeRet); - } - + public final CLInfoAccessor getCLAccessor() { + return deviceInfo; } @Override |