From 33ec643d9f3363d62e9c26f0e5c70f5e8cfd6c79 Mon Sep 17 00:00:00 2001 From: haoliang Date: Thu, 21 Dec 2023 19:25:59 -0500 Subject: [PATCH 1/2] [workload-xsave]Bug Fix 1.Modify u_int8_t to uint8_t. Signed-off-by: Haoliang Zhu --- README.md | 2 +- workload-xsave/work_AVX2.c | 2 +- workload-xsave/work_AVX512.c | 2 +- workload-xsave/work_DOTPROD.c | 2 +- workload-xsave/work_VNNI.c | 2 +- workload-xsave/work_VNNI512.c | 2 +- workload-xsave/worker_init_avx2.c | 2 +- workload-xsave/worker_init_dotprod.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ab04af63..e73574a4 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ dpkg -i linux-xxx-dev_TARGET_VERSION.deb dpkg -i linux-xxx-tools_TARGET_VERSION.deb Boot up with target kernel version. -cd cet_driver +cd cet/cet_driver make ``` diff --git a/workload-xsave/work_AVX2.c b/workload-xsave/work_AVX2.c index 4f237d56..20f44d38 100644 --- a/workload-xsave/work_AVX2.c +++ b/workload-xsave/work_AVX2.c @@ -26,7 +26,7 @@ #pragma GCC optimize("unroll-loops") struct thread_data { - u_int8_t *input_x; + uint8_t *input_x; int8_t *input_y; int16_t *output; int data_entries; diff --git a/workload-xsave/work_AVX512.c b/workload-xsave/work_AVX512.c index 63542e4b..f7884bd4 100644 --- a/workload-xsave/work_AVX512.c +++ b/workload-xsave/work_AVX512.c @@ -29,7 +29,7 @@ #pragma GCC optimize("unroll-loops") struct thread_data { - u_int8_t *input_x; + uint8_t *input_x; int8_t *input_y; int32_t *input_z; int16_t *input_ones; diff --git a/workload-xsave/work_DOTPROD.c b/workload-xsave/work_DOTPROD.c index 15a186b1..10b25564 100644 --- a/workload-xsave/work_DOTPROD.c +++ b/workload-xsave/work_DOTPROD.c @@ -22,7 +22,7 @@ #pragma GCC optimize("unroll-loops") struct thread_data { - u_int8_t *input_x; + uint8_t *input_x; int8_t *input_y; int32_t *input_z; int16_t *input_ones; diff --git a/workload-xsave/work_VNNI.c b/workload-xsave/work_VNNI.c index 4ccf0ec7..1af32055 100644 --- a/workload-xsave/work_VNNI.c +++ b/workload-xsave/work_VNNI.c @@ -27,7 +27,7 @@ #pragma GCC optimize("unroll-loops") struct thread_data { - u_int8_t *input_x; + uint8_t *input_x; int8_t *input_y; int32_t *input_z; int16_t *input_ones; diff --git a/workload-xsave/work_VNNI512.c b/workload-xsave/work_VNNI512.c index 1849da85..4d123b01 100644 --- a/workload-xsave/work_VNNI512.c +++ b/workload-xsave/work_VNNI512.c @@ -24,7 +24,7 @@ #pragma GCC optimize("unroll-loops") struct thread_data { - u_int8_t *input_x; + uint8_t *input_x; int8_t *input_y; int32_t *input_z; int16_t *input_ones; diff --git a/workload-xsave/worker_init_avx2.c b/workload-xsave/worker_init_avx2.c index 03c02171..e3eaac50 100644 --- a/workload-xsave/worker_init_avx2.c +++ b/workload-xsave/worker_init_avx2.c @@ -17,7 +17,7 @@ static int init(struct work_instance *wi) if (!dp) err(1, "thread_data"); - dp->input_x = (u_int8_t *)calloc(entries, BYTES_PER_VECTOR); + dp->input_x = (uint8_t *)calloc(entries, BYTES_PER_VECTOR); if (!dp->input_x) err(1, "calloc input_x"); diff --git a/workload-xsave/worker_init_dotprod.c b/workload-xsave/worker_init_dotprod.c index 1810870a..2981bc53 100644 --- a/workload-xsave/worker_init_dotprod.c +++ b/workload-xsave/worker_init_dotprod.c @@ -17,7 +17,7 @@ static int init(struct work_instance *wi) if (!dp) err(1, "thread_data"); - dp->input_x = (u_int8_t *)calloc(entries, BYTES_PER_VECTOR); + dp->input_x = (uint8_t *)calloc(entries, BYTES_PER_VECTOR); if (!dp->input_x) err(1, "calloc input_x"); From 6aafbc8d3a00a056f855c0659954ae4191febadb Mon Sep 17 00:00:00 2001 From: haoliang Date: Thu, 28 Dec 2023 03:48:37 -0500 Subject: [PATCH 2/2] [workload-xsave]Supplementary header file 1.Missing uint8_t header file. 2.Supplement useage information. Signed-off-by: Haoliang Zhu --- workload-xsave/work_AVX2.c | 1 + workload-xsave/work_AVX512.c | 1 + workload-xsave/work_DOTPROD.c | 1 + workload-xsave/work_VNNI.c | 1 + workload-xsave/work_VNNI512.c | 1 + workload-xsave/worker_init_avx2.c | 4 +++- workload-xsave/worker_init_dotprod.c | 2 +- workload-xsave/yogini.c | 10 ++++++---- 8 files changed, 15 insertions(+), 6 deletions(-) diff --git a/workload-xsave/work_AVX2.c b/workload-xsave/work_AVX2.c index 20f44d38..051ac78a 100644 --- a/workload-xsave/work_AVX2.c +++ b/workload-xsave/work_AVX2.c @@ -14,6 +14,7 @@ #include /* CPU_SET */ #include "yogini.h" #include +#include #include #pragma GCC target("avx2,fma") diff --git a/workload-xsave/work_AVX512.c b/workload-xsave/work_AVX512.c index f7884bd4..3f2092fa 100644 --- a/workload-xsave/work_AVX512.c +++ b/workload-xsave/work_AVX512.c @@ -15,6 +15,7 @@ #include /* CPU_SET */ #include "yogini.h" #include +#include #include #if __GNUC__ >= 11 diff --git a/workload-xsave/work_DOTPROD.c b/workload-xsave/work_DOTPROD.c index 10b25564..b3abac7a 100644 --- a/workload-xsave/work_DOTPROD.c +++ b/workload-xsave/work_DOTPROD.c @@ -10,6 +10,7 @@ #include /* CPU_SET */ #include "yogini.h" #include +#include #include #pragma GCC target("avx2,fma") diff --git a/workload-xsave/work_VNNI.c b/workload-xsave/work_VNNI.c index 1af32055..8051a53d 100644 --- a/workload-xsave/work_VNNI.c +++ b/workload-xsave/work_VNNI.c @@ -13,6 +13,7 @@ #include /* CPU_SET */ #include "yogini.h" #include +#include #include #if __GNUC__ >= 11 diff --git a/workload-xsave/work_VNNI512.c b/workload-xsave/work_VNNI512.c index 4d123b01..55e8d5a7 100644 --- a/workload-xsave/work_VNNI512.c +++ b/workload-xsave/work_VNNI512.c @@ -10,6 +10,7 @@ #include /* CPU_SET */ #include "yogini.h" #include +#include #include #if __GNUC__ >= 9 diff --git a/workload-xsave/worker_init_avx2.c b/workload-xsave/worker_init_avx2.c index e3eaac50..6449ca3b 100644 --- a/workload-xsave/worker_init_avx2.c +++ b/workload-xsave/worker_init_avx2.c @@ -3,7 +3,9 @@ * Copyright (c) 2022 Intel Corporation. * Len Brown */ - +#include +#include +#include static int init(struct work_instance *wi) { int i; diff --git a/workload-xsave/worker_init_dotprod.c b/workload-xsave/worker_init_dotprod.c index 2981bc53..537489a5 100644 --- a/workload-xsave/worker_init_dotprod.c +++ b/workload-xsave/worker_init_dotprod.c @@ -3,7 +3,7 @@ * Copyright (c) 2022 Intel Corporation. * Len Brown */ - +#include static int init(struct work_instance *wi) { int i; diff --git a/workload-xsave/yogini.c b/workload-xsave/yogini.c index 8d49e680..3e693dbc 100644 --- a/workload-xsave/yogini.c +++ b/workload-xsave/yogini.c @@ -264,12 +264,12 @@ static void cmdline(int argc, char **argv) progname = argv[0]; + if (argc == 1) + help(); + while ((opt = getopt_long_only(argc, argv, "h:w:r:b:f", - long_options, &option_index)) != -1) { + long_options, &option_index)) != -1) { switch (opt) { - case 'h': - help(); - break; case 'w': if (parse_work_cmd(optarg)) help(); @@ -284,6 +284,8 @@ static void cmdline(int argc, char **argv) case 'f': clfulsh = 1; break; + case '?': + case 'h': default: help(); }