Commit c3fb81d0 authored by Miao Wang's avatar Miao Wang
Browse files

Guard concurrent scratch_buffer and gemmlowp::GemmContext access

  - scrach_buffer is a file scoped static intended to minimize the
    allocation cost for Conv2D computations when possible.
  - In order to make it thread safe for multi-threaded execution,
    we need to make sure no concucrrent access to it.
  - Similarly for gemmlowp::GemmContext used in Conv2D and
    FullyConnected.
  - The mutex lock is added to prevent concurrent executions that may
    access the static scratch buffer and static gemmlowp::GemmContext.

Bug: 80430825
Bug: 80465406
Test: NeuralNetworksTest_mt_static
Test: NeuralNetworksApiBenchmark no visible performance impact
Merged-In: I6b0df63a03d1f16a1e43a0c1062a997bfbe8f3f2
Change-Id: I6b0df63a03d1f16a1e43a0c1062a997bfbe8f3f2
(cherry picked from commit 9c63a9c4)
parent a7ca183f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment