aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Turing Eret <turingeret@ucar.edu>2021-04-23 07:43:35 -0600
committerGravatar Turing Eret <turingeret@ucar.edu>2021-04-23 07:43:35 -0600
commit3804ca0d905a0a03357db50abc7468f5f90abc98 (patch)
tree25c5a8acc69e55e96ca2c053845edaae9374409e /test
parent045c0609b5c059974104f29dad91bcc3828e91ac (diff)
Fix for issue with static global variables in TensorDeviceGpu.h
m_deviceProperties and m_devicePropInitialized are defined as global statics which will define multiple copies which can cause issues if initializeDeviceProp() is called in one translation unit and then m_deviceProperties is used in a different translation unit. Added inline functions getDeviceProperties() and getDevicePropInitialized() which defines those variables as static locals. As per the C++ standard 7.1.2/4, a static local declared in an inline function always refers to the same object, so this should be safer. Credit to Sun Chenggen for this fix. This fixes issue #1475.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions