All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nativelibs4java.opencl.util.LinearAlgebraKernels Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.0.0-RC4
Show 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 LinearAlgebraKernels
public class LinearAlgebraKernels extends CLAbstractUserProgram {
	public LinearAlgebraKernels(CLContext context) throws IOException {
		super(context, readRawSourceForClass(LinearAlgebraKernels.class));
	}
	public LinearAlgebraKernels(CLProgram program) throws IOException {
		super(program, readRawSourceForClass(LinearAlgebraKernels.class));
	}
	CLKernel mulMatDouble_kernel;
	public synchronized CLEvent mulMatDouble(CLQueue commandQueue, CLBuffer a, int aColumns, CLBuffer b, int bColumns, CLBuffer c, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (mulMatDouble_kernel == null) 
			mulMatDouble_kernel = createKernel("mulMatDouble");
		mulMatDouble_kernel.setArgs(a, aColumns, b, bColumns, c);
		return mulMatDouble_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
	CLKernel mulVecDouble_kernel;
	public synchronized CLEvent mulVecDouble(CLQueue commandQueue, CLBuffer a, int aColumns, CLBuffer b, int bSize, CLBuffer c, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (mulVecDouble_kernel == null) 
			mulVecDouble_kernel = createKernel("mulVecDouble");
		mulVecDouble_kernel.setArgs(a, aColumns, b, bSize, c);
		return mulVecDouble_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
	CLKernel transposeDouble_kernel;
	public synchronized CLEvent transposeDouble(CLQueue commandQueue, CLBuffer a, int aRows, int aColumns, CLBuffer out, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (transposeDouble_kernel == null) 
			transposeDouble_kernel = createKernel("transposeDouble");
		transposeDouble_kernel.setArgs(a, aRows, aColumns, out);
		return transposeDouble_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
	CLKernel mulMatFloat_kernel;
	public synchronized CLEvent mulMatFloat(CLQueue commandQueue, CLBuffer a, int aColumns, CLBuffer b, int bColumns, CLBuffer c, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (mulMatFloat_kernel == null) 
			mulMatFloat_kernel = createKernel("mulMatFloat");
		mulMatFloat_kernel.setArgs(a, aColumns, b, bColumns, c);
		return mulMatFloat_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
	CLKernel mulVecFloat_kernel;
	public synchronized CLEvent mulVecFloat(CLQueue commandQueue, CLBuffer a, int aColumns, CLBuffer b, int bSize, CLBuffer c, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (mulVecFloat_kernel == null) 
			mulVecFloat_kernel = createKernel("mulVecFloat");
		mulVecFloat_kernel.setArgs(a, aColumns, b, bSize, c);
		return mulVecFloat_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
	CLKernel transposeFloat_kernel;
	public synchronized CLEvent transposeFloat(CLQueue commandQueue, CLBuffer a, int aRows, int aColumns, CLBuffer out, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (transposeFloat_kernel == null) 
			transposeFloat_kernel = createKernel("transposeFloat");
		transposeFloat_kernel.setArgs(a, aRows, aColumns, out);
		return transposeFloat_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy