synchronized Reductor<Float> getAddReductorFloat() { if (addReductorFloat == null) { try { addReductorFloat = ReductionUtils.createReductor(getContext(), ReductionUtils.Operation.Add, OpenCLType.Float, 1); } catch (CLBuildException ex) { Logger.getLogger(LinearAlgebraUtils.class.getName()).log(Level.SEVERE, null, ex); throw new RuntimeException("Failed to create an addition reductor !", ex); } } return addReductorFloat; }
public synchronized <T> CLEvent multiply( CLBuffer<T> a, int aRows, int aColumns, CLBuffer<T> b, int bRows, int bColumns, CLBuffer<T> out, //long outRows, long outColumns, CLEvent... eventsToWaitFor) throws CLBuildException { if (a.getElementClass() == Double.class) return multiplyDoubles((CLBuffer<Double>)a, aRows, aColumns, (CLBuffer<Double>)b, bRows, bColumns, (CLBuffer<Double>)out, eventsToWaitFor); if (a.getElementClass() == Float.class) return multiplyFloats((CLBuffer<Float>)a, aRows, aColumns, (CLBuffer<Float>)b, bRows, bColumns, (CLBuffer<Float>)out, eventsToWaitFor); throw new UnsupportedOperationException(); } public synchronized CLEvent multiplyDoubles(
public synchronized <T> CLEvent transpose(CLBuffer<T> a, int aRows, int aColumns, CLBuffer<T> out, CLEvent... eventsToWaitFor) throws CLBuildException { if (a.getElementClass() == Double.class) return transposeDoubles((CLBuffer<Double>)a, aRows, aColumns, (CLBuffer<Double>)out, eventsToWaitFor); if (a.getElementClass() == Float.class) return transposeFloats((CLBuffer<Float>)a, aRows, aColumns, (CLBuffer<Float>)out, eventsToWaitFor); throw new UnsupportedOperationException(); }
public CLContext getContext() { return getQueue().getContext(); }
public CLKernels(CLQueue queue) throws IOException, CLBuildException { kernels = new LinearAlgebraUtils(queue); math = new ParallelMath(queue); context = queue.getContext(); this.queue = queue; }
public CLContext getContext() { return getQueue().getContext(); }
public synchronized <T> CLEvent transpose(CLBuffer<T> a, int aRows, int aColumns, CLBuffer<T> out, CLEvent... eventsToWaitFor) throws CLBuildException { if (a.getElementClass() == Double.class) return transposeDoubles((CLBuffer<Double>)a, aRows, aColumns, (CLBuffer<Double>)out, eventsToWaitFor); if (a.getElementClass() == Float.class) return transposeFloats((CLBuffer<Float>)a, aRows, aColumns, (CLBuffer<Float>)out, eventsToWaitFor); throw new UnsupportedOperationException(); }
public synchronized <T> CLEvent multiply( CLBuffer<T> a, int aRows, int aColumns, CLBuffer<T> b, int bRows, int bColumns, CLBuffer<T> out, //long outRows, long outColumns, CLEvent... eventsToWaitFor) throws CLBuildException { if (a.getElementClass() == Double.class) return multiplyDoubles((CLBuffer<Double>)a, aRows, aColumns, (CLBuffer<Double>)b, bRows, bColumns, (CLBuffer<Double>)out, eventsToWaitFor); if (a.getElementClass() == Float.class) return multiplyFloats((CLBuffer<Float>)a, aRows, aColumns, (CLBuffer<Float>)b, bRows, bColumns, (CLBuffer<Float>)out, eventsToWaitFor); throw new UnsupportedOperationException(); } public synchronized CLEvent multiplyDoubles(
synchronized Reductor<Double> getAddReductorDouble() { if (addReductorDouble == null) { try { addReductorDouble = ReductionUtils.createReductor(getContext(), ReductionUtils.Operation.Add, OpenCLType.Double, 1); } catch (CLBuildException ex) { Logger.getLogger(LinearAlgebraUtils.class.getName()).log(Level.SEVERE, null, ex); throw new RuntimeException("Failed to create an addition reductor !", ex); } } return addReductorDouble; }
synchronized Reductor<Float> getAddReductorFloat() { if (addReductorFloat == null) { try { addReductorFloat = ReductionUtils.createReductor(getContext(), ReductionUtils.Operation.Add, OpenCLType.Float, 1); } catch (CLBuildException ex) { Logger.getLogger(LinearAlgebraUtils.class.getName()).log(Level.SEVERE, null, ex); throw new RuntimeException("Failed to create an addition reductor !", ex); } } return addReductorFloat; }
synchronized Reductor<Double> getAddReductorDouble() { if (addReductorDouble == null) { try { addReductorDouble = ReductionUtils.createReductor(getContext(), ReductionUtils.Operation.Add, OpenCLType.Double, 1); } catch (CLBuildException ex) { Logger.getLogger(LinearAlgebraUtils.class.getName()).log(Level.SEVERE, null, ex); throw new RuntimeException("Failed to create an addition reductor !", ex); } } return addReductorDouble; }