@@ -2062,13 +2062,13 @@ static void *alloc_mmap(void *address){
2062
2062
}
2063
2063
2064
2064
if (map_address != (void * )-1 ) {
2065
- #if defined(SMP ) && !defined(USE_OPENMP )
2065
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2066
2066
LOCK_COMMAND (& alloc_lock );
2067
2067
#endif
2068
2068
release_info [release_pos ].address = map_address ;
2069
2069
release_info [release_pos ].func = alloc_mmap_free ;
2070
2070
release_pos ++ ;
2071
- #if defined(SMP ) && !defined(USE_OPENMP )
2071
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2072
2072
UNLOCK_COMMAND (& alloc_lock );
2073
2073
#endif
2074
2074
}
@@ -2214,13 +2214,13 @@ static void *alloc_mmap(void *address){
2214
2214
#endif
2215
2215
2216
2216
if (map_address != (void * )-1 ) {
2217
- #if defined(SMP ) && !defined(USE_OPENMP )
2217
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2218
2218
LOCK_COMMAND (& alloc_lock );
2219
2219
#endif
2220
2220
release_info [release_pos ].address = map_address ;
2221
2221
release_info [release_pos ].func = alloc_mmap_free ;
2222
2222
release_pos ++ ;
2223
- #if defined(SMP ) && !defined(USE_OPENMP )
2223
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2224
2224
UNLOCK_COMMAND (& alloc_lock );
2225
2225
#endif
2226
2226
}
@@ -2701,7 +2701,7 @@ void *blas_memory_alloc(int procpos){
2701
2701
2702
2702
position = 0 ;
2703
2703
2704
- #if defined(SMP ) && !defined(USE_OPENMP )
2704
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2705
2705
LOCK_COMMAND (& alloc_lock );
2706
2706
#endif
2707
2707
do {
@@ -2718,7 +2718,7 @@ void *blas_memory_alloc(int procpos){
2718
2718
position ++ ;
2719
2719
2720
2720
} while (position < NUM_BUFFERS );
2721
- #if defined(SMP ) && !defined(USE_OPENMP )
2721
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2722
2722
UNLOCK_COMMAND (& alloc_lock );
2723
2723
#endif
2724
2724
goto error ;
@@ -2730,7 +2730,7 @@ void *blas_memory_alloc(int procpos){
2730
2730
#endif
2731
2731
2732
2732
memory [position ].used = 1 ;
2733
- #if defined(SMP ) && !defined(USE_OPENMP )
2733
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2734
2734
UNLOCK_COMMAND (& alloc_lock );
2735
2735
#else
2736
2736
blas_unlock (& memory [position ].lock );
@@ -2779,11 +2779,11 @@ void *blas_memory_alloc(int procpos){
2779
2779
2780
2780
} while ((BLASLONG )map_address == -1 );
2781
2781
2782
- #if defined(SMP ) && !defined(USE_OPENMP )
2782
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2783
2783
LOCK_COMMAND (& alloc_lock );
2784
2784
#endif
2785
2785
memory [position ].addr = map_address ;
2786
- #if defined(SMP ) && !defined(USE_OPENMP )
2786
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2787
2787
UNLOCK_COMMAND (& alloc_lock );
2788
2788
#endif
2789
2789
@@ -2839,7 +2839,7 @@ void blas_memory_free(void *free_area){
2839
2839
#endif
2840
2840
2841
2841
position = 0 ;
2842
- #if defined(SMP ) && !defined(USE_OPENMP )
2842
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2843
2843
LOCK_COMMAND (& alloc_lock );
2844
2844
#endif
2845
2845
while ((position < NUM_BUFFERS ) && (memory [position ].addr != free_area ))
@@ -2855,7 +2855,7 @@ void blas_memory_free(void *free_area){
2855
2855
WMB ;
2856
2856
2857
2857
memory [position ].used = 0 ;
2858
- #if defined(SMP ) && !defined(USE_OPENMP )
2858
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2859
2859
UNLOCK_COMMAND (& alloc_lock );
2860
2860
#endif
2861
2861
@@ -2872,7 +2872,7 @@ void blas_memory_free(void *free_area){
2872
2872
for (position = 0 ; position < NUM_BUFFERS ; position ++ )
2873
2873
printf ("%4ld %p : %d\n" , position , memory [position ].addr , memory [position ].used );
2874
2874
#endif
2875
- #if defined(SMP ) && !defined(USE_OPENMP )
2875
+ #if ( defined(SMP ) || defined( USE_LOCKING ) ) && !defined(USE_OPENMP )
2876
2876
UNLOCK_COMMAND (& alloc_lock );
2877
2877
#endif
2878
2878
return ;
@@ -2924,7 +2924,7 @@ void blas_shutdown(void){
2924
2924
2925
2925
#if defined(OS_LINUX ) && !defined(NO_WARMUP )
2926
2926
2927
- #ifdef SMP
2927
+ #if defined( SMP ) || defined( USE_LOCKING )
2928
2928
#if defined(USE_PTHREAD_LOCK )
2929
2929
static pthread_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER ;
2930
2930
#elif defined(USE_PTHREAD_SPINLOCK )
@@ -2949,7 +2949,7 @@ static void _touch_memory(blas_arg_t *arg, BLASLONG *range_m, BLASLONG *range_n,
2949
2949
if (hot_alloc != 2 ) {
2950
2950
#endif
2951
2951
2952
- #ifdef SMP
2952
+ #if defined( SMP ) || defined( USE_LOCKING )
2953
2953
LOCK_COMMAND (& init_lock );
2954
2954
#endif
2955
2955
@@ -2959,7 +2959,7 @@ static void _touch_memory(blas_arg_t *arg, BLASLONG *range_m, BLASLONG *range_n,
2959
2959
size -= PAGESIZE ;
2960
2960
}
2961
2961
2962
- #ifdef SMP
2962
+ #if defined( SMP ) || defined( USE_LOCKING )
2963
2963
UNLOCK_COMMAND (& init_lock );
2964
2964
#endif
2965
2965
0 commit comments