From c720767642618cfb4f3739dc6962cde0465e25c5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 3 Sep 2014 03:16:10 +0200 Subject: Bug 978: Promote CLAbstractImpl.isAvailable() to CLPlatform, public API. isAvailable() simply shall return true if JOCL/OpenCL libs could be loaded. - Promote CLAbstractImpl.isAvailable() to CLPlatform, public API. - CLAbstractImpl.isAvailable() simply shall return true if JOCL/OpenCL libs could be loaded. --- test/com/jogamp/opencl/gl/CLGLTest.java | 3 --- test/com/jogamp/opencl/test/util/MiscUtils.java | 8 ++++++-- test/com/jogamp/opencl/test/util/UITestCase.java | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'test/com') diff --git a/test/com/jogamp/opencl/gl/CLGLTest.java b/test/com/jogamp/opencl/gl/CLGLTest.java index 62e2b2bb..c7905352 100644 --- a/test/com/jogamp/opencl/gl/CLGLTest.java +++ b/test/com/jogamp/opencl/gl/CLGLTest.java @@ -234,10 +234,7 @@ public class CLGLTest extends UITestCase { @Test(timeout=15000) public void textureSharing() { - out.println(" - - - glcl; textureSharing - - - "); - if(MiscUtils.isOpenCLUnavailable()) - return; initGL(); makeGLCurrent(); diff --git a/test/com/jogamp/opencl/test/util/MiscUtils.java b/test/com/jogamp/opencl/test/util/MiscUtils.java index 85798a06..9cd625b8 100644 --- a/test/com/jogamp/opencl/test/util/MiscUtils.java +++ b/test/com/jogamp/opencl/test/util/MiscUtils.java @@ -93,8 +93,12 @@ public class MiscUtils { * @return true if OpenCL is not available for this operating system, CPU architecture, et cetera. * This is meant to be a check that there can't possibly be a driver installed because * nobody makes one, not just a check that we didn't see one. + *

+ * To check whether an OpenCL implementation/library has actually been loaded, + * use {@link CLAbstractImpl#isAvailable()}. + *

*/ - public static final boolean isOpenCLUnavailable() { - return !CLAbstractImpl.isAvailable() && knownOSWithoutCLImpl.contains(Platform.getOSType()); + public static final boolean isKnownOSWithoutCLImpl() { + return knownOSWithoutCLImpl.contains(Platform.getOSType()); } } diff --git a/test/com/jogamp/opencl/test/util/UITestCase.java b/test/com/jogamp/opencl/test/util/UITestCase.java index b27f2061..c3c59f3b 100644 --- a/test/com/jogamp/opencl/test/util/UITestCase.java +++ b/test/com/jogamp/opencl/test/util/UITestCase.java @@ -36,6 +36,7 @@ import java.util.List; import com.jogamp.common.os.Platform; import com.jogamp.common.util.locks.SingletonInstance; +import com.jogamp.opencl.CLPlatform; import org.junit.Assume; import org.junit.Before; @@ -126,7 +127,7 @@ public abstract class UITestCase { @Before public void setUp() { System.err.print("++++ UITestCase.setUp: "+getFullTestName(" - ")); - final boolean isOpenCLUnavailable = MiscUtils.isOpenCLUnavailable(); + final boolean isOpenCLUnavailable = !CLPlatform.isAvailable(); final boolean abortTest = isOpenCLUnavailable || !testSupported; if( abortTest ) { if( isOpenCLUnavailable ) { -- cgit v1.2.3