diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:03:15 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:03:15 +0000 |
commit | 6a34935e15a3365af18002f186fcb7846001f2cf (patch) | |
tree | 90bb3813b2e964d5e7e5c3cb42cc08f6e267240e /cpu_loads/memcpy-byte.cpp | |
parent | 7269ee2f6cd5dc99872afa3dbc3a115e268581bc (diff) | |
parent | d6f259b4285f74ed240a6392a7c2b2812ed1320f (diff) | |
download | extras-6a34935e15a3365af18002f186fcb7846001f2cf.tar.gz |
Snap for 10453563 from d6f259b4285f74ed240a6392a7c2b2812ed1320f to mainline-media-releaseaml_med_340922010
Change-Id: Iafe5b7b811e55a445813e97b6c22cd38a48abf78
Diffstat (limited to 'cpu_loads/memcpy-byte.cpp')
-rw-r--r-- | cpu_loads/memcpy-byte.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cpu_loads/memcpy-byte.cpp b/cpu_loads/memcpy-byte.cpp new file mode 100644 index 00000000..70293cb6 --- /dev/null +++ b/cpu_loads/memcpy-byte.cpp @@ -0,0 +1,33 @@ +#include <arpa/inet.h> +#include <cutils/sockets.h> +#include <fcntl.h> +#include <hardware/gralloc.h> +#include <sys/stat.h> +#include <sys/wait.h> +#include <unistd.h> +#include <algorithm> +#include <chrono> +#include <fstream> +#include <iostream> +#include <numeric> +#include <string> +#include <tuple> +#include <vector> + +using namespace std; + +#define BUFFER_SIZE (1024 * 1024 * 1024) + +int main(int, char**) { + volatile void* src = malloc(BUFFER_SIZE); + for (size_t i = 0; i < BUFFER_SIZE; i++) { + ((char*)src)[i] = (char)i; + } + volatile void* dst = malloc(BUFFER_SIZE); + while (true) { + for (size_t i = 0; i < BUFFER_SIZE; i++) { + ((char*)dst)[i] = ((char*)src)[i]; + } + } + return 0; +} |