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 {