com.nativelibs4java.opencl.util.XORShiftRandom Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javacl Show documentation
Show all versions of javacl Show documentation
JavaCL is an Object-Oriented API that makes the C OpenCL API available to Java in a very natural way.
It hides away the complexity of cross-platform C bindings, has a clean OO design (with generics, Java enums, NIO buffers, fully typed exceptions...), provides high-level features (OpenGL-interop, array reductions) and comes with samples and demos.
For more info, please visit http://code.google.com/p/nativelibs4java/wiki/OpenCL.
The newest version!
package com.nativelibs4java.opencl.util;
import com.nativelibs4java.opencl.CLAbstractUserProgram;
import com.nativelibs4java.opencl.CLBuffer;
import com.nativelibs4java.opencl.CLBuildException;
import com.nativelibs4java.opencl.CLContext;
import com.nativelibs4java.opencl.CLEvent;
import com.nativelibs4java.opencl.CLKernel;
import com.nativelibs4java.opencl.CLProgram;
import com.nativelibs4java.opencl.CLQueue;
import java.io.IOException;
/** Wrapper around the OpenCL program XORShiftRandom */
public class XORShiftRandom extends CLAbstractUserProgram {
public XORShiftRandom(CLContext context) throws IOException {
super(context, readRawSourceForClass(XORShiftRandom.class));
}
public XORShiftRandom(CLProgram program) throws IOException {
super(program, readRawSourceForClass(XORShiftRandom.class));
}
CLKernel gen_numbers_kernel;
public synchronized CLEvent gen_numbers(CLQueue commandQueue, CLBuffer seeds, CLBuffer output, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
if ((gen_numbers_kernel == null))
gen_numbers_kernel = createKernel("gen_numbers");
gen_numbers_kernel.setArgs(seeds, output);
return gen_numbers_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
}
/** native declaration : com/nativelibs4java/opencl/util/XORShiftRandom.c */
public static final int NUMBERS_COUNT = (int)0;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy