diff options
| author | Tianhao Wang <wth@riseup.net> | 2023-11-02 01:31:40 +0100 |
|---|---|---|
| committer | Tianhao Wang <wth@riseup.net> | 2023-11-02 01:31:40 +0100 |
| commit | b5871ab969c66eb27974b078e0efe44e268d112c (patch) | |
| tree | a00ecdca1195164222a9ac46c9509f1a64f755b0 | |
| parent | 984e94449457749e53bea0e209be98cba4b08c27 (diff) | |
| -rw-r--r-- | testn.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,14 +1,19 @@ #include <stdio.h> #include <stdlib.h> #include <time.h> +// 256 bytes = 4 * 64 = 4 * cachelines +// with 4-way associative cache one row +// traverse each set. +// With 8-way associative cache the col number +// should be doubled. +#define COLS 256 #define ROWS 1024 -#define COLS 64 #define VFL 6291456 #ifndef OFF #define OFF 0 #endif -char arr[ROWS*4][(COLS+OFF)*4] __attribute__((aligned(4096))); +char arr[ROWS][COLS+OFF*4] __attribute__((aligned(4096))); char arr2[VFL]; int main() { |
