[Mesa-dev] [PATCH shader-db 1/4] run: add -j option to select number of threads

Lionel Landwerlin lionel.g.landwerlin at intel.com
Thu Feb 16 12:29:48 UTC 2017


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

diff --git a/run.c b/run.c
index 2654bff..d2ec8c6 100644
--- a/run.c
+++ b/run.c
@@ -307,7 +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"
+            "Usage: %s [-d <device>] [-j <max_threads>] [-p <platform>] <directories and *.shader_test files>\n"
             "Other options: \n"
             " -1    Disable multi-threading\n",
             prog_name);
@@ -335,7 +335,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, "1d:j:p:")) != -1) {
         switch(opt) {
         case 'd': {
             char *endptr;
@@ -368,6 +368,9 @@ main(int argc, char **argv)
             setenv("INTEL_DEVID_OVERRIDE", platform->pci_id, 1);
             break;
         }
+        case 'j':
+            max_threads = atoi(optarg);
+            break;
         case '1':
             max_threads = 1;
             break;
-- 
2.11.0



More information about the mesa-dev mailing list