32package com.jogamp.opencl;
34import java.util.regex.Matcher;
35import java.util.regex.Pattern;
42public class CLVersion implements Comparable<CLVersion> {
44 private final static Pattern pattern = Pattern.compile(
"OpenCL (?:C )?(\\d+)\\.(\\d+)(.*)");
74 this.fullversion = version;
75 final Matcher matcher = pattern.matcher(version);
77 major = Short.parseShort(matcher.group(1));
78 minor = Short.parseShort(matcher.group(2));
80 if(matcher.groupCount() == 4) {
91 private int compareTo(
final int otherMajor,
final int otherMinor) {
92 if(otherMajor ==
major && otherMinor ==
minor) {
94 }
else if(this.major > otherMajor || (this.major == otherMajor && this.minor > otherMinor)) {
114 return this.major ==
major && this.minor ==
minor;
167 public boolean equals(
final Object obj) {
Version of an OpenCL Implementation.
boolean isEqual(final CLVersion other)
String getSpecVersion()
Returns '"OpenCL " + major + "." + minor'.
final String implversion
The platform specific part of the version string.
static final CLVersion CL_2_1
static final CLVersion CL_1_2
static final CLVersion CL_1_1
boolean isEqual(final int major, final int minor)
static final CLVersion CL_2_0
String getFullVersion()
Returns the full, unfiltered version string.
int compareTo(final CLVersion other)
static final CLVersion CL_1_0
final short major
Mayor version number.
final String fullversion
The full version String is defined as: OpenCL[space][major_version].
CLVersion(final String version)
boolean isAtLeast(final int major, final int minor)
boolean equals(final Object obj)
Returns true if both fullversion Strings match.
final short minor
Minor version number.
boolean isAtLeast(final CLVersion other)