jcuda.driver
Class JITOptions

java.lang.Object
  extended by jcuda.driver.JITOptions

public final class JITOptions
extends java.lang.Object

Note: This class should be considered as preliminary, and might change in future releases.

A utility class to circumvent the limitations of Java in terms of interpreting memory areas as pointers or primitive values:

This class allows mapping CUjit_option identifiers to their respective values, so that the options may be passed to the JCudaDriver.cuModuleLoadDataEx(CUmodule, jcuda.Pointer, int, int[], jcuda.Pointer) method of the CUDA driver API. While the original cuModuleLoadDataEx method is also offered, the method JCudaDriver.cuModuleLoadDataJIT(CUmodule, jcuda.Pointer, JITOptions) has been added, which accepts JITOptions as one argument.


Constructor Summary
JITOptions()
           
 
Method Summary
 byte[] getBytes(int key)
          Returns the value of the given option.
 float getFloat(int key)
          Returns the value of the given option.
 int getInt(int key)
          Returns the value of the given option.
 java.lang.String getString(int key)
          Convenience method that returns the value of the given option as a string.
 void put(int key)
          Put the specified option into these options (without a value)
 void putBytes(int key, byte[] value)
          Put the given value for the specified option into these options
 void putFloat(int key, float value)
          Put the given value for the specified option into these options
 void putInt(int key, int value)
          Put the given value for the specified option into these options
 void remove(int key)
          Removes the specified option
 java.lang.String toFormattedString()
          Creates and returns a formatted (aligned, multi-line) String representation of this object
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JITOptions

public JITOptions()
Method Detail

remove

public void remove(int key)
Removes the specified option

Parameters:
key - An option identifier

put

public void put(int key)
Put the specified option into these options (without a value)

Parameters:
key - An option identifier

putInt

public void putInt(int key,
                   int value)
Put the given value for the specified option into these options

Parameters:
key - An option identifier
value - The option value

putFloat

public void putFloat(int key,
                     float value)
Put the given value for the specified option into these options

Parameters:
key - An option identifier
value - The option value

putBytes

public void putBytes(int key,
                     byte[] value)
Put the given value for the specified option into these options

Parameters:
key - An option identifier
value - The option value

getInt

public int getInt(int key)
Returns the value of the given option. Returns 0 if the specified option is unknown or not an int or unsigned int value.

Parameters:
key - An option identifier
Returns:
The option value

getFloat

public float getFloat(int key)
Returns the value of the given option. Returns 0 if the specified option is unknown or not a float value.

Parameters:
key - An option identifier
Returns:
The option value

getBytes

public byte[] getBytes(int key)
Returns the value of the given option. Returns null if the specified option is unknown or not a byte[] value.

Parameters:
key - An option identifier
Returns:
The option value

getString

public java.lang.String getString(int key)
Convenience method that returns the value of the given option as a string. The byte array for the specified option will be obtained and converted into a string. Returns null if the specified option is unknown or not a byte[] value.

Parameters:
key - An option identifier
Returns:
The option value

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A String representation of this object.

toFormattedString

public java.lang.String toFormattedString()
Creates and returns a formatted (aligned, multi-line) String representation of this object

Returns:
A formatted String representation of this object