File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -2694,21 +2694,26 @@ void *blas_memory_alloc(int procpos){
2694
2694
2695
2695
position = 0 ;
2696
2696
2697
+ #if defined(SMP ) && !defined(USE_OPENMP )
2697
2698
LOCK_COMMAND (& alloc_lock );
2699
+ #endif
2698
2700
do {
2699
- /* if (!memory[position].used) { */
2700
- /* blas_lock(&memory[position].lock);*/
2701
-
2701
+ #if defined(USE_OPENMP )
2702
+ if (!memory [position ].used ) {
2703
+ blas_lock (& memory [position ].lock );
2704
+ #endif
2702
2705
if (!memory [position ].used ) goto allocation ;
2703
2706
2704
- /* blas_unlock(&memory[position].lock);*/
2705
- /* } */
2706
-
2707
+ #if defined(USE_OPENMP )
2708
+ blas_unlock (& memory [position ].lock );
2709
+ }
2710
+ #endif
2707
2711
position ++ ;
2708
2712
2709
2713
} while (position < NUM_BUFFERS );
2710
- UNLOCK_COMMAND (& alloc_lock );
2711
-
2714
+ #if defined(SMP ) && !defined(USE_OPENMP )
2715
+ UNLOCK_COMMAND (& alloc_lock );
2716
+ #endif
2712
2717
goto error ;
2713
2718
2714
2719
allocation :
@@ -2718,9 +2723,11 @@ void *blas_memory_alloc(int procpos){
2718
2723
#endif
2719
2724
2720
2725
memory [position ].used = 1 ;
2721
-
2726
+ #if defined( SMP ) && !defined( USE_OPENMP )
2722
2727
UNLOCK_COMMAND (& alloc_lock );
2723
-
2728
+ #else
2729
+ blas_unlock (& memory [position ].lock );
2730
+ #endif
2724
2731
if (!memory [position ].addr ) {
2725
2732
do {
2726
2733
#ifdef DEBUG
You can’t perform that action at this time.
0 commit comments