def __init__(self, *args, **kwargs): super(OpRefactoredBlockedArrayCache, self).__init__(*args, **kwargs) # Input ---------> opCacheFixer -> opUnblockedArrayCache -> opSplitRequestsBlockwise -> Output # / / # fixAtCurrent -- / # / # BlockShape -------------------------------------------- self._opCacheFixer = OpCacheFixer(parent=self) self._opCacheFixer.Input.connect(self.Input) self._opCacheFixer.fixAtCurrent.connect(self.fixAtCurrent) self._opUnblockedArrayCache = OpUnblockedArrayCache(parent=self) self._opUnblockedArrayCache.Input.connect(self._opCacheFixer.Output) self._opSplitRequestsBlockwise = OpSplitRequestsBlockwise( always_request_full_blocks=True, parent=self) self._opSplitRequestsBlockwise.BlockShape.connect(self.outerBlockShape) self._opSplitRequestsBlockwise.Input.connect( self._opUnblockedArrayCache.Output) self.Output.connect(self._opSplitRequestsBlockwise.Output) # This member is used by tests that check RAM usage. self.setup_ram_context = RamMeasurementContext() self.registerWithMemoryManager()
def __init__(self, *args, **kwargs): super(OpBlockedArrayCache, self).__init__(*args, **kwargs) self._configured = False self._fixed = False self._fixed_dirty_blocks = set() self._lock = Lock() self._innerBlockShape = None self._outerBlockShape = None self._blockShape = None self._fixed_all_dirty = False # this is a shortcut for storing wehter all subblocks are dirty self._forward_dirty = False self._opDummy = None self._opSub_list = {} self._cache_list = {} # This member is used by tests that check RAM usage. self.setup_ram_context = RamMeasurementContext()
def __init__(self, *args, **kwargs): super(OpBlockedArrayCache, self).__init__(*args, **kwargs) # SCHEMATIC WHEN BypassModeEnabled == False: # # Input ---------> opCacheFixer -> opSimpleBlockedArrayCache -> (indirectly via execute) -> Output # / / # fixAtCurrent -- / # / # BlockShape ------------------- # SCHEMATIC WHEN BypassModeEnabled == True: # # Input --> (indirectly via execute) -> Output self._opCacheFixer = OpCacheFixer(parent=self) self._opCacheFixer.Input.connect(self.Input) self._opCacheFixer.fixAtCurrent.connect(self.fixAtCurrent) self._opSimpleBlockedArrayCache = OpSimpleBlockedArrayCache( parent=self) self._opSimpleBlockedArrayCache.Input.connect( self._opCacheFixer.Output) self._opSimpleBlockedArrayCache.CompressionEnabled.connect( self.CompressionEnabled) self._opSimpleBlockedArrayCache.Input.connect( self._opCacheFixer.Output) self._opSimpleBlockedArrayCache.BlockShape.connect(self.BlockShape) self._opSimpleBlockedArrayCache.BypassModeEnabled.connect( self.BypassModeEnabled) self.CleanBlocks.connect(self._opSimpleBlockedArrayCache.CleanBlocks) self.Output.connect(self._opSimpleBlockedArrayCache.Output) # Instead of connecting our Output directly to our internal pipeline, # We manually forward the data via the execute() function, # which allows us to implement a bypass for the internal pipeline if Enabled #self.Output.connect( self._opSimpleBlockedArrayCache.Output ) # Since we didn't directly connect the pipeline to our output, explicitly forward dirty notifications self._opSimpleBlockedArrayCache.Output.notifyDirty( lambda slot, roi: self.Output.setDirty(roi.start, roi.stop)) # This member is used by tests that check RAM usage. self.setup_ram_context = RamMeasurementContext() self.registerWithMemoryManager()