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 @@ -2647,21 +2647,26 @@ void *blas_memory_alloc(int procpos){
2647
2647
2648
2648
position = 0 ;
2649
2649
2650
+ #if defined(SMP ) && !defined(USE_OPENMP )
2650
2651
LOCK_COMMAND (& alloc_lock );
2652
+ #endif
2651
2653
do {
2652
- /* if (!memory[position].used) { */
2653
- /* blas_lock(&memory[position].lock);*/
2654
-
2654
+ #if defined(USE_OPENMP )
2655
+ if (!memory [position ].used ) {
2656
+ blas_lock (& memory [position ].lock );
2657
+ #endif
2655
2658
if (!memory [position ].used ) goto allocation ;
2656
2659
2657
- /* blas_unlock(&memory[position].lock);*/
2658
- /* } */
2659
-
2660
+ #if defined(USE_OPENMP )
2661
+ blas_unlock (& memory [position ].lock );
2662
+ }
2663
+ #endif
2660
2664
position ++ ;
2661
2665
2662
2666
} while (position < NUM_BUFFERS );
2663
- UNLOCK_COMMAND (& alloc_lock );
2664
-
2667
+ #if defined(SMP ) && !defined(USE_OPENMP )
2668
+ UNLOCK_COMMAND (& alloc_lock );
2669
+ #endif
2665
2670
goto error ;
2666
2671
2667
2672
allocation :
@@ -2671,9 +2676,11 @@ void *blas_memory_alloc(int procpos){
2671
2676
#endif
2672
2677
2673
2678
memory [position ].used = 1 ;
2674
-
2679
+ #if defined( SMP ) && !defined( USE_OPENMP )
2675
2680
UNLOCK_COMMAND (& alloc_lock );
2676
-
2681
+ #else
2682
+ blas_unlock (& memory [position ].lock );
2683
+ #endif
2677
2684
if (!memory [position ].addr ) {
2678
2685
do {
2679
2686
#ifdef DEBUG
You can’t perform that action at this time.
0 commit comments