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 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