Merge branch 'develop' into issue2588-cmake
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Sun, 11 Oct 2020 11:57:07 +0000 (13:57 +0200)
committerGitHub <noreply@github.com>
Sun, 11 Oct 2020 11:57:07 +0000 (13:57 +0200)
1  2 
driver/others/blas_server_omp.c
driver/others/memory.c

Simple merge
@@@ -2201,46 -2201,40 +2201,46 @@@ static void *alloc_mmap(void *address)
  #endif
  #endif
  
 -
 -        allocsize = DGEMM_P * DGEMM_Q * sizeof(double);
 -
 -        start   = (BLASULONG)map_address;
 -        current = (SCALING - 1) * BUFFER_SIZE;
 +#ifdef BUILD_DOUBLE 
 +      allocsize = DGEMM_P * DGEMM_Q * sizeof(double);
 +#elif defined(BUILD_COMPLEX16)
 +      allocsize = ZGEMM_P * ZGEMM_Q * sizeof(double);
 +#elif defined(BUILD_COMPLEX)
 +      allocsize = CGEMM_P * CGEMM_Q * sizeof(double);
 +#else
 +      allocsize = SGEMM_P * SGEMM_Q * sizeof(double);
 +#endif
 +      start   = (BLASULONG)map_address;
 +      current = (SCALING - 1) * BUFFER_SIZE;
  
-       while(current > 0) {
-         *(BLASLONG *)start = (BLASLONG)start + PAGESIZE;
-         start += PAGESIZE;
-         current -= PAGESIZE;
-       }
+         while(current > 0) {
+           *(BLASLONG *)start = (BLASLONG)start + PAGESIZE;
+           start += PAGESIZE;
+           current -= PAGESIZE;
+         }
  
-       *(BLASLONG *)(start - PAGESIZE) = (BLASULONG)map_address;
+         *(BLASLONG *)(start - PAGESIZE) = (BLASULONG)map_address;
  
-       start = (BLASULONG)map_address;
+         start = (BLASULONG)map_address;
  
-       best = (BLASULONG)-1;
-       best_address = map_address;
+         best = (BLASULONG)-1;
+         best_address = map_address;
  
-       while ((start + allocsize  < (BLASULONG)map_address + (SCALING - 1) * BUFFER_SIZE)) {
+         while ((start + allocsize  < (BLASULONG)map_address + (SCALING - 1) * BUFFER_SIZE)) {
  
-         current = run_bench(start, allocsize);
+           current = run_bench(start, allocsize);
  
-         if (best > current) {
-           best = current;
-           best_address = (void *)start;
-         }
+           if (best > current) {
+             best = current;
+             best_address = (void *)start;
+           }
  
-         start += PAGESIZE;
+           start += PAGESIZE;
  
-       }
+         }
  
        if ((BLASULONG)best_address > (BLASULONG)map_address)
-       munmap(map_address,  (BLASULONG)best_address - (BLASULONG)map_address);
+         munmap(map_address,  (BLASULONG)best_address - (BLASULONG)map_address);
  
        munmap((void *)((BLASULONG)best_address + BUFFER_SIZE), (SCALING - 1) * BUFFER_SIZE + (BLASULONG)map_address - (BLASULONG)best_address);