有谁知道这意味着什么以及这怎么可能发生?在我看来是对的。我正在尝试将 GPU 用于神经网络。
这是错误:
!!!!!!! clCreateCommandQueue() failed out of host memory
May 28, 2018 6:36:39 PM com.aparapi.internal.kernel.KernelRunner fallBackToNextDevice
WARNING: Device failed for Util$1, devices={AMD<GPU>|AMD<CPU>|Java Alternative Algorithm|Java Thread Pool}: OpenCL compile failed
com.aparapi.internal.exception.AparapiException: OpenCL compile failed
at com.aparapi.internal.kernel.KernelRunner.fallBackToNextDevice(KernelRunner.java:1286)
at com.aparapi.internal.kernel.KernelRunner.executeInternalInner(KernelRunner.java:1550)
at com.aparapi.internal.kernel.KernelRunner.executeInternalOuter(KernelRunner.java:1351)
at com.aparapi.internal.kernel.KernelRunner.execute(KernelRunner.java:1342)
at com.aparapi.Kernel.execute(Kernel.java:2856)
at com.aparapi.Kernel.execute(Kernel.java:2813)
at com.aparapi.Kernel.execute(Kernel.java:2753)
at Util.Util.dotProduct(Util.java:46)
at Network.FullyConnectedNetwork.predictOutput(FullyConnectedNetwork.java:181)
at Network.FullyConnectedNetwork.test(FullyConnectedNetwork.java:321)
at Run.RunFullyConnected.main(RunFullyConnected.java:32)
这是导致错误的代码:
public static double dotProduct(ArrayList<Double> in1, ArrayList<Double> in2) {
final double[] in1Copy = new double[in1.size()];
final double[] in2Copy = new double[in1.size()];
for(int i = 0; i < in1.size(); i++) {
in1Copy[i] = in1.get(i);
in2Copy[i] = in2.get(i);
}
final double[] result = new double[1];
Kernel kernel = new Kernel() {
@Override
public void run() {
int i = getGlobalId();
result[0] += in1Copy[i] + in2Copy[i];
}
};
Range range = Range.create(in1Copy.length);
kernel.execute(range);
return result[0];
}