Search in sources :

Example 66 with AllocationPoint

use of org.nd4j.jita.allocator.impl.AllocationPoint in project nd4j by deeplearning4j.

the class AsynchronousFlowController method synchronizeReadLanes.

protected void synchronizeReadLanes(AllocationPoint point) {
    cudaEvent_t event;
    int cnt = 0;
    while ((event = point.getReadLane().poll()) != null) {
        event.synchronize();
        event.destroy();
        cnt++;
    }
// log.info("Events synchronized: [{}]", cnt);
}
Also used : org.nd4j.jita.allocator.pointers.cuda.cudaEvent_t(org.nd4j.jita.allocator.pointers.cuda.cudaEvent_t) AllocationPoint(org.nd4j.jita.allocator.impl.AllocationPoint)

Example 67 with AllocationPoint

use of org.nd4j.jita.allocator.impl.AllocationPoint in project nd4j by deeplearning4j.

the class AsynchronousFlowController method synchronizeReadLanes.

protected void synchronizeReadLanes(INDArray array) {
    if (array == null)
        return;
    AllocationPoint point = allocator.getAllocationPoint(array);
    synchronizeReadLanes(point);
}
Also used : AllocationPoint(org.nd4j.jita.allocator.impl.AllocationPoint)

Aggregations

AllocationPoint (org.nd4j.jita.allocator.impl.AllocationPoint)67 INDArray (org.nd4j.linalg.api.ndarray.INDArray)33 Test (org.junit.Test)31 CudaContext (org.nd4j.linalg.jcublas.context.CudaContext)24 CudaPointer (org.nd4j.jita.allocator.pointers.CudaPointer)15 DataBuffer (org.nd4j.linalg.api.buffer.DataBuffer)11 ND4JIllegalStateException (org.nd4j.linalg.exception.ND4JIllegalStateException)11 AtomicAllocator (org.nd4j.jita.allocator.impl.AtomicAllocator)7 BaseCudaDataBuffer (org.nd4j.linalg.jcublas.buffer.BaseCudaDataBuffer)7 Pointer (org.bytedeco.javacpp.Pointer)6 AllocationShape (org.nd4j.jita.allocator.impl.AllocationShape)5 PointersPair (org.nd4j.jita.allocator.pointers.PointersPair)5 MemoryWorkspace (org.nd4j.linalg.api.memory.MemoryWorkspace)4 JCublasNDArray (org.nd4j.linalg.jcublas.JCublasNDArray)3 CudaDoubleDataBuffer (org.nd4j.linalg.jcublas.buffer.CudaDoubleDataBuffer)3 CompressedDataBuffer (org.nd4j.linalg.compression.CompressedDataBuffer)2 DeviceLocalNDArray (org.nd4j.linalg.util.DeviceLocalNDArray)2 DataInputStream (java.io.DataInputStream)1 DataOutputStream (java.io.DataOutputStream)1 FileInputStream (java.io.FileInputStream)1