jcuda.jnpp
Class JNpp

java.lang.Object
  extended by jcuda.jnpp.JNpp

public class JNpp
extends java.lang.Object

Java bindings for NPP. Note that this class only contains common constants and the Java port of the NPP Core functions.


Nested Class Summary
static class JNpp.Core
          NPP Core - Basic functions for library management, in particular library version and device property query functions.
 
Field Summary
static short NPP_MAX_16S
          Maximum 16-bit signed integer
static short NPP_MAX_16U
          Maximum 16-bit unsigned integer
static int NPP_MAX_32S
          Maximum 32-bit signed integer
static int NPP_MAX_32U
          Maximum 32-bit unsigned integer
static byte NPP_MAX_8S
          Maximum 8-bit signed integer
static byte NPP_MAX_8U
          Maximum 8-bit unsigned integer
static short NPP_MIN_16S
          Minimum 16-bit signed integer
static short NPP_MIN_16U
          Minimum 16-bit unsigned integer
static int NPP_MIN_32S
          Minimum 32-bit signed integer
static int NPP_MIN_32U
          Minimum 32-bit unsigned integer
static byte NPP_MIN_8S
          Minimum 8-bit signed integer
static byte NPP_MIN_8U
          Minimum 8-bit unsigned integer
static int NPP_VERSION_BUILD
          Build number.
static int NPP_VERSION_MAJOR
          Major version number
static int NPP_VERSION_MINOR
          Minor version number
 
Constructor Summary
JNpp()
           
 
Method Summary
(package private) static int checkResult(int result)
          If the given result is a NppStatus that indicates an error and exceptions have been enabled, this method will throw a CudaException with an error message that corresponds to the given result code.
(package private) static
<T extends TypedPointer<?>>
T
checkResult(T result)
          If the given result is null and exceptions are enabled, then this method will throw a CudaException with an error message stating that a memory allocation failed.
static void initialize()
          Initializes the native library.
static void setExceptionsEnabled(boolean enabled)
          Enables or disables exceptions.
static void setLogLevel(jcuda.LogLevel logLevel)
          Set the specified log level for the JNpp library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NPP_VERSION_MAJOR

public static final int NPP_VERSION_MAJOR
Major version number

See Also:
Constant Field Values

NPP_VERSION_MINOR

public static final int NPP_VERSION_MINOR
Minor version number

See Also:
Constant Field Values

NPP_VERSION_BUILD

public static final int NPP_VERSION_BUILD
Build number. Reflects the number of the nightly build.

See Also:
Constant Field Values

NPP_MAX_8U

public static final byte NPP_MAX_8U
Maximum 8-bit unsigned integer

See Also:
Constant Field Values

NPP_MAX_16U

public static final short NPP_MAX_16U
Maximum 16-bit unsigned integer

See Also:
Constant Field Values

NPP_MAX_32U

public static final int NPP_MAX_32U
Maximum 32-bit unsigned integer

See Also:
Constant Field Values

NPP_MIN_8U

public static final byte NPP_MIN_8U
Minimum 8-bit unsigned integer

See Also:
Constant Field Values

NPP_MIN_16U

public static final short NPP_MIN_16U
Minimum 16-bit unsigned integer

See Also:
Constant Field Values

NPP_MIN_32U

public static final int NPP_MIN_32U
Minimum 32-bit unsigned integer

See Also:
Constant Field Values

NPP_MIN_8S

public static final byte NPP_MIN_8S
Minimum 8-bit signed integer

See Also:
Constant Field Values

NPP_MAX_8S

public static final byte NPP_MAX_8S
Maximum 8-bit signed integer

See Also:
Constant Field Values

NPP_MIN_16S

public static final short NPP_MIN_16S
Minimum 16-bit signed integer

See Also:
Constant Field Values

NPP_MAX_16S

public static final short NPP_MAX_16S
Maximum 16-bit signed integer

See Also:
Constant Field Values

NPP_MIN_32S

public static final int NPP_MIN_32S
Minimum 32-bit signed integer

See Also:
Constant Field Values

NPP_MAX_32S

public static final int NPP_MAX_32S
Maximum 32-bit signed integer

See Also:
Constant Field Values
Constructor Detail

JNpp

public JNpp()
Method Detail

initialize

public static void initialize()
Initializes the native library. Note that this method does not have to be called explicitly, since it will be called automatically when this class is loaded.


setExceptionsEnabled

public static void setExceptionsEnabled(boolean enabled)
Enables or disables exceptions. By default, the methods of this class only return the NppStatus from the native method. If exceptions are enabled, a CudaException with a detailed error message will be thrown if a method is about to return a result code that indicates an error

Parameters:
enabled - Whether exceptions are enabled

checkResult

static int checkResult(int result)
If the given result is a NppStatus that indicates an error and exceptions have been enabled, this method will throw a CudaException with an error message that corresponds to the given result code. Otherwise, the given result is simply returned.

Parameters:
result - The result to check
Returns:
The result that was given as the parameter
Throws:
jcuda.CudaException - If exceptions have been enabled and the given result code indicates an error

checkResult

static <T extends TypedPointer<?>> T checkResult(T result)
If the given result is null and exceptions are enabled, then this method will throw a CudaException with an error message stating that a memory allocation failed. Otherwise, the result is simply returned.

Type Parameters:
T - The type of the pointer
Parameters:
result - The result
Returns:
The result that was given as a parameter
Throws:
jcuda.CudaException - If exceptions have been enabled and the given result was null

setLogLevel

public static void setLogLevel(jcuda.LogLevel logLevel)
Set the specified log level for the JNpp library.

Currently supported log levels:
LOG_QUIET: Never print anything
LOG_ERROR: Print error messages
LOG_TRACE: Print a trace of all native function calls

Parameters:
logLevel - The log level to use.