Package foundry.veil.api.opencl
Class VeilOpenCL
java.lang.Object
foundry.veil.api.opencl.VeilOpenCL
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource
Veil implementation of OpenCL.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordInformation about a device on an OpenCL platform.static final recordInformation about a platform that can run OpenCL. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckCLError(int errcode) Checks if the specified error code was notCL10.CL_SUCCESSstatic voidcheckCLError(IntBuffer errcode) IntBuffer implementation ofcheckCLError(int)voidfree()static VeilOpenCLget()static intgetDeviceInfoInt(long device, int param) Retrieves the specified integer parameter from the specified device.static longgetDeviceInfoLong(long device, int param) Retrieves the specified long parameter from the specified device.static StringgetDeviceInfoString(long device, int param) Retrieves the specified string parameter from the specified device.@Nullable CLEnvironment@Nullable CLEnvironmentgetEnvironment(CLEnvironmentOptions options) Retrieves an environment that follows the specified requirements.@Nullable CLEnvironmentgetEnvironment(VeilOpenCL.DeviceInfo deviceInfo) Retrieves the environment for the specified device.static StringgetPlatformInfoString(long platform, int param) Retrieves the specified string parameter from the specified platform.static StringgetProgramBuildInfo(long program, long device, int param) Retrieves the specified program build info string from the specified program and device.static voidtryFree()Attempts to release all OpenCL resources without initializing OpenCL.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lwjgl.system.NativeResource
close
-
Field Details
-
LOGGER
public static final org.slf4j.Logger LOGGER
-
-
Method Details
-
getEnvironment
- Returns:
- The default OpenCL environment or
nullif no device was found
-
getEnvironment
Retrieves an environment that follows the specified requirements.- Parameters:
options- The requirements for the requested environment- Returns:
- The environment for a device with those properties or
nullif no device was found
-
getEnvironment
Retrieves the environment for the specified device.- Parameters:
deviceInfo- The device to retrieve the environment for- Returns:
- The environment for that device or
nullif no device was found ornullif no device was found
-
getPlatforms
- Returns:
- All platforms OpenCL can be run on
-
getPriorityDevices
- Returns:
- All devices for all platforms sorted by compute priority
-
free
@Internal public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-
tryFree
@Internal public static void tryFree()Attempts to release all OpenCL resources without initializing OpenCL. -
get
- Returns:
- The static Veil OpenCL implementation
-
checkCLError
IntBuffer implementation ofcheckCLError(int)- Throws:
CLException
-
checkCLError
Checks if the specified error code was notCL10.CL_SUCCESS- Parameters:
errcode- The error code to validate- Throws:
CLException- If the error code was not success
-
getProgramBuildInfo
Retrieves the specified program build info string from the specified program and device.- Parameters:
program- The program to get the build info fordevice- The device the program was built onparam- The parameter to get- Returns:
- The program build info string
- Throws:
CLException- If any error occurred while trying to get the string
-
getPlatformInfoString
Retrieves the specified string parameter from the specified platform.- Parameters:
platform- The platform to get the string fromparam- The parameter to get- Returns:
- The platform info string
- Throws:
CLException- If any error occurred while trying to get the string
-
getDeviceInfoString
Retrieves the specified string parameter from the specified device.- Parameters:
device- The device to get the string fromparam- The parameter to get- Returns:
- The device info string
- Throws:
CLException- If any error occurred while trying to get the string
-
getDeviceInfoInt
Retrieves the specified integer parameter from the specified device.- Parameters:
device- The device to get the int fromparam- The parameter to get- Returns:
- The device info int
- Throws:
CLException- If any error occurred while trying to get the int
-
getDeviceInfoLong
Retrieves the specified long parameter from the specified device.- Parameters:
device- The device to get the long fromparam- The parameter to get- Returns:
- The device info long
- Throws:
CLException- If any error occurred while trying to get the long
-