assertOpenCL  September 19, 2018
Static Public Member Functions | Static Package Functions | Static Package Attributes | Static Private Attributes | List of all members
Example Class Reference

Simple Java example to show how run a kernel with assert*() and PRINT*() macros and test them. More...

Static Public Member Functions

static void main (String[] args) throws Exception
 Get the optional parameter –device platform:device and run the kernel ../kernel/example.cl . More...
 

Static Package Functions

 [static initializer]
 
 [static initializer]
 
static String fileToString (final String filename) throws Exception
 Read the file and return its content to a string. If failed then throw an exception. More...
 
static cl_device_id getDeviceId (int platformI, int deviceI) throws Exception
 Return the given id device of the given platform OpenCL, or exit if doesn't exists. More...
 
static String getDeviceInfoString (cl_device_id deviceId, int paramName)
 Return a string corresponding to device info parameter. More...
 
static void runExample (int nbWorkGroup, int nbWorkItemsByWorkGroup, cl_device_id deviceId, boolean debug) throws Exception
 Run the kernel ../kernel/example.cl. More...
 
static long uint32 (int n)
 Return in a long the value of n considered as an unsigned integer on 32 bits. More...
 
static BigInteger uint64 (long n)
 Return in a BigInteger the value of n considered as an unsigned integer on 64 bits. More...
 

Static Package Attributes

static final int FLOAT_FIELD_SIZE = 4
 Number of bytes for the float type. More...
 
static final int INT_FIELD_SIZE = 4
 Number of bytes for the int type. More...
 
static final int LONG_FIELD_SIZE = 8
 Number of bytes for the long type. More...
 

Static Private Attributes

static boolean assertsEnabled = false
 True iff assertions are enabled. More...
 

Detailed Description

Simple Java example to show how run a kernel with assert*() and PRINT*() macros and test them.

Definition at line 30 of file Example.java.

Member Function Documentation

◆ [static initializer]() [1/2]

Example.[static initializer] ( )
inlinestaticpackage

◆ [static initializer]() [2/2]

Example.[static initializer] ( )
inlinestaticpackage

◆ fileToString()

static String Example.fileToString ( final String  filename) throws Exception
inlinestaticpackage

Read the file and return its content to a string. If failed then throw an exception.

Definition at line 68 of file Example.java.

◆ getDeviceId()

static cl_device_id Example.getDeviceId ( int  platformI,
int  deviceI 
) throws Exception
inlinestaticpackage

Return the given id device of the given platform OpenCL, or exit if doesn't exists.

Definition at line 78 of file Example.java.

◆ getDeviceInfoString()

static String Example.getDeviceInfoString ( cl_device_id  deviceId,
int  paramName 
)
inlinestaticpackage

Return a string corresponding to device info parameter.

Definition at line 125 of file Example.java.

◆ main()

static void Example.main ( String []  args) throws Exception
inlinestatic

Get the optional parameter –device platform:device and run the kernel ../kernel/example.cl .

Definition at line 314 of file Example.java.

◆ runExample()

static void Example.runExample ( int  nbWorkGroup,
int  nbWorkItemsByWorkGroup,
cl_device_id  deviceId,
boolean  debug 
) throws Exception
inlinestaticpackage

Run the kernel ../kernel/example.cl.

If debug then run the kernel in debug mode, else run the kernel with the macro NDEBUG defined.

Definition at line 147 of file Example.java.

◆ uint32()

static long Example.uint32 ( int  n)
inlinestaticpackage

Return in a long the value of n considered as an unsigned integer on 32 bits.

Definition at line 289 of file Example.java.

◆ uint64()

static BigInteger Example.uint64 ( long  n)
inlinestaticpackage

Return in a BigInteger the value of n considered as an unsigned integer on 64 bits.

Definition at line 299 of file Example.java.

Member Data Documentation

◆ assertsEnabled

boolean Example.assertsEnabled = false
staticprivate

True iff assertions are enabled.

Definition at line 56 of file Example.java.

◆ FLOAT_FIELD_SIZE

final int Example.FLOAT_FIELD_SIZE = 4
staticpackage

Number of bytes for the float type.

Definition at line 33 of file Example.java.

◆ INT_FIELD_SIZE

final int Example.INT_FIELD_SIZE = 4
staticpackage

Number of bytes for the int type.

Definition at line 36 of file Example.java.

◆ LONG_FIELD_SIZE

final int Example.LONG_FIELD_SIZE = 8
staticpackage

Number of bytes for the long type.

Definition at line 39 of file Example.java.


The documentation for this class was generated from the following file: