Interface AffinityManager

    • Method Detail

      • getDeviceForCurrentThread

        Integer getDeviceForCurrentThread()
        This method returns deviceId for current thread
        Returns:
      • getDeviceForThread

        Integer getDeviceForThread​(long threadId)
        This method returns deviceId for a given thread
        Returns:
      • getDeviceForArray

        Integer getDeviceForArray​(INDArray array)
        This method returns id of current device for a given INDArray
        Parameters:
        array -
        Returns:
      • getNumberOfDevices

        int getNumberOfDevices()
        This method returns number of available devices
        Returns:
      • touch

        void touch​(INDArray array)
        Utility method, to associate INDArray with specific device (backend-specific)
        Parameters:
        array -
      • touch

        void touch​(DataBuffer buffer)
        Utility method, to associate INDArray with specific device (backend-specific)
        Parameters:
        buffer -
      • replicateToDevice

        INDArray replicateToDevice​(Integer deviceId,
                                   INDArray array)
        This method replicates given INDArray, and places it to target device.
        Parameters:
        deviceId - target deviceId
        array - INDArray to replicate
        Returns:
      • replicateToDevice

        DataBuffer replicateToDevice​(Integer deviceId,
                                     DataBuffer buffer)
        This method replicates given DataBuffer, and places it to target device.
        Parameters:
        deviceId - target deviceId
        buffer -
        Returns:
      • tagLocation

        void tagLocation​(INDArray array,
                         AffinityManager.Location location)
        This method tags specific INDArray as "recent" on specified location
        Parameters:
        location -
      • tagLocation

        void tagLocation​(DataBuffer buffer,
                         AffinityManager.Location location)
        This method tags specific DataBuffer as "recent" on specified location
        Parameters:
        location -
      • ensureLocation

        void ensureLocation​(INDArray array,
                            AffinityManager.Location location)
        This method propagates given INDArray to specified location
        Parameters:
        array -
        location -
      • getActiveLocation

        AffinityManager.Location getActiveLocation​(INDArray array)
        This method returns last-updated location for the given INDArray
        Parameters:
        array -
        Returns:
      • unsafeSetDevice

        void unsafeSetDevice​(Integer deviceId)
        This method forces specific device for current thread. PLEASE NOTE: This method is UNSAFE and should NOT be used with 100% clearance about it.
        Parameters:
        deviceId -
      • isCrossDeviceAccessSupported

        boolean isCrossDeviceAccessSupported()
        This method returns TRUE if cross-device access is allowed on this system
      • allowCrossDeviceAccess

        void allowCrossDeviceAccess​(boolean reallyAllow)
        This method allows to block cross-device access. Mostly suitable for debugging/testing purposes
        Parameters:
        reallyAllow -