#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);