diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-06-17 21:14:09 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-06-17 21:14:09 +0200 |
commit | 8a59e1d17a83e4744071dfa790db974c296c206e (patch) | |
tree | 935fed6d263103b2249286d5fcd9b28470e45317 /kernels.cu | |
parent | a6f3e96f2cafc183ab29e53007a86bb968d654b8 (diff) | |
download | gdrtest-8a59e1d17a83e4744071dfa790db974c296c206e.tar.gz gdrtest-8a59e1d17a83e4744071dfa790db974c296c206e.tar.bz2 gdrtest-8a59e1d17a83e4744071dfa790db974c296c206e.tar.xz gdrtest-8a59e1d17a83e4744071dfa790db974c296c206e.zip |
Diffstat (limited to 'kernels.cu')
-rw-r--r-- | kernels.cu | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -7,6 +7,24 @@ __global__ void null(uint32_t *data) { } +__global__ void feedback(volatile void *bar, uint32_t *data) { + WR32 (REG_PERF_COUNTER, 1); +} + +__global__ void measure(int iter, volatile void *bar, uint64_t bus_addr, uint64_t *res, uint32_t *data) { + // Clocks are incorrect as not running while waiting. + //res[iter] = clock64(); + // Thats does not work either (no RD support in kernels?) + //res[iter] = RD32(REG_PERF_COUNTER); + + WR64 (REG_DESCRIPTOR_ADDRESS, bus_addr); + + if ((iter + 1) == GPU_ITERS) { + WR32 (REG_PERF_COUNTER, 1); + } +} + + __device__ void ksleep(uint32_t clocks) { clock_t start = clock64(), now; |