[Mesa-dev] [PATCH v2] run: add -j option to select number of threads

Lionel Landwerlin lionel.g.landwerlin at intel.com
Fri Feb 17 11:37:27 UTC 2017


v2: Also drop the '-1' in favor of '-j1' (Matt)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 run.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/run.c b/run.c
index 2654bff..0e77926 100644
--- a/run.c
+++ b/run.c
@@ -307,9 +307,7 @@ const struct platform platforms[] = {
 void print_usage(const char *prog_name)
 {
     fprintf(stderr,
-            "Usage: %s [-d <device>] [-p <platform>] <directories and *.shader_test files>\n"
-            "Other options: \n"
-            " -1    Disable multi-threading\n",
+            "Usage: %s [-d <device>] [-j <max_threads>] [-p <platform>] <directories and *.shader_test files>\n",
             prog_name);
 }

@@ -335,7 +333,7 @@ main(int argc, char **argv)

     max_threads = omp_get_max_threads();

-    while((opt = getopt(argc, argv, "1d:p:")) != -1) {
+    while ((opt = getopt(argc, argv, "d:j:p:")) != -1) {
         switch(opt) {
         case 'd': {
             char *endptr;
@@ -368,8 +366,8 @@ main(int argc, char **argv)
             setenv("INTEL_DEVID_OVERRIDE", platform->pci_id, 1);
             break;
         }
-        case '1':
-            max_threads = 1;
+        case 'j':
+            max_threads = atoi(optarg);
             break;
         default:
             fprintf(stderr, "Unknown option: %x\n", opt);
--
2.7.4


More information about the mesa-dev mailing list