object Example
Simple Scala example to show how run a kernel with assert*() and PRINT*() macros and test them.
Piece of assertOpenCL
- Version
September 19, 2018
- Alphabetic
- By Inheritance
- Example
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
val
FLOAT_FIELD_SIZE: Int
Number of bytes for the float type.
-
val
INT_FIELD_SIZE: Int
Number of bytes for the int type.
-
val
LONG_FIELD_SIZE: Int
Number of bytes for the long type.
-
def
fileToString(filename: String): String
Read the file and return its content to a string.
Read the file and return its content to a string. If failed then throw an exception.
-
def
getDeviceId(platformI: Int, deviceI: Int): cl_device_id
Return the given id device of the given platform OpenCL, or exit if doesn't exists.
-
def
getDeviceInfoString(deviceId: cl_device_id, paramName: Int): String
Return a string corresponding to device info parameter.
-
def
main(args: Array[String]): Unit
Get the optional parameter --device platform:device and run the kernel ../kernel/example.cl .
-
def
runExample(nbWorkGroup: Int, nbWorkItemsByWorkGroup: Int, deviceId: cl_device_id, debug: Boolean): Unit
Run the kernel ../kernel/example.cl.
Run the kernel ../kernel/example.cl.
If debug then run the kernel in debug mode, else run the kernel with the macro NDEBUG defined.
-
def
uint32(n: Int): Long
Return in a Long the value of n considered as an unsigned integer on 32 bits.
-
def
uint64(n: Long): BigInt
Return in a BigInt the value of n considered as an unsigned integer on 64 bits.