PAPI 7.1.0.0
Loading...
Searching...
No Matches
timing_kernels.h
Go to the documentation of this file.
1#ifndef _TIMING_KERNELS_
2#define _TIMING_KERNELS_
3
4#include <stdint.h>
5
6#include "caches.h"
7
8#define N_1 p = (uintptr_t *)*p;
9#define N_2 N_1 N_1
10#define N_16 N_2 N_2 N_2 N_2 N_2 N_2 N_2 N_2
11#define N_128 N_16 N_16 N_16 N_16 N_16 N_16 N_16 N_16
12
13// NW_1 reads a pointer from an array and then modifies the pointer
14// and stores it back to the same place in the array. This way it
15// causes exactly one read and one write operation in memory, assuming
16// that the variable "p_prime" resides in a register. The exact steps
17// are the following:
18// 1. Reads the element pointed to by "p" into "p_prime".
19// This element is almost a pointer to the next element in the chain, but the least significant bit might be set to 1.
20// 2. Flip the least significant bit of "p_prime" and store it back into the buffer.
21// 3. Clear the least significant bit of "p_prime" and store the result in "p".
22#define NW_1 {p_prime = *p; *p = p_prime ^ 0x1; p = (uintptr_t *)(p_prime & (~0x1));}
23#define NW_2 NW_1 NW_1
24#define NW_16 NW_2 NW_2 NW_2 NW_2 NW_2 NW_2 NW_2 NW_2
25#define NW_128 NW_16 NW_16 NW_16 NW_16 NW_16 NW_16 NW_16 NW_16
26
27#define CACHE_READ_ONLY 0x0
28#define CACHE_READ_WRITE 0x1
29
30run_output_t probeBufferSize(long long active_buf_len, long long line_size, float pageCountPerBlock, int pattern, uintptr_t **v, uintptr_t *rslt, int detect_size, int mode, int ONT);
31void error_handler(int e, int line);
32
33#endif
run_output_t probeBufferSize(long long active_buf_len, long long line_size, float pageCountPerBlock, int pattern, uintptr_t **v, uintptr_t *rslt, int detect_size, int mode, int ONT)
void error_handler(int e, int line)