nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/concurrency/AtomicState.java
public AccessState getCurrentState() {
        if (AccessState.values()[currentState.get()] == AccessState.TOE) {
            return AccessState.TOE;
        } else {
            if (tickRequests.get() <= tackRequests.get()) {

                // TODO: looks like this piece of code should be locked :/
                tickRequests.set(0);
                tackRequests.set(0);

                return AccessState.TACK;
            } else
                return AccessState.TICK;
        }
    }
public AccessState getCurrentState() {
        if (AccessState.values()[currentState.get()] == AccessState.TOE) {
            return AccessState.TOE;
        } else {
            if (tickRequests.get() <= tackRequests.get()) {

                // TODO: looks like this piece of code should be locked :/
                tickRequests.set(0);
                tackRequests.set(0);

                return AccessState.TACK;
            } else
                return AccessState.TICK;
        }
    }
public AccessState getCurrentState ( ) { if ( AccessState . values ( ) [ currentState . get ( ) ] == AccessState . TOE ) { return AccessState . TOE ; } else { if ( tickRequests . get ( ) <= tackRequests . get ( ) ) { // TODO: looks like this piece of code should be locked :/ tickRequests . set ( 0 ) ; tackRequests . set ( 0 ) ; return AccessState . TACK ; } else return AccessState . TICK ; } }
This method returns the current memory state

@return
This method returns the current memory state