Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • src
  • Device
  • RoutineCache.hpp
Find file
BlameHistoryPermalink
  • Ben Clayton's avatar
    Reimplement LRUCache, fold away LRUSnapshotCache, add tests. · ac43aa7c
    Ben Clayton authored Apr 04, 2020
    LRUCache previously had a complexity of O(n).
    Reimplement using a `std::unordered_set` and a linked list to get this reduced to O(1).
    
    Renamed `LRUCache::query()` to `LRUCache::get()`, as this is a more common verb for a cache, and the `query()` suggests it is side effect free (when it actually makes the entry MRU).
    
    Move `LRUCache.hpp` from `src/Device` to `src/System` so it can be tested by `system-unittests`.
    
    Move the logic of `LRUSnapshotCache` into `VkDevice::SamplingRoutineCache`, as this was the only place it was used, and made it exceptionally hard to separate mutex-locked data from non-locked data.
    
    This is part of the work to get our code statically thread-safe-verifiable.
    
    Bug: b/153194656
    Change-Id: Ie02888ae6c7ed4066df77d692dfae28c3bc1664d
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43489Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    Kokoro-Result: kokoro <noreply+kokoro@google.com>
    Presubmit-Ready: Ben Clayton <bclayton@google.com>
    Tested-by: 's avatarBen Clayton <bclayton@google.com>
    ac43aa7c
RoutineCache.hpp 936 Bytes
EditWeb IDE
×

Replace RoutineCache.hpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.