Package com.nativelibs4java.opencl

Examples of com.nativelibs4java.opencl.CLKernel.enqueueNDRange()


     
      CLEvent kernelCompletion;
      // The same kernel can be safely used by different threads, as long as setArgs + enqueueNDRange are in a synchronized block
      synchronized (kernel) {
          //kernel.setArgs(b1,b2,b3);
          kernelCompletion = kernel.enqueueNDRange(queue, new int[] { A.length }, new int[] { 1 } );
      }
      kernelCompletion.waitFor(); // better not to wait for it but to pass it as a dependent event to some other queuable operation (CLBuffer.read, for instance)
     
      FloatBuffer f = b3.read(queue, kernelCompletion);
     
View Full Code Here


        String src = IOUtils.readText(new File("matvec.cl"));
        CLProgram program = context.createProgram(src);
        CLKernel prod_escalar = program.createKernel("prod_escalar");
        prod_escalar.setArgs(buffer_v1, buffer_v2, buffer_v3, dataSize, dataSize);
       
        CLEvent prodEvt = prod_escalar.enqueueNDRange(queue, new int[] { dataSize });

        DoubleBuffer buffer_v4 = buffer_v3.read(queue,prodEvt);

        for(int i = 0; i < dataSize;i++){
            System.out.print(buffer_v4.get(i));
View Full Code Here

                //CAMADA 3
                //kernel = program.createKernel("atualiza_pesos_1");
                kernelAtualizaPesos1.setArgs(clBufferPesos1, clBufferS1, clBufferEntrada,
                        qtdNeuronios_1, Param.taxaAprendizado, clBufferPesosBias1);
                prodEvt = kernelAtualizaPesos1.enqueueNDRange(queue, new int[]{qtdNeuronios_1});
                //DoubleBuffer dBufferResPesos1 = clBufferPesos1.read(queue,prodEvt);
                //DoubleBuffer dBufferResPesosBias1 = clBufferPesosBias1.read(queue,prodEvt);

                clBufferPesos1 = context.createDoubleBuffer(CLMem.Usage.InputOutput,
                        (DoubleBuffer) clBufferPesos1.read(queue, prodEvt), true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.