This directory contains some sample programs of MTGP for OpenCL. Files in this directory are just samples, feel free to copy and change.
I checked these sample files under the environment of OpenCL 1.2, But this does not mean these samples use new features of OpenCL 1.2.
In these samples, jumped status is calculated on device.
Samples are not optimized for specific graphic processors.
OpenCL and NTL(http://shoup.net/ntl/) are needed to make sample programs. Some Linux distributions have NTL package (ntl or ntl-devel).
Comment and uncomment the lines which defines CC in Makefile. Uncomment the lines which defines LIBGF2X or LIBGMP if needed.
make all
File | explanation |
---|---|
opencl_tools.hpp | utility functions which use some variables in global scope. |
mtgp32.cl, mtgp64.cl | device functions and kernel functions for MTGP whose period is 211213-1. Parameters needed for generators are passed by kernel argumets. |
mtgp32-sample-common.h, mtgp64-sample-common.h | some definitions and constants for MTGP with period 211213-1. |
mtgp32-sample.cpp, mtgp64-sample.cpp | OpenCL sample of MTGP with period 211213-1. |
File | explanation |
---|---|
mtgp32-jump.cl, mtgp64-jump.cl | device functions and kernel functions for MTGP whose period is 211213-1. In this file we use one fixed parameter. This file contains jump functions. |
mtgp32-sample-jump1.cpp, mtgp64-sample-jump1.cpp | In this sample, we use long distance jump of MTGP to get distinct sub sequences. The distance we selected for the samples is 3162 steps. The jump steps of powers of three are desirable than those of powers of two in some mathematical reason. |
mtgp32-sample-jump2.cpp, mtgp64-sample-jump2.cpp | In this sample, we use short distance jump of MTGP to get a sequence using parallel calculation. |
mtgp32-jump-table.cpp, mtgp64-jump-table.cpp | From a point of compromize time and space, the jump table contains jump polynomials of 22n × jump steps. n is 0 to 5. |
mtgp32-sample mtgp64-sample, mtgp32-sample-jump1, mtgp32-sample-jump2, mtgp64-sample-jump1 and mtgp64-sample-jump2 are executable files. The executable files need two arguments: number of groups and number of outputs.