[go: up one dir, main page]

Simplify thread-safe initialization of GpuDeviceProperties.

Description

Simplify thread-safe initialization of GpuDeviceProperties.

Currently, GpuDeviceProperties uses a hand-rolled thread-safe initializer based on a volatile boolean and some atomic thread fences. This commit relocates the initialization code into the constructor; block scope static variables have thread-safe initializers starting in C++11. The existing code emits a ThreadSanitizer diagnostic on the reads and writes to initialized_ on an internal build.

Reference issue

Additional information

Merge request reports

Loading