Browse Source
Use _Atomic instead of volatile for thread safety where C11 is supported
Suggested by dodomorandi in #660
tags/v0.3.0^2
Martin Kroeker
GitHub
8 years ago
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
18 additions and
3 deletions
-
driver/level3/level3_gemm3m_thread.c
-
driver/level3/level3_syrk_threaded.c
-
driver/level3/level3_thread.c
|
|
|
@@ -91,7 +91,12 @@ |
|
|
|
#endif |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
volatile BLASLONG working[MAX_CPU_NUMBER][CACHE_LINE_SIZE * DIVIDE_RATE]; |
|
|
|
#if _STDC_VERSION__ >= 201112L |
|
|
|
_Atomic |
|
|
|
#else |
|
|
|
volatile |
|
|
|
#endif |
|
|
|
BLASLONG working[MAX_CPU_NUMBER][CACHE_LINE_SIZE * DIVIDE_RATE]; |
|
|
|
} job_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -67,7 +67,12 @@ |
|
|
|
#endif |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
volatile BLASLONG working[MAX_CPU_NUMBER][CACHE_LINE_SIZE * DIVIDE_RATE]; |
|
|
|
#if _STDC_VERSION__ >= 201112L |
|
|
|
_Atomic |
|
|
|
#else |
|
|
|
volatile |
|
|
|
#endif |
|
|
|
BLASLONG working[MAX_CPU_NUMBER][CACHE_LINE_SIZE * DIVIDE_RATE]; |
|
|
|
} job_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -91,7 +91,12 @@ |
|
|
|
#endif |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
volatile BLASLONG working[MAX_CPU_NUMBER][CACHE_LINE_SIZE * DIVIDE_RATE]; |
|
|
|
#if _STDC_VERSION__ >= 201112L |
|
|
|
_Atomic |
|
|
|
#else |
|
|
|
volatile |
|
|
|
#endif |
|
|
|
BLASLONG working[MAX_CPU_NUMBER][CACHE_LINE_SIZE * DIVIDE_RATE]; |
|
|
|
} job_t; |
|
|
|
|
|
|
|
|
|
|
|
|