From 742575cffc5059358448b09050b315242f62376a Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 29 Sep 2024 22:37:10 +0000 Subject: [PATCH 1/2] added option to switch GPU for cuda benchmark --- mixbench-cuda/main-cuda.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/mixbench-cuda/main-cuda.cpp b/mixbench-cuda/main-cuda.cpp index 3db09c8..d3d98dc 100644 --- a/mixbench-cuda/main-cuda.cpp +++ b/mixbench-cuda/main-cuda.cpp @@ -15,12 +15,45 @@ #define VECTOR_SIZE (32 * 1024 * 1024) +void print_usage(const char* program_name) { + printf("Usage: %s [--gpu ]\n", program_name); + printf("Options:\n"); + printf(" --gpu Specify the GPU ID to use (default: 0)\n"); +} + int main(int argc, char* argv[]) { printf("mixbench (%s)\n", VERSION_INFO); + int gpu_id = 0; + int i; + for (i=1;i Date: Sun, 29 Sep 2024 22:41:52 +0000 Subject: [PATCH 2/2] update readme --- mixbench-cuda/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mixbench-cuda/README.md b/mixbench-cuda/README.md index 47060a7..8b2b733 100644 --- a/mixbench-cuda/README.md +++ b/mixbench-cuda/README.md @@ -6,3 +6,11 @@ It is actually the original implementation of this benchmark. ## Building notes Building should be straightforward by using the respective `CMakeList.txt` file. + + +## Usage + +Use `--gpu` option to select which GPU to benchmark (otherwise defaults to 0), e.g.: +```bash +./mixbench-cuda --gpu 2 +``` \ No newline at end of file