Implement Pragma() for Reactor MemorySanitizer instrumentation
Enabling MemorySanitizer instrumentation for all Reactor routines can
have too big of a performance impact. To support selective
instrumentation, Pragma(MemorySanitizerInstrumentation, true) can be
called to enable it for the next routine that gets created.
It must be called before the Function<> constructor. Pragma state is
thread local, so Pragma(MemorySanitizerInstrumentation, false) must be
called after the routine has been created, to disable it again if
instrumentation is not desired for subsequent routines created in this
thread.
Note that REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION=true enables
MemorySanitizer instrumentation for Reactor routines even if the pragma
state is false.
Bug: b/191050320
Change-Id: Ie71aadeae140e85bda31554788288e138df0d08c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/54988
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by:
Nicolas Capens <nicolascapens@google.com>
Reviewed-by:
Alexis Hétu <sugoi@google.com>
Showing
src/Reactor/Pragma.cpp
0 → 100644
src/Reactor/Pragma.hpp
0 → 100644
src/Reactor/PragmaInternals.hpp
0 → 100644
Please
register
or
sign in
to comment