diff options
author | Suren A. Chilingaryan <csa@ipepdvdev1.ipe.kit.edu> | 2016-05-19 19:48:24 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@ipepdvdev1.ipe.kit.edu> | 2016-05-19 19:48:24 +0200 |
commit | 16e0aeeed527f8452e336685f664d7aa848702d3 (patch) | |
tree | 7d22cb7f5bee5d4e37e374adf80706715efa36ed /kernels.cu | |
download | gdrtest-16e0aeeed527f8452e336685f664d7aa848702d3.tar.gz gdrtest-16e0aeeed527f8452e336685f664d7aa848702d3.tar.bz2 gdrtest-16e0aeeed527f8452e336685f664d7aa848702d3.tar.xz gdrtest-16e0aeeed527f8452e336685f664d7aa848702d3.zip |
First test
Diffstat (limited to 'kernels.cu')
-rw-r--r-- | kernels.cu | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/kernels.cu b/kernels.cu new file mode 100644 index 0000000..341bb59 --- /dev/null +++ b/kernels.cu @@ -0,0 +1,48 @@ +#include <cuda.h> +#include <stdint.h> + +#include "config.h" +#include "ipedma.h" + +__global__ void null(uint32_t *data) { +} + + +__global__ void ipedma(volatile void *bar, uintptr_t bus_addr, volatile uint64_t *desc, uint32_t *data) { + int i; + clock_t sum = 0, sumk = 0, t1, t2, t3; + + for (i = 0; i < GPU_ITERS; i++) { + long wait = 0; + + desc[1] = 0; + + t1 = clock64(); + WR64 (REG_DESCRIPTOR_ADDRESS, bus_addr); + + do { + if (++wait > 0x10000) break; + } while (desc[1] == 0); + + t2 = clock64(); + + null<<<1,1>>>(data); + cudaDeviceSynchronize(); + t3 = clock64(); + + sum += t2 - t1; + sumk += t3 - t1; + } + + data[0] = sum / GPU_ITERS; + data[1] = sumk / GPU_ITERS; +} + + + + +/* +__global__ void do_leet (int *rin) { + *rin = 0x1337; +} +*/ |