Required tools for playing around with memory:
hexdumpobjdumpreadelfxxdgcore
| adb -s [device] shell input keyevent 4 |
| #include <stdio.h> | |
| #include <cuda_runtime.h> | |
| #include "helper_cuda.h" | |
| /* A very simple kernel function */ | |
| __global__ void kernel(int *d_var) { d_var[threadIdx.x] += 10; } | |
| int * host_p; | |
| int * host_result; | |
| int * dev_p; |
| /* please refer better example: https://github.com/dvdhrm/docs/tree/master/drm-howto/ */ | |
| #define _XOPEN_SOURCE 600 | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/mman.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <xf86drm.h> |
| # Assuming an Ubuntu Docker image | |
| $ docker run -it <image> /bin/bash |
| #include <sys/mman.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <cuda_runtime.h> | |
| #include <cerrno> | |
| #include <cstring> | |
| #include <memory> | |
| #include <stdexcept> |
| // Sample custom iterator. | |
| // By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558) | |
| // From: http://www.dreamincode.net/forums/index.php?showtopic=58468 | |
| #include <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <iterator> | |
| #include <cassert> |