org.encog.engine.opencl.kernels
Class KernelVectorAdd

java.lang.Object
  extended by org.encog.engine.opencl.kernels.EncogKernel
      extended by org.encog.engine.opencl.kernels.KernelVectorAdd

public class KernelVectorAdd
extends EncogKernel

A very simple kernel, used to add a vector. Not actually used by Encog, it is a simple test case to verify that OpenCL is working.


Constructor Summary
KernelVectorAdd(EncogCLDevice device, int length)
          Construct a simple kernel to add two vectors.
 
Method Summary
 double[] add(EncogCLDevice device, double[] inputA, double[] inputB)
          Perform the addition.
 
Methods inherited from class org.encog.engine.opencl.kernels.EncogKernel
compile, compile, createArrayReadOnly, createArrayReadOnly, createFloatArrayWriteOnly, getCLSource, getContext, getDevice, getGlobalWork, getKernel, getLocalWork, getMaxWorkGroupSize, getProgram, getSourceName, getWorkGroupLong, prepareKernel, release, releaseBuffer, setArg, setCLSource, setGlobalWork, setLocalWork
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KernelVectorAdd

public KernelVectorAdd(EncogCLDevice device,
                       int length)
Construct a simple kernel to add two vectors.

Parameters:
device - The device to use.
length - The length of the vector.
Method Detail

add

public double[] add(EncogCLDevice device,
                    double[] inputA,
                    double[] inputB)
Perform the addition.

Parameters:
device - The OpenCL device to use.
inputA - The first vector to add.
inputB - The second vector to add.
Returns:
The result of the addition.


Copyright © 2011. All Rights Reserved.