my java code, when error occurred
[NOTE]
public class Cl {
public static void main(String[] args) throws IOException {
CLContext context = JavaCL.createBestContext();
CLQueue queue = context.createDefaultQueue();
ByteOrder byteOrder = context.getByteOrder();
int n = 1024;
// create memory for a 4x4 matrix
Pointer<Float> AmatrixPtr=Pointer.allocateFloats(44).order(context.getByteOrder());
Pointer<Float> BmatrixPtr=Pointer.allocateFloats(44).order(context.getByteOrder());
Pointer<Float> OutmatrixPtr=Pointer.allocateFloats(4*4).order(context.getByteOrder());
// write the matrix elements
AmatrixPtr.setFloats(new float[]{
1, 0, 0, 1,
2, 1, 2, 0,
1, 0, 1, 1,
0, 0, 1, 2});
BmatrixPtr.setFloats(new float[]{
1, 0, 0, 1,
2, 1, 2, 0,
1, 0, 1, 1,
0, 0, 1, 2});
// create a GPU buffer for the matrix
CLBuffer<Float> OutmatrixGpu=context.createBuffer(CLMem.Usage.Output, OutmatrixPtr, true);
CLBuffer<Float> AmatrixGpu=context.createBuffer(CLMem.Usage.Input, AmatrixPtr, true);
CLBuffer<Float> BmatrixGpu=context.createBuffer(CLMem.Usage.Input, BmatrixPtr, true);
String src = IOUtils.readText(JavaCLTutorial1.class.getResource("ClKernels.cl"));
CLProgram program = context.createProgram(src);
// Get and call the kernel :
CLKernel addFloatsKernel = program.createKernel("matrix_mult");
addFloatsKernel.setArgs(AmatrixGpu, BmatrixGpu, OutmatrixGpu);
}
}
[/NOTE]