summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLDevice.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/jogamp/opencl/CLDevice.java')
-rw-r--r--src/com/jogamp/opencl/CLDevice.java198
1 files changed, 104 insertions, 94 deletions
diff --git a/src/com/jogamp/opencl/CLDevice.java b/src/com/jogamp/opencl/CLDevice.java
index 25fb009f..d8e90106 100644
--- a/src/com/jogamp/opencl/CLDevice.java
+++ b/src/com/jogamp/opencl/CLDevice.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -28,8 +28,6 @@
package com.jogamp.opencl;
-import com.jogamp.opencl.util.CLUtil;
-import com.jogamp.opencl.spi.CLInfoAccessor;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Collections;
@@ -40,7 +38,9 @@ import java.util.Map;
import java.util.Scanner;
import java.util.Set;
-import static com.jogamp.opencl.llb.CL.*;
+import com.jogamp.opencl.llb.CL;
+import com.jogamp.opencl.spi.CLInfoAccessor;
+import com.jogamp.opencl.util.CLUtil;
/**
* This object represents an OpenCL device.
@@ -48,7 +48,7 @@ import static com.jogamp.opencl.llb.CL.*;
* @see CLPlatform#getMaxFlopsDevice(com.jogamp.opencl.CLDevice.Type...)
* @see CLContext#getDevices()
* @see CLContext#getMaxFlopsDevice(com.jogamp.opencl.CLDevice.Type)
- * @author Michael Bien
+ * @author Michael Bien, et al.
*/
public class CLDevice extends CLObject {
@@ -108,7 +108,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NAME")
public String getName() {
- return deviceInfo.getString(CL_DEVICE_NAME);
+ return deviceInfo.getString(CL.CL_DEVICE_NAME);
}
/**
@@ -116,7 +116,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PROFILE")
public String getProfile() {
- return deviceInfo.getString(CL_DEVICE_PROFILE);
+ return deviceInfo.getString(CL.CL_DEVICE_PROFILE);
}
/**
@@ -124,7 +124,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_VENDOR")
public String getVendor() {
- return deviceInfo.getString(CL_DEVICE_VENDOR);
+ return deviceInfo.getString(CL.CL_DEVICE_VENDOR);
}
/**
@@ -132,7 +132,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_VENDOR_ID")
public long getVendorID() {
- return deviceInfo.getLong(CL_DEVICE_VENDOR_ID);
+ return deviceInfo.getLong(CL.CL_DEVICE_VENDOR_ID);
}
/**
@@ -140,7 +140,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_VERSION")
public CLVersion getVersion() {
- return new CLVersion(deviceInfo.getString(CL_DEVICE_VERSION));
+ return new CLVersion(deviceInfo.getString(CL.CL_DEVICE_VERSION));
}
/**
@@ -148,7 +148,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_OPENCL_C_VERSION")
public CLVersion getCVersion() {
- return new CLVersion(deviceInfo.getString(CL_DEVICE_OPENCL_C_VERSION));
+ return new CLVersion(deviceInfo.getString(CL.CL_DEVICE_OPENCL_C_VERSION));
}
/**
@@ -156,7 +156,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DRIVER_VERSION")
public String getDriverVersion() {
- return deviceInfo.getString(CL_DRIVER_VERSION);
+ return deviceInfo.getString(CL.CL_DRIVER_VERSION);
}
/**
@@ -164,7 +164,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_TYPE")
public Type getType() {
- return Type.valueOf((int)deviceInfo.getLong(CL_DEVICE_TYPE));
+ return Type.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_TYPE));
}
/**
@@ -173,7 +173,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_ADDRESS_BITS")
public int getAddressBits() {
- return (int)deviceInfo.getLong(CL_DEVICE_ADDRESS_BITS);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_ADDRESS_BITS);
}
/**
@@ -182,7 +182,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT")
public int getPreferredShortVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT);
}
/**
@@ -191,7 +191,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR")
public int getPreferredCharVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR);
}
/**
@@ -200,7 +200,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT")
public int getPreferredIntVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT);
}
/**
@@ -209,7 +209,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG")
public int getPreferredLongVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG);
}
/**
@@ -218,7 +218,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT")
public int getPreferredFloatVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT);
}
/**
@@ -227,7 +227,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE")
public int getPreferredDoubleVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE);
}
/**
@@ -236,7 +236,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR")
public int getNativeCharVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR);
}
/**
@@ -245,7 +245,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT")
public int getNativeShortVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT);
}
/**
@@ -254,7 +254,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_INT")
public int getNativeIntVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_INT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_INT);
}
/**
@@ -263,7 +263,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG")
public int getNativeLongVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG);
}
/**
@@ -272,7 +272,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF")
public int getNativeHalfVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF);
}
/**
@@ -281,7 +281,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT")
public int getNativeFloatVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT);
}
/**
@@ -290,7 +290,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE")
public int getNativeDoubleVectorWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE);
}
/**
@@ -299,7 +299,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_COMPUTE_UNITS")
public int getMaxComputeUnits() {
- return (int) deviceInfo.getLong(CL_DEVICE_MAX_COMPUTE_UNITS);
+ return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_COMPUTE_UNITS);
}
/**
@@ -309,7 +309,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_WORK_GROUP_SIZE")
public int getMaxWorkGroupSize() {
- return (int) deviceInfo.getLong(CL_DEVICE_MAX_WORK_GROUP_SIZE);
+ return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_WORK_GROUP_SIZE);
}
/**
@@ -317,7 +317,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_CLOCK_FREQUENCY")
public int getMaxClockFrequency() {
- return (int) (deviceInfo.getLong(CL_DEVICE_MAX_CLOCK_FREQUENCY));
+ return (int) (deviceInfo.getLong(CL.CL_DEVICE_MAX_CLOCK_FREQUENCY));
}
/**
@@ -327,7 +327,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS")
public int getMaxWorkItemDimensions() {
- return (int) deviceInfo.getLong(CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS);
+ return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS);
}
/**
@@ -338,7 +338,7 @@ public class CLDevice extends CLObject {
@CLProperty("CL_DEVICE_MAX_WORK_ITEM_SIZES")
public int[] getMaxWorkItemSizes() {
int n = getMaxWorkItemDimensions();
- return deviceInfo.getInts(CL_DEVICE_MAX_WORK_ITEM_SIZES, n);
+ return deviceInfo.getInts(CL.CL_DEVICE_MAX_WORK_ITEM_SIZES, n);
}
/**
@@ -348,7 +348,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_PARAMETER_SIZE")
public long getMaxParameterSize() {
- return deviceInfo.getLong(CL_DEVICE_MAX_PARAMETER_SIZE);
+ return deviceInfo.getLong(CL.CL_DEVICE_MAX_PARAMETER_SIZE);
}
/**
@@ -356,7 +356,16 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_MEM_ALLOC_SIZE")
public long getMaxMemAllocSize() {
- return deviceInfo.getLong(CL_DEVICE_MAX_MEM_ALLOC_SIZE);
+ return deviceInfo.getLong(CL.CL_DEVICE_MAX_MEM_ALLOC_SIZE);
+ }
+
+ /**
+ * Returns the <code>uint32_t</code> memory base address alignment
+ * value reinterpreted as a <code>long</code> value.
+ */
+ @CLProperty("CL_DEVICE_MEM_BASE_ADDR_ALIGN")
+ public long getMemBaseAddrAlign() {
+ return deviceInfo.getUInt32Long(CL.CL_DEVICE_MEM_BASE_ADDR_ALIGN);
}
/**
@@ -364,7 +373,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_GLOBAL_MEM_SIZE")
public long getGlobalMemSize() {
- return deviceInfo.getLong(CL_DEVICE_GLOBAL_MEM_SIZE);
+ return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_SIZE);
}
/**
@@ -374,7 +383,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_LOCAL_MEM_SIZE")
public long getLocalMemSize() {
- return deviceInfo.getLong(CL_DEVICE_LOCAL_MEM_SIZE);
+ return deviceInfo.getLong(CL.CL_DEVICE_LOCAL_MEM_SIZE);
}
/**
@@ -382,7 +391,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_HOST_UNIFIED_MEMORY")
public boolean isMemoryUnified() {
- return deviceInfo.getLong(CL_DEVICE_HOST_UNIFIED_MEMORY) == CL_TRUE;
+ return deviceInfo.getLong(CL.CL_DEVICE_HOST_UNIFIED_MEMORY) == CL.CL_TRUE;
}
/**
@@ -391,7 +400,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE")
public long getMaxConstantBufferSize() {
- return deviceInfo.getLong(CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE);
+ return deviceInfo.getLong(CL.CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE);
}
/**
@@ -399,7 +408,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE")
public long getGlobalMemCachelineSize() {
- return deviceInfo.getLong(CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE);
+ return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE);
}
/**
@@ -407,7 +416,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_GLOBAL_MEM_CACHE_SIZE")
public long getGlobalMemCacheSize() {
- return deviceInfo.getLong(CL_DEVICE_GLOBAL_MEM_CACHE_SIZE);
+ return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_CACHE_SIZE);
}
/**
@@ -416,7 +425,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_CONSTANT_ARGS")
public long getMaxConstantArgs() {
- return deviceInfo.getLong(CL_DEVICE_MAX_CONSTANT_ARGS);
+ return deviceInfo.getLong(CL.CL_DEVICE_MAX_CONSTANT_ARGS);
}
/**
@@ -424,7 +433,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_IMAGE_SUPPORT")
public boolean isImageSupportAvailable() {
- return deviceInfo.getLong(CL_DEVICE_IMAGE_SUPPORT) == CL_TRUE;
+ return deviceInfo.getLong(CL.CL_DEVICE_IMAGE_SUPPORT) == CL.CL_TRUE;
}
/**
@@ -433,7 +442,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_READ_IMAGE_ARGS")
public int getMaxReadImageArgs() {
- return (int)deviceInfo.getLong(CL_DEVICE_MAX_READ_IMAGE_ARGS);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_READ_IMAGE_ARGS);
}
/**
@@ -442,7 +451,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_WRITE_IMAGE_ARGS")
public int getMaxWriteImageArgs() {
- return (int)deviceInfo.getLong(CL_DEVICE_MAX_WRITE_IMAGE_ARGS);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_WRITE_IMAGE_ARGS);
}
/**
@@ -451,7 +460,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_IMAGE2D_MAX_WIDTH")
public int getMaxImage2dWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_IMAGE2D_MAX_WIDTH);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE2D_MAX_WIDTH);
}
/**
@@ -460,7 +469,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_IMAGE2D_MAX_HEIGHT")
public int getMaxImage2dHeight() {
- return (int)deviceInfo.getLong(CL_DEVICE_IMAGE2D_MAX_HEIGHT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE2D_MAX_HEIGHT);
}
/**
@@ -469,7 +478,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_IMAGE3D_MAX_WIDTH")
public int getMaxImage3dWidth() {
- return (int)deviceInfo.getLong(CL_DEVICE_IMAGE3D_MAX_WIDTH);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_WIDTH);
}
/**
@@ -478,7 +487,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_IMAGE3D_MAX_HEIGHT")
public int getMaxImage3dHeight() {
- return (int)deviceInfo.getLong(CL_DEVICE_IMAGE3D_MAX_HEIGHT);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_HEIGHT);
}
/**
@@ -487,7 +496,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_IMAGE3D_MAX_DEPTH")
public int getMaxImage3dDepth() {
- return (int)deviceInfo.getLong(CL_DEVICE_IMAGE3D_MAX_DEPTH);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_DEPTH);
}
/**
@@ -496,7 +505,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_MAX_SAMPLERS")
public int getMaxSamplers() {
- return (int)deviceInfo.getLong(CL_DEVICE_MAX_SAMPLERS);
+ return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_SAMPLERS);
}
/**
@@ -504,7 +513,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_PROFILING_TIMER_RESOLUTION")
public long getProfilingTimerResolution() {
- return deviceInfo.getLong(CL_DEVICE_PROFILING_TIMER_RESOLUTION);
+ return deviceInfo.getLong(CL.CL_DEVICE_PROFILING_TIMER_RESOLUTION);
}
/**
@@ -512,7 +521,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_EXECUTION_CAPABILITIES")
public EnumSet<Capabilities> getExecutionCapabilities() {
- return Capabilities.valuesOf((int)deviceInfo.getLong(CL_DEVICE_EXECUTION_CAPABILITIES));
+ return Capabilities.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_EXECUTION_CAPABILITIES));
}
/**
@@ -525,7 +534,7 @@ public class CLDevice extends CLObject {
@CLProperty("CL_DEVICE_HALF_FP_CONFIG")
public EnumSet<FPConfig> getHalfFPConfig() {
if(isHalfFPAvailable())
- return FPConfig.valuesOf((int)deviceInfo.getLong(CL_DEVICE_HALF_FP_CONFIG));
+ return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_HALF_FP_CONFIG));
else
return EnumSet.noneOf(FPConfig.class);
}
@@ -538,7 +547,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_SINGLE_FP_CONFIG")
public EnumSet<FPConfig> getSingleFPConfig() {
- return FPConfig.valuesOf((int)deviceInfo.getLong(CL_DEVICE_SINGLE_FP_CONFIG));
+ return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_SINGLE_FP_CONFIG));
}
/**
@@ -551,7 +560,7 @@ public class CLDevice extends CLObject {
@CLProperty("CL_DEVICE_DOUBLE_FP_CONFIG")
public EnumSet<FPConfig> getDoubleFPConfig() {
if(isDoubleFPAvailable())
- return FPConfig.valuesOf((int)deviceInfo.getLong(CL_DEVICE_DOUBLE_FP_CONFIG));
+ return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_DOUBLE_FP_CONFIG));
else
return EnumSet.noneOf(FPConfig.class);
}
@@ -561,7 +570,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_LOCAL_MEM_TYPE")
public LocalMemType getLocalMemType() {
- return LocalMemType.valueOf((int)deviceInfo.getLong(CL_DEVICE_LOCAL_MEM_TYPE));
+ return LocalMemType.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_LOCAL_MEM_TYPE));
}
/**
@@ -569,15 +578,16 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_GLOBAL_MEM_CACHE_TYPE")
public GlobalMemCacheType getGlobalMemCacheType() {
- return GlobalMemCacheType.valueOf((int)deviceInfo.getLong(CL_DEVICE_GLOBAL_MEM_CACHE_TYPE));
+ return GlobalMemCacheType.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_CACHE_TYPE));
}
+
/**
* Returns the command-queue properties supported by the device.
*/
@CLProperty("CL_DEVICE_QUEUE_PROPERTIES")
public EnumSet<CLCommandQueue.Mode> getQueueProperties() {
- return CLCommandQueue.Mode.valuesOf((int)deviceInfo.getLong(CL_DEVICE_QUEUE_PROPERTIES));
+ return CLCommandQueue.Mode.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_QUEUE_PROPERTIES));
}
/**
@@ -585,7 +595,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_AVAILABLE")
public boolean isAvailable() {
- return deviceInfo.getLong(CL_DEVICE_AVAILABLE) == CL_TRUE;
+ return deviceInfo.getLong(CL.CL_DEVICE_AVAILABLE) == CL.CL_TRUE;
}
/**
@@ -595,7 +605,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_COMPILER_AVAILABLE")
public boolean isCompilerAvailable() {
- return deviceInfo.getLong(CL_DEVICE_COMPILER_AVAILABLE) == CL_TRUE;
+ return deviceInfo.getLong(CL.CL_DEVICE_COMPILER_AVAILABLE) == CL.CL_TRUE;
}
/**
@@ -603,7 +613,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_ENDIAN_LITTLE")
public boolean isLittleEndian() {
- return deviceInfo.getLong(CL_DEVICE_ENDIAN_LITTLE) == CL_TRUE;
+ return deviceInfo.getLong(CL.CL_DEVICE_ENDIAN_LITTLE) == CL.CL_TRUE;
}
/**
@@ -613,7 +623,7 @@ public class CLDevice extends CLObject {
*/
@CLProperty("CL_DEVICE_ERROR_CORRECTION_SUPPORT")
public boolean isErrorCorrectionSupported() {
- return deviceInfo.getLong(CL_DEVICE_ERROR_CORRECTION_SUPPORT) == CL_TRUE;
+ return deviceInfo.getLong(CL.CL_DEVICE_ERROR_CORRECTION_SUPPORT) == CL.CL_TRUE;
}
/**
@@ -659,7 +669,7 @@ public class CLDevice extends CLObject {
public boolean isExtensionAvailable(String extension) {
return getExtensions().contains(extension);
}
-
+
/**
* Returns {@link ByteOrder#LITTLE_ENDIAN} or {@link ByteOrder#BIG_ENDIAN}.
*/
@@ -679,7 +689,7 @@ public class CLDevice extends CLObject {
if(extensions == null) {
extensions = new HashSet<String>();
- String ext = deviceInfo.getString(CL_DEVICE_EXTENSIONS);
+ String ext = deviceInfo.getString(CL.CL_DEVICE_EXTENSIONS);
Scanner scanner = new Scanner(ext);
while(scanner.hasNext())
@@ -741,12 +751,12 @@ public class CLDevice extends CLObject {
/**
* The OpenCL device can execute OpenCL kernels.
*/
- EXEC_KERNEL(CL_EXEC_KERNEL),
+ EXEC_KERNEL(CL.CL_EXEC_KERNEL),
/**
* The OpenCL device can execute native kernels.
*/
- EXEC_NATIVE_KERNEL(CL_EXEC_NATIVE_KERNEL);
+ EXEC_NATIVE_KERNEL(CL.CL_EXEC_NATIVE_KERNEL);
/**
* Value of wrapped OpenCL device type.
@@ -759,9 +769,9 @@ public class CLDevice extends CLObject {
public static Capabilities valueOf(int caps) {
switch(caps) {
- case(CL_EXEC_KERNEL):
+ case(CL.CL_EXEC_KERNEL):
return EXEC_KERNEL;
- case(CL_EXEC_NATIVE_KERNEL):
+ case(CL.CL_EXEC_NATIVE_KERNEL):
return EXEC_NATIVE_KERNEL;
}
return null;
@@ -789,25 +799,25 @@ public class CLDevice extends CLObject {
/**
* CL_DEVICE_TYPE_CPU
*/
- CPU(CL_DEVICE_TYPE_CPU),
+ CPU(CL.CL_DEVICE_TYPE_CPU),
/**
* CL_DEVICE_TYPE_GPU
*/
- GPU(CL_DEVICE_TYPE_GPU),
+ GPU(CL.CL_DEVICE_TYPE_GPU),
/**
* CL_DEVICE_TYPE_ACCELERATOR
*/
- ACCELERATOR(CL_DEVICE_TYPE_ACCELERATOR),
+ ACCELERATOR(CL.CL_DEVICE_TYPE_ACCELERATOR),
/**
* CL_DEVICE_TYPE_DEFAULT. This type can be used for creating a context on
* the default device, a single device can never have this type.
*/
- DEFAULT(CL_DEVICE_TYPE_DEFAULT),
+ DEFAULT(CL.CL_DEVICE_TYPE_DEFAULT),
/**
* CL_DEVICE_TYPE_ALL. This type can be used for creating a context on
* all devices, a single device can never have this type.
*/
- ALL(CL_DEVICE_TYPE_ALL);
+ ALL(CL.CL_DEVICE_TYPE_ALL);
/**
* Value of wrapped OpenCL device type.
@@ -820,17 +830,17 @@ public class CLDevice extends CLObject {
public static Type valueOf(long clDeviceType) {
- if(clDeviceType == CL_DEVICE_TYPE_ALL)
+ if(clDeviceType == CL.CL_DEVICE_TYPE_ALL)
return ALL;
switch((int)clDeviceType) {
- case(CL_DEVICE_TYPE_DEFAULT):
+ case(CL.CL_DEVICE_TYPE_DEFAULT):
return DEFAULT;
- case(CL_DEVICE_TYPE_CPU):
+ case(CL.CL_DEVICE_TYPE_CPU):
return CPU;
- case(CL_DEVICE_TYPE_GPU):
+ case(CL.CL_DEVICE_TYPE_GPU):
return GPU;
- case(CL_DEVICE_TYPE_ACCELERATOR):
+ case(CL.CL_DEVICE_TYPE_ACCELERATOR):
return ACCELERATOR;
}
return null;
@@ -846,32 +856,32 @@ public class CLDevice extends CLObject {
/**
* denorms are supported.
*/
- DENORM(CL_FP_DENORM),
+ DENORM(CL.CL_FP_DENORM),
/**
* INF and quiet NaNs are supported.
*/
- INF_NAN(CL_FP_INF_NAN),
+ INF_NAN(CL.CL_FP_INF_NAN),
/**
* round to nearest rounding mode supported.
*/
- ROUND_TO_NEAREST(CL_FP_ROUND_TO_NEAREST),
+ ROUND_TO_NEAREST(CL.CL_FP_ROUND_TO_NEAREST),
/**
* round to positive and negative infinity rounding modes supported.
*/
- ROUND_TO_INF(CL_FP_ROUND_TO_INF),
+ ROUND_TO_INF(CL.CL_FP_ROUND_TO_INF),
/**
* round to zero rounding mode supported.
*/
- ROUND_TO_ZERO(CL_FP_ROUND_TO_ZERO),
+ ROUND_TO_ZERO(CL.CL_FP_ROUND_TO_ZERO),
/**
* IEEE754-2008 fused multiply-add is supported.
*/
- FMA(CL_FP_FMA);
+ FMA(CL.CL_FP_FMA);
/**
@@ -909,17 +919,17 @@ public class CLDevice extends CLObject {
/**
* Global memory cache not supported.
*/
- NONE(CL_NONE),
+ NONE(CL.CL_NONE),
/**
* Read only cache.
*/
- READ_ONLY(CL_READ_ONLY_CACHE),
+ READ_ONLY(CL.CL_READ_ONLY_CACHE),
/**
* Read-write cache.
*/
- READ_WRITE(CL_READ_WRITE_CACHE);
+ READ_WRITE(CL.CL_READ_WRITE_CACHE);
/**
@@ -952,12 +962,12 @@ public class CLDevice extends CLObject {
/**
* GLOBAL implies that no dedicated memory storage is available (global mem is used instead).
*/
- GLOBAL(CL_GLOBAL),
+ GLOBAL(CL.CL_GLOBAL),
/**
* LOCAL implies dedicated local memory storage such as SRAM.
*/
- LOCAL(CL_LOCAL);
+ LOCAL(CL.CL_LOCAL);
/**
* Value of wrapped OpenCL value.
@@ -972,9 +982,9 @@ public class CLDevice extends CLObject {
* Returns the matching LocalMemCacheType for the given cl type.
*/
public static LocalMemType valueOf(int clLocalCacheType) {
- if(clLocalCacheType == CL_GLOBAL)
+ if(clLocalCacheType == CL.CL_GLOBAL)
return GLOBAL;
- else if(clLocalCacheType == CL_LOCAL)
+ else if(clLocalCacheType == CL.CL_LOCAL)
return LOCAL;
return null;
}