JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
JOCLVersion.java
Go to the documentation of this file.
1/*
2 * Copyright 2009 - 2010 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29/*
30 * Created on Monday, November 15 2010 19:44
31 */
32package com.jogamp.opencl.util;
33
34import com.jogamp.common.GlueGenVersion;
35import com.jogamp.common.os.Platform;
36import com.jogamp.common.util.JogampVersion;
37import com.jogamp.common.util.VersionUtil;
38import com.jogamp.opencl.llb.CL;
39
40import java.security.PrivilegedAction;
41import java.util.jar.Manifest;
42
43import static java.security.AccessController.*;
44import static com.jogamp.common.util.VersionUtil.*;
45
46/**
47 * Utility for querying module versions and environment properties.
48 * @author Michael Bien
49 * @deprecated Use {@link com.jogamp.opencl.JoclVersion}
50 */
51@Deprecated
52public class JOCLVersion extends JogampVersion {
53
54 private static final String PACKAGE = "com.jogamp.opencl";
55
56 private JOCLVersion(final Manifest mf) {
57 super(PACKAGE, mf);
58 }
59
60 private static JOCLVersion createInstance() {
61 return doPrivileged(new PrivilegedAction<JOCLVersion>() {
62 @Override public JOCLVersion run() {
63 Manifest manifest = VersionUtil.getManifest(CL.class.getClassLoader(), PACKAGE);
64 if(manifest == null) {
65 manifest = new Manifest();
66 }
67 return new JOCLVersion(manifest);
68 }
69 });
70 }
71
72 public static String getVersion() {
73 return createInstance().toString();
74 }
75
76 public static String getAllVersions() {
77
78 final StringBuilder sb = new StringBuilder();
79
80 try{
81 getPlatformInfo(sb);
82 sb.append(Platform.getNewline());
83 GlueGenVersion.getInstance().toString(sb);
84 sb.append(Platform.getNewline());
85 createInstance().toString(sb);
86 sb.append(Platform.getNewline());
87 }catch(final Exception e) {
88 sb.append(e.getMessage());
89 e.printStackTrace();
90 }
91
92 return sb.toString();
93 }
94
95 public static void main(final String[] args) {
96 System.out.println(JOCLVersion.getAllVersions());
97 }
98}
Utility for querying module versions and environment properties.
static void main(final String[] args)
Java bindings to OpenCL, the Open Computing Language.
Definition: CL.java:26