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
parent
commit
6a99fcce94
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions
  1. +6
    -1
      driver/level3/level3_gemm3m_thread.c
  2. +6
    -1
      driver/level3/level3_syrk_threaded.c
  3. +6
    -1
      driver/level3/level3_thread.c

+ 6
- 1
driver/level3/level3_gemm3m_thread.c View File

@@ -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;




+ 6
- 1
driver/level3/level3_syrk_threaded.c View File

@@ -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;




+ 6
- 1
driver/level3/level3_thread.c View File

@@ -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;




Loading…
Cancel
Save