[Mesa-dev] [PATCH shader-db 1/4] run: add -j option to select number of threads
Matt Turner
mattst88 at gmail.com
Thu Feb 16 14:33:18 UTC 2017
On Thu, Feb 16, 2017 at 4:29 AM, Lionel Landwerlin
<lionel.g.landwerlin at intel.com> wrote:
> 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) {
Would you mind fixing the lack of a space between while and ( while
you're modifying this line?
> 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;
I would not be opposed to deleting the -1 argument at the same time.
> --
> 2.11.0
>
More information about the mesa-dev
mailing list