public class NativeDepsLoader extends Object
Constructor and Description |
---|
NativeDepsLoader() |
Modifier and Type | Method and Description |
---|---|
static boolean |
libraryLoaded() |
static File |
loadNativeDep(String depName,
boolean preserveDep)
Allows other libraries to reuse the same native deps loading logic.
|
static void |
loadNativeDeps()
Load the native libraries needed for libcudf, if not loaded already.
|
static void |
loadNativeDeps(String[] loadOrder)
Allows other libraries to reuse the same native deps loading logic.
|
static void |
loadNativeDeps(String[] loadOrder,
boolean preserveDeps)
Allows other libraries to reuse the same native deps loading logic.
|
public static void loadNativeDeps()
public static void loadNativeDeps(String[] loadOrder) throws IOException
private static boolean loaded = false; static synchronized void loadNativeDeps() { if (!loaded) { try { // If you also depend on the cudf liobrary being loaded, be sure it is loaded // first ai.rapids.cudf.NativeDepsLoader.loadNativeDeps(); ai.rapids.cudf.NativeDepsLoader.loadNativeDeps(new String[]{...}); loaded = true; } catch (Throwable t) { log.error("Could not load ...", t); } } }This function should be called from the static initialization block of any class that uses JNI. For example
public class UsesJNI { static { MyNativeDepsLoader.loadNativeDeps(); } }
loadOrder
- the base name of the libraries. For example libfoo.so would be passed in as
"foo". The libraries are loaded in the order provided.IOException
- on any error trying to load the libraries.public static void loadNativeDeps(String[] loadOrder, boolean preserveDeps) throws IOException
private static boolean loaded = false; static synchronized void loadNativeDeps() { if (!loaded) { try { // If you also depend on the cudf liobrary being loaded, be sure it is loaded // first ai.rapids.cudf.NativeDepsLoader.loadNativeDeps(); ai.rapids.cudf.NativeDepsLoader.loadNativeDeps(new String[]{...}); loaded = true; } catch (Throwable t) { log.error("Could not load ...", t); } } }This function should be called from the static initialization block of any class that uses JNI. For example
public class UsesJNI { static { MyNativeDepsLoader.loadNativeDeps(); } }
loadOrder
- the base name of the libraries. For example libfoo.so would be passed in as
"foo". The libraries are loaded in the order provided.preserveDeps
- if false the dependencies will be deleted immediately after loading
rather than on exit.IOException
- on any error trying to load the libraries.public static File loadNativeDep(String depName, boolean preserveDep) throws IOException
depName
- the base name of the library. For example libfoo.so would be passed in as
"foo". The libraries are loaded in the order provided.preserveDep
- if false the dependencies will be deleted immediately after loading
rather than on exit.IOException
- on any error trying to load the libraries.public static boolean libraryLoaded()
Copyright © 2024. All rights reserved.