Package org.encog.engine.opencl

Examples of org.encog.engine.opencl.EncogCLQueue


    setArg(7, this.idealBuffer);
    setArg(8, this.weightInArrayBuffer);
    setArg(9, this.layerOutputBuffer);

    try {
      final EncogCLQueue queue = this.device.getQueue();

      this.paramArray[4] = start;

      queue.array2Buffer(this.weightInArray, this.weightInArrayBuffer);
      queue.array2Buffer(this.paramArray, this.paramBuffer);

      // Execute the kernel
      queue.execute(this);
      queue.waitFinish();

      // Read the results
      queue.buffer2Array(this.errorBuffer, this.errors);
      queue.buffer2Array(this.layerOutputBuffer, this.layerOutput );

    } catch (final CLException e) {
      if (e.getMessage().equals("CL_OUT_OF_RESOURCES")) {
        throw new OutOfOpenCLResources(e);
      } else {
View Full Code Here


    setArg(0, this.bufferArrayA);
    setArg(1, this.bufferArrayB);
    setArg(2, this.bufferTargetArray);

    final EncogCLQueue queue = getDevice().getQueue();

    queue.array2Buffer(this.arrayA, this.bufferArrayA);
    queue.array2Buffer(this.arrayB, this.bufferArrayB);

    queue.execute(this);

    queue.buffer2Array(this.bufferTargetArray, this.targetArray);

    final double[] result = new double[this.targetArray.length];

    for (int i = 0; i < this.targetArray.length; i++) {
      result[i] = this.targetArray[i];
View Full Code Here

    setArg(12, this.tempDataInBuffer);
    setArg(13, this.tempDataOutBuffer);
    setArg(14, this.gradientInBuffer);

    try {
      final EncogCLQueue queue = this.device.getQueue();

      EngineArray.fill(this.gradients, 0);

      if (learn) {
        this.paramArray[3] = 1;
      } else {
        this.paramArray[3] = 0;
      }

      this.paramArray[4] = start;

      queue.array2Buffer(this.weightInArray, this.weightInArrayBuffer);
      queue.array2Buffer(this.tempDataArray, this.tempDataInBuffer);
      queue.array2Buffer(this.gradients, this.gradientInBuffer);
      queue.array2Buffer(this.paramArray, this.paramBuffer);

      // Execute the kernel
      queue.execute(this);
      queue.waitFinish();

      // Read the results
      queue.buffer2Array(this.errorBuffer, this.errors);
      queue.buffer2Array(this.weightOutArrayBuffer, this.weightOutArray);
      queue.buffer2Array(this.tempDataOutBuffer, this.tempDataArray);
      queue.buffer2Array(this.gradientOutBuffer, this.gradients);

    } catch (final CLException e) {
      if (e.getMessage().equals("CL_OUT_OF_RESOURCES")) {
        throw new OutOfOpenCLResources(e);
      } else {
View Full Code Here

TOP

Related Classes of org.encog.engine.opencl.EncogCLQueue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.