diff options
author | Michael Bien <[email protected]> | 2010-02-13 16:20:34 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-02-13 16:20:34 +0100 |
commit | 62d9a63caad9d614a4a4ca90956b38ff623242a5 (patch) | |
tree | e90d8726cbd815bc7bfadea1c91ac4f6cb63bbd4 /test/com/mbien/opencl/HighLevelBindingTest.java | |
parent | a93e4532f9515f5b2c0d2c67a45db1236a29ab12 (diff) |
added a few tests for event profiling and enums.
fixed bug in LocalMemType and Mem enum valueOf(int foo) methods.
Diffstat (limited to 'test/com/mbien/opencl/HighLevelBindingTest.java')
-rw-r--r-- | test/com/mbien/opencl/HighLevelBindingTest.java | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java index ec3586d7..21014e8a 100644 --- a/test/com/mbien/opencl/HighLevelBindingTest.java +++ b/test/com/mbien/opencl/HighLevelBindingTest.java @@ -3,6 +3,9 @@ package com.mbien.opencl; import com.mbien.opencl.CLMemory.Mem; import com.mbien.opencl.CLCommandQueue.Mode; import com.mbien.opencl.CLDevice.FPConfig; +import com.mbien.opencl.CLDevice.GlobalMemCacheType; +import com.mbien.opencl.CLDevice.LocalMemType; +import com.mbien.opencl.CLDevice.Type; import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; @@ -31,20 +34,42 @@ public class HighLevelBindingTest { } @Test - public void contextlessTest() { - - out.println(" - - - highLevelTest; contextless - - - "); - + public void enumsTest() { + // enum tests final EnumSet<FPConfig> singleFPConfig = FPConfig.valuesOf(CL.CL_FP_DENORM | CL.CL_FP_ROUND_TO_INF); assertEquals(0, FPConfig.valuesOf(0).size()); assertTrue(singleFPConfig.contains(FPConfig.DENORM)); assertTrue(singleFPConfig.contains(FPConfig.ROUND_TO_INF)); - final EnumSet<Mode> queueMode = Mode.valuesOf(CL.CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL.CL_QUEUE_PROFILING_ENABLE); - assertEquals(0, Mode.valuesOf(0).size()); - assertTrue(queueMode.contains(Mode.OUT_OF_ORDER_EXEC_MODE)); - assertTrue(queueMode.contains(Mode.PROFILING_MODE)); + // CLDevice enums + for (FPConfig e : FPConfig.values()) { + EnumSet<FPConfig> set = FPConfig.valuesOf(e.CONFIG); + assertTrue(set.contains(e)); + } + for (GlobalMemCacheType e : GlobalMemCacheType.values()) { + assertEquals(e, GlobalMemCacheType.valueOf(e.TYPE)); + } + for (LocalMemType e : LocalMemType.values()) { + assertEquals(e, LocalMemType.valueOf(e.TYPE)); + } + for (Type e : Type.values()) { + assertEquals(e, Type.valueOf(e.TYPE)); + } + + // CLMemory enums + for (Mem e : Mem.values()) { + assertEquals(e, Mem.valueOf(e.CONFIG)); + } + + } + + + + @Test + public void contextlessTest() { + + out.println(" - - - highLevelTest; contextless - - - "); // platform/device info tests CLPlatform[] clPlatforms = CLPlatform.listCLPlatforms(); |