TinyMT OpenCL Sample

Japanese Version

Here are TinyMT samples for OpenCL. These are data parallel samples.

These samples require cl.hpp. If your environment doesn't have cl.hpp, please download cl.hpp from Khronos OpenCL API Registry. These samples also require stdint.h and inttypes.h in C99.

Download

TinyMT-opencl-src-1.0.tar.gz (2013/2/14 added)
TinyMT-opencl-src-1.0.zip (2013/2/14 added)

Usage

Compilation of test programs

Sample programs need source programs of TinyMT to be compiled. And They need the jump function of TinyMT.

  1. Expand archive file
  2. Copy opencl directory in TinyMT-opencl-src-xxxx to the directory of TinyMT.
  3. TinyMT-src-xxx
       +---dc
       +---tinymt
       +---jump
       +---opencl
    
  4. Change directory to copied opencl directory
  5. Open Makefile by your editor program, and uncomment the line includes OPENCL = -lOpenCL if you are linux user, or uncomment the line includes OPENCL = -framework opencl if you are OS X user.
  6. Type make all to compile test program.
  7. Type make check
  8. When error occurs, please execute test program which causes error. If '#include' in kernel program causes error, please uncomment the line includes CL_OPT = -DINCLUDE_IMPOSSIPLE in Makefile. In this case, if your GPU has double precision calculation ability, please change KERNEL_OPT to have -DHAVE_DOUBLE. Then make clean and make all and make check.
  9. Check if OK is showed and no NG

Sample program

Sample kernel program using jump function is simple. In sample32_jump.cl, PI is calculated by Monte Carlo Method.

License

These samples can be used freely for any purpose, including commercial use. See LICENSE.txt for detail.

Back to TintMT Home Page