@@ -119,7 +119,11 @@ static void inner_basic_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *ra
119119 FLOAT * d = (FLOAT * )args -> b + (k + k * lda ) * COMPSIZE ;
120120 FLOAT * sbb = sb ;
121121
122+ #if _STDC_VERSION__ >= 201112L
123+ _Atomic BLASLONG * flag = (_Atomic BLASLONG * )args -> d ;
124+ #else
122125 volatile BLASLONG * flag = (volatile BLASLONG * )args -> d ;
126+ #endif
123127
124128 blasint * ipiv = (blasint * )args -> c ;
125129
@@ -197,7 +201,12 @@ static void inner_basic_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *ra
197201/* Non blocking implementation */
198202
199203typedef struct {
200- volatile BLASLONG working [MAX_CPU_NUMBER ][CACHE_LINE_SIZE * DIVIDE_RATE ];
204+ #if _STDC_VERSION__ >= 201112L
205+ _Atomic
206+ #else
207+ volatile
208+ #endif
209+ BLASLONG working [MAX_CPU_NUMBER ][CACHE_LINE_SIZE * DIVIDE_RATE ];
201210} job_t ;
202211
203212#define ICOPY_OPERATION (M , N , A , LDA , X , Y , BUFFER ) GEMM_ITCOPY(M, N, (FLOAT *)(A) + ((Y) + (X) * (LDA)) * COMPSIZE, LDA, BUFFER);
@@ -236,11 +245,12 @@ static int inner_advanced_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *
236245 FLOAT * sbb = sb ;
237246
238247 blasint * ipiv = (blasint * )args -> c ;
239-
240- BLASLONG jw ;
241-
248+ BLASLONG jw ;
249+ #if _STDC_VERSION__ >= 201112L
250+ _Atomic BLASLONG * flag = (_Atomic BLASLONG * )args -> d ;
251+ #else
242252 volatile BLASLONG * flag = (volatile BLASLONG * )args -> d ;
243-
253+ #endif
244254 if (args -> a == NULL ) {
245255 TRSM_ILTCOPY (k , k , (FLOAT * )args -> b , lda , 0 , sb );
246256 sbb = (FLOAT * )((((BLASULONG )(sb + k * k * COMPSIZE ) + GEMM_ALIGN ) & ~GEMM_ALIGN ) + GEMM_OFFSET_B );
@@ -442,7 +452,12 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
442452#ifdef _MSC_VER
443453 BLASLONG flag [MAX_CPU_NUMBER * CACHE_LINE_SIZE ];
444454#else
445- volatile BLASLONG flag [MAX_CPU_NUMBER * CACHE_LINE_SIZE ] __attribute__((aligned (128 )));
455+ #if _STDC_VERSION__ >= 201112L
456+ _Atomic
457+ #else
458+ volatile
459+ #endif
460+ BLASLONG flag [MAX_CPU_NUMBER * CACHE_LINE_SIZE ] __attribute__((aligned (128 )));
446461#endif
447462
448463#ifndef COMPLEX
@@ -713,8 +728,12 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
713728 BLASLONG range [MAX_CPU_NUMBER + 1 ];
714729
715730 BLASLONG width , nn , num_cpu ;
716-
717- volatile BLASLONG flag [MAX_CPU_NUMBER * CACHE_LINE_SIZE ] __attribute__((aligned (128 )));
731+ #if _STDC_VERSION__ >= 201112L
732+ _Atomic
733+ #else
734+ volatile
735+ #endif
736+ BLASLONG flag [MAX_CPU_NUMBER * CACHE_LINE_SIZE ] __attribute__((aligned (128 )));
718737
719738#ifndef COMPLEX
720739#ifdef XDOUBLE
0 commit comments