summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/JOCLJNILibLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/jogamp/opencl/JOCLJNILibLoader.java')
-rw-r--r--src/com/jogamp/opencl/JOCLJNILibLoader.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/JOCLJNILibLoader.java b/src/com/jogamp/opencl/JOCLJNILibLoader.java
new file mode 100644
index 00000000..c8a05210
--- /dev/null
+++ b/src/com/jogamp/opencl/JOCLJNILibLoader.java
@@ -0,0 +1,27 @@
+package com.jogamp.opencl;
+
+import java.security.PrivilegedAction;
+import com.jogamp.common.jvm.JNILibLoaderBase;
+import com.jogamp.common.os.NativeLibrary;
+
+import static java.security.AccessController.*;
+
+/**
+ * Responsible for JOCL lib loading.
+ * @author Michael Bien
+ */
+class JOCLJNILibLoader extends JNILibLoaderBase {
+
+ /**
+ * Loads the native binding and returns the OpenCL library for dynamic linking.
+ */
+ static NativeLibrary loadJOCL() {
+
+ return doPrivileged(new PrivilegedAction<NativeLibrary>() {
+ public NativeLibrary run() {
+ loadLibrary("jocl", null, true);
+ return NativeLibrary.open("OpenCL", JOCLJNILibLoader.class.getClassLoader());
+ }
+ });
+ }
+}