From a073f2bffdef11b99db9a07b540f9a01d2d376b0 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 09:19:51 -0600 Subject: [PATCH 01/11] updating copyright year in top-level license file Signed-off-by: Karl W. Schulz --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 5477049050..057656b358 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From c8fc8e80267460a932e2879536a6fc1c4df77f78 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 09:26:12 -0600 Subject: [PATCH 02/11] adding license delimiters to headers Signed-off-by: Karl W. Schulz --- cmake/Dockerfile | 4 ++-- cmake/rocm_install.sh | 6 +++--- src/common.py | 4 ++-- src/omniperf | 4 ++-- src/omniperf_analyze/convertor/mongodb/convert | 4 ++-- src/omniperf_analyze/convertor/sql/convertor.py | 4 ++-- src/omniperf_analyze/omniperf_analyze.py | 4 ++-- src/omniperf_analyze/tests/unit/ast_parser_tester.py | 4 ++-- src/omniperf_analyze/utils/file_io.py | 4 ++-- src/omniperf_analyze/utils/gui.py | 4 ++-- src/omniperf_analyze/utils/gui_components/header.py | 4 ++-- src/omniperf_analyze/utils/gui_components/memchart.py | 4 ++-- src/omniperf_analyze/utils/gui_components/roofline.py | 4 ++-- src/omniperf_analyze/utils/parser.py | 4 ++-- src/omniperf_analyze/utils/roofline_calc.py | 4 ++-- src/omniperf_analyze/utils/schema.py | 4 ++-- src/omniperf_analyze/utils/tty.py | 4 ++-- src/parser.py | 4 ++-- src/utils/csv_converter.py | 4 ++-- src/utils/gfx_perfmon_builder.py | 4 ++-- src/utils/perfagg.py | 4 ++-- src/utils/remove_workload.py | 4 ++-- src/utils/resources.py | 4 ++-- src/utils/specs.py | 4 ++-- 24 files changed, 49 insertions(+), 49 deletions(-) diff --git a/cmake/Dockerfile b/cmake/Dockerfile index f95e18d4d0..d216fd23ab 100644 --- a/cmake/Dockerfile +++ b/cmake/Dockerfile @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el FROM ubuntu:20.04 diff --git a/cmake/rocm_install.sh b/cmake/rocm_install.sh index 8ac34caad5..c550c3e2fa 100755 --- a/cmake/rocm_install.sh +++ b/cmake/rocm_install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el declare -a rocm_versions=("4.3.1" "4.5.2" "5.0.2" "5.1.3" "5.2.3") wget https://repo.radeon.com/amdgpu-install/22.10/ubuntu/focal/amdgpu-install_22.10.50100-1_all.deb @@ -29,4 +29,4 @@ for rocm_version in ${rocm_versions[@]}; do echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/$rocm_version ubuntu main" | tee /etc/apt/sources.list.d/rocm.list apt update amdgpu-install -y --usecase=rocm --rocmrelease=$rocm_version --no-dkms -done \ No newline at end of file +done diff --git a/src/common.py b/src/common.py index 8268608b4a..30ed28c5f2 100644 --- a/src/common.py +++ b/src/common.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import os import sys diff --git a/src/omniperf b/src/omniperf index b0a6a3af9d..d27f295a20 100755 --- a/src/omniperf +++ b/src/omniperf @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import sys import os diff --git a/src/omniperf_analyze/convertor/mongodb/convert b/src/omniperf_analyze/convertor/mongodb/convert index a5676dc317..6b63033d19 100755 --- a/src/omniperf_analyze/convertor/mongodb/convert +++ b/src/omniperf_analyze/convertor/mongodb/convert @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -################################################################################ +##############################################################################bl # Copyright (C) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import ast import astunparse diff --git a/src/omniperf_analyze/convertor/sql/convertor.py b/src/omniperf_analyze/convertor/sql/convertor.py index dba816948a..28de3b4fc4 100644 --- a/src/omniperf_analyze/convertor/sql/convertor.py +++ b/src/omniperf_analyze/convertor/sql/convertor.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -################################################################################ +##############################################################################bl # Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import re import sys diff --git a/src/omniperf_analyze/omniperf_analyze.py b/src/omniperf_analyze/omniperf_analyze.py index 5c090bc121..5a1bcba62f 100644 --- a/src/omniperf_analyze/omniperf_analyze.py +++ b/src/omniperf_analyze/omniperf_analyze.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el """ Quick run: diff --git a/src/omniperf_analyze/tests/unit/ast_parser_tester.py b/src/omniperf_analyze/tests/unit/ast_parser_tester.py index a04832e48a..573590b543 100644 --- a/src/omniperf_analyze/tests/unit/ast_parser_tester.py +++ b/src/omniperf_analyze/tests/unit/ast_parser_tester.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import ast import astunparse diff --git a/src/omniperf_analyze/utils/file_io.py b/src/omniperf_analyze/utils/file_io.py index 04539feb44..ad447b05c2 100644 --- a/src/omniperf_analyze/utils/file_io.py +++ b/src/omniperf_analyze/utils/file_io.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import os import pandas as pd diff --git a/src/omniperf_analyze/utils/gui.py b/src/omniperf_analyze/utils/gui.py index 98bc38ebcc..31e8ed61a4 100644 --- a/src/omniperf_analyze/utils/gui.py +++ b/src/omniperf_analyze/utils/gui.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el from selectors import EpollSelector import sys diff --git a/src/omniperf_analyze/utils/gui_components/header.py b/src/omniperf_analyze/utils/gui_components/header.py index ddf665d799..70fb5bcf6b 100644 --- a/src/omniperf_analyze/utils/gui_components/header.py +++ b/src/omniperf_analyze/utils/gui_components/header.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el from dash import html, dcc import dash_bootstrap_components as dbc diff --git a/src/omniperf_analyze/utils/gui_components/memchart.py b/src/omniperf_analyze/utils/gui_components/memchart.py index 8616ca9e30..2a09b21600 100644 --- a/src/omniperf_analyze/utils/gui_components/memchart.py +++ b/src/omniperf_analyze/utils/gui_components/memchart.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import sys diff --git a/src/omniperf_analyze/utils/gui_components/roofline.py b/src/omniperf_analyze/utils/gui_components/roofline.py index 89e19af132..8c74ca0b85 100644 --- a/src/omniperf_analyze/utils/gui_components/roofline.py +++ b/src/omniperf_analyze/utils/gui_components/roofline.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el from omniperf_analyze.utils import roofline_calc diff --git a/src/omniperf_analyze/utils/parser.py b/src/omniperf_analyze/utils/parser.py index f4f91f4f5a..5c94e5b4e0 100644 --- a/src/omniperf_analyze/utils/parser.py +++ b/src/omniperf_analyze/utils/parser.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import ast import sys diff --git a/src/omniperf_analyze/utils/roofline_calc.py b/src/omniperf_analyze/utils/roofline_calc.py index 7a324c3efd..12f1a63c68 100644 --- a/src/omniperf_analyze/utils/roofline_calc.py +++ b/src/omniperf_analyze/utils/roofline_calc.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import sys diff --git a/src/omniperf_analyze/utils/schema.py b/src/omniperf_analyze/utils/schema.py index 3d77eee0ac..65a2fa8413 100644 --- a/src/omniperf_analyze/utils/schema.py +++ b/src/omniperf_analyze/utils/schema.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el # # Define all common data storage classes, diff --git a/src/omniperf_analyze/utils/tty.py b/src/omniperf_analyze/utils/tty.py index 1afe8e08e8..ade1a9b37b 100644 --- a/src/omniperf_analyze/utils/tty.py +++ b/src/omniperf_analyze/utils/tty.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import pandas as pd from tabulate import tabulate diff --git a/src/parser.py b/src/parser.py index d384be8797..bce1f705f3 100644 --- a/src/parser.py +++ b/src/parser.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import os import argparse diff --git a/src/utils/csv_converter.py b/src/utils/csv_converter.py index b1e536c12f..191550b0ff 100644 --- a/src/utils/csv_converter.py +++ b/src/utils/csv_converter.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import argparse import collections diff --git a/src/utils/gfx_perfmon_builder.py b/src/utils/gfx_perfmon_builder.py index 566449c3d5..8a9623a702 100755 --- a/src/utils/gfx_perfmon_builder.py +++ b/src/utils/gfx_perfmon_builder.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el from PyQt5.QtWidgets import ( QMainWindow, diff --git a/src/utils/perfagg.py b/src/utils/perfagg.py index f40f242699..c2cdc7fdf1 100755 --- a/src/utils/perfagg.py +++ b/src/utils/perfagg.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import sys, os, pathlib, shutil, subprocess, argparse, glob, re import numpy as np diff --git a/src/utils/remove_workload.py b/src/utils/remove_workload.py index 11cb5df256..6627b64051 100755 --- a/src/utils/remove_workload.py +++ b/src/utils/remove_workload.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import argparse import getpass diff --git a/src/utils/resources.py b/src/utils/resources.py index fce329d13d..5408a90ab7 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -1,4 +1,4 @@ -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,7 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import pathlib import sys diff --git a/src/utils/specs.py b/src/utils/specs.py index 4c95194406..b385c9d053 100644 --- a/src/utils/specs.py +++ b/src/utils/specs.py @@ -1,6 +1,6 @@ """Get host/gpu specs.""" -################################################################################ +##############################################################################bl # Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,7 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -################################################################################ +##############################################################################el import os import re From e6caaef5ecd0f25024bddfa4a09e8a736757ff6f Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 13:34:24 -0600 Subject: [PATCH 03/11] adding a "license" target in build system to update headers in relevant source code files Signed-off-by: Karl W. Schulz --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff2df00a4a..724d37f0d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,6 +292,18 @@ install( # set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "omniperf") set(CPACK_RESOURCE_FILE_LICENSE # "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +# License header update(s) +add_custom_target( + license + COMMAND + ${PROJECT_SOURCE_DIR}/utils/update_license.py --source ${PROJECT_SOURCE_DIR}/src + --license ${PROJECT_SOURCE_DIR}/LICENSE --extension '.py' + COMMAND + ${PROJECT_SOURCE_DIR}/utils/update_license.py --source ${PROJECT_SOURCE_DIR} + --license ${PROJECT_SOURCE_DIR}/LICENSE --file + "src/omniperf,cmake/Dockerfile,cmake/rocm_install.sh,docker/docker-entrypoint.sh,src/omniperf_analyze/convertor/mongodb/convert" + ) + # Source tarball set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CMAKE_PROJECT_NAME}-${FULL_VERSION_STRING}) From 005de9e506ef5eb4bb2122730cc441c6511073e9 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 13:38:32 -0600 Subject: [PATCH 04/11] adding a license header utility: looks for specific delimiter and replaces contents inside the delimiter with provided license file Signed-off-by: Karl W. Schulz --- utils/update_license.py | 133 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100755 utils/update_license.py diff --git a/utils/update_license.py b/utils/update_license.py new file mode 100755 index 0000000000..db87d7cb30 --- /dev/null +++ b/utils/update_license.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +# ------------------------------------------------------------------------------- +# Support script for license header management. +# ------------------------------------------------------------------------------- + +import argparse +import logging +import glob +import os +import sys +import re +import filecmp +import shutil + +begDelim='######bl$' +endDelim='######el$' +maxHeaderLines=200 + + +def cacheLicenseFile(infile,comment='#'): + if not os.path.isfile(infile): + logging.error("Unable to access license file - >%s" % infile) + sys.exit(1) + + license = "" + with open(infile, 'r') as file_in: + for line in file_in: + license += comment + ' ' + line + return(license) + + +parser = argparse.ArgumentParser() +parser.add_argument('--license', required=True,help='License File') +parser.add_argument('--source', required=True,help='Source directory') +parser.add_argument("--dryrun", help="enable dryrun mode", action="store_true") + +group = parser.add_mutually_exclusive_group(required=True) +group.add_argument('--extension',help='file extension to parse') +group.add_argument('--files', help='specific file(s) to parse') + +logging.basicConfig(format='%(levelname)s: %(message)s',level=logging.INFO) + +args = parser.parse_args() + +srcDir = args.source +fileExtension = None +specificFiles = None +if args.extension: + fileExtension = args.extension +if args.files: + specificFiles = args.files.split(",") + +print("") +logging.info("Source directory = %s" % srcDir) +if fileExtension: + logging.info("File extension = %s" % fileExtension) +if specificFiles: + logging.info("Specific files = %s" % specificFiles) + +# cache license file +license = cacheLicenseFile(args.license) + +# Scan files in provided source directory... +for filename in glob.iglob(srcDir + '/**', recursive=True): + # skip directories + if os.path.isdir(filename): + continue + + # File matching options: + + # (1) filter non-matching extensions + if fileExtension: + if not filename.endswith(fileExtension): + continue + + # or, (2) filter for specific filename + if specificFiles: + found = False + for file in specificFiles: + fullPath = os.path.join(srcDir,file) + if fullPath == filename: + found = True + break + if not found: + continue + + logging.debug("Examining %s for license..." % filename) + + # Update license header contents if delimiters are found + with open(filename, 'r') as file_in: + baseName = os.path.basename(filename) + dirName = os.path.dirname(filename) + tmpFile = dirName + "/." + baseName + ".tmp" + + file_out = open(tmpFile,'w') + + for line in file_in: + + if re.search(begDelim,line): + logging.debug("Found beginning delimiter") + file_out.write(line) + file_out.write(license) + + foundEnd = False + + for i in range(maxHeaderLines): + line = file_in.readline() + if re.search(endDelim,line): + logging.debug("Found ending delimiter") + file_out.write(line) + foundEnd = True + break + if not foundEnd: + logging.error("Unable to find end of delimited header") + sys.exit(1) + + else: + file_out.write(line) + + file_out.close() + + + # Check if file changed and update + if not filecmp.cmp(filename,tmpFile,shallow=False): + logging.info("%s changed" % filename) + shutil.copystat(filename,tmpFile) + if not args.dryrun: + os.rename(tmpFile,filename) + else: + os.unlink(tmpFile) + + + From e79391aabe6c2ad555899dcd21ebcf475054da28 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 13:45:21 -0600 Subject: [PATCH 05/11] ran dos2unix Signed-off-by: Karl W. Schulz --- src/utils/gfx_perfmon_builder.py | 788 +++++++++++++++---------------- 1 file changed, 394 insertions(+), 394 deletions(-) diff --git a/src/utils/gfx_perfmon_builder.py b/src/utils/gfx_perfmon_builder.py index 8a9623a702..ac26df682d 100755 --- a/src/utils/gfx_perfmon_builder.py +++ b/src/utils/gfx_perfmon_builder.py @@ -1,394 +1,394 @@ -##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -##############################################################################el - -from PyQt5.QtWidgets import ( - QMainWindow, - QApplication, - QTreeView, - QTableWidget, - QTableWidgetItem, -) -from PyQt5.QtWidgets import ( - QHBoxLayout, - QWidget, - QAction, - QFileDialog, - QAbstractItemView, - qApp, -) -from PyQt5.QtGui import QStandardItemModel, QStandardItem -from lxml import html -import sys - - -# class view(QWidget): -class mainWindow(QMainWindow): - def __init__(self): - super(QMainWindow, self).__init__() - - ############################################################################### - # SOC Parameters - ############################################################################## - - # Per IP block max number of simulutaneous counters - # GFX IP Blocks - self.perfmon_config = { - "SQ": 8, - "TA": 2, - "TD": 2, - "TCP": 4, - "TCC": 4, - "CPC": 2, - "CPF": 2, - "SPI": 2, - "GRBM": 2, - "GDS": 4, - } - - # GFX Architectures - self.soc_arch_list = ["gfx906", "gfx908", "gfx90a"] - - ############################################################################### - # Window layout Design - ############################################################################## - - self.block_list = [] - self.nodes_dict = {} # list of QStandardItem - - self.tree = QTreeView(self) - self.table = QTableWidget() - - # Tree setup - self.tree.header().setDefaultSectionSize(180) - self.model = QStandardItemModel() - self.model.setHorizontalHeaderLabels(["Metric", "Block", "Event", "Definition"]) - - self.tree.setModel(self.model) - # self.importData(data) - self.tree.setEditTriggers(QAbstractItemView.NoEditTriggers) - - # Set up click processing - self.tree.clicked.connect(self.pmc_select) - # self.tree.expandAll() - - # Table setup - tableHeader = list(self.perfmon_config.keys()) - self.table.setColumnCount(len(tableHeader)) - self.table.setHorizontalHeaderLabels(tableHeader) - self.table.setEditTriggers(QAbstractItemView.NoEditTriggers) - self.table.showGrid() - - self.setWindowTitle("GFX Perfmon Builder") - # layout: lhs: metrics; rhs: selected perfmon - layout = QHBoxLayout(self) - layout.addWidget(self.tree) - layout.addWidget(self.table) - - widget = QWidget() - widget.setLayout(layout) - self.setCentralWidget(widget) - - # Add Status - self.statusBar() - - ############################################################################### - # Window Menu Design - ############################################################################## - - # Setup file menu - menuBar = self.menuBar() - menuBar.setNativeMenuBar(False) - - openAction = QAction("&Open", self) - openAction.setShortcut("Ctrl+O") - openAction.setStatusTip("Open GFX Metrics file") - openAction.triggered.connect(self.openGFXDialog) - - saveAction = QAction("&Save", self) - saveAction.setShortcut("Ctrl+S") - saveAction.setStatusTip("Save to PMC file") - saveAction.triggered.connect(self.exportGFXDialog) - - exitAction = QAction("&Exit", self) - exitAction.setShortcut("Ctrl+Q") - exitAction.setStatusTip("Exit") - exitAction.triggered.connect(self.close) - - # Create new action - fileMenu = menuBar.addMenu("&File") - fileMenu.addActions([openAction, saveAction]) - fileMenu.addSeparator() - fileMenu.addActions([exitAction]) - - def openGFXDialog(self): - options = QFileDialog.Options() - options |= QFileDialog.DontUseNativeDialog - fileName, _ = QFileDialog.getOpenFileName( - self, "Open GFX Metrics", "", "XML Files (*.xml)", "XML(*.xml)" - ) - - # Parse the xml - if fileName: - xmlparsed = html.parse(fileName) - self.importData(xmlparsed) - - def exportGFXDialog(self): - options = QFileDialog.Options() - options |= QFileDialog.DontUseNativeDialog - fileName, _ = QFileDialog.getSaveFileName( - self, "Export PMC Counters", "", "Text File (*.txt)", "Text File(*.txt)" - ) - - # Parse the xml - if fileName: - self.exportPMCCounters(fileName) - - def exportPMCCounters(self, fileName): - f = open(fileName, "w") - - total_IP_blocks = len(list(self.perfmon_config.keys())) - for row in range(self.table.rowCount()): - pmc_str = "pmc: " - for col in range(total_IP_blocks): - cell = self.table.item(row, col) - - if cell: - pmc_str = pmc_str + " ".join(cell.text().split("\n")) + " " - - f.write(pmc_str + "\n") - - # Add standard lines - f.write("\n\n") - f.write("gpu: \n") - f.write("dispatch: \n") - f.write("kernel: \n") - - f.close() - - return - - def pmc_metric_selected(self, metric_name, col): - # check if the metric already exists - metric_selected = False - - for row in range(self.table.rowCount()): - entry = self.table.item(row, col) - if entry: - pmc_list = entry.text().split(sep="\n") - if metric_name in pmc_list: - metric_selected = True - break - - return metric_selected - - def pmc_remove_metric(self, metric_name, IP_block): - # Remove the metric to pmc table, if it is selected - - # Map SQC to SQ, since they share the same Perfmon block - if IP_block == "SQC": - IP_block = "SQ" - - # not action if it is for a ghost IP! - if not IP_block in list(self.perfmon_config.keys()): - return - - # This is the column we need to add/remove perfmon counters - col = list(self.perfmon_config.keys()).index(IP_block) - - if not self.pmc_metric_selected(metric_name, col): - return - - pmc_list = [] - for row in range(self.table.rowCount()): - entry = self.table.item(row, col) - - if entry: - pmc_list = pmc_list + entry.text().split(sep="\n") - # clear the cell, we will re-allocate the pmc - - self.table.takeItem(row, col) - - # allowed PMC counters per batch - max_pmc_num = self.perfmon_config[IP_block] - - # remote this metric and re-segment the list and refill all rows in this column - pmc_list.remove(metric_name) - - # We are empty now, do nothing - if len(pmc_list) == 0: - return - - for row in range((len(pmc_list) + max_pmc_num - 1) // max_pmc_num): - start_index = row * max_pmc_num - pmc_str = "\n".join(pmc_list[start_index : start_index + max_pmc_num]) - self.table.setItem(row, col, QTableWidgetItem(pmc_str)) - - # Remove last row, if empty - last_row = self.table.rowCount() - 1 - empty_row = True - total_cols = len(list(self.perfmon_config.keys())) - for cindex in range(total_cols): - x = self.table.item(last_row, cindex) - - if x and x.text(): - empty_row = False - break - - if empty_row: - self.table.removeRow(last_row) - - def pmc_add_metric(self, metric_name, IP_block): - # Add the metric to pmc table, if not there yet - - # Map SQC to SQ, since they share the same Perfmon block - if IP_block == "SQC": - IP_block = "SQ" - - if not IP_block in list(self.perfmon_config.keys()): - return - - # This is the column we need to add/remove perfmon counters - col = list(self.perfmon_config.keys()).index(IP_block) - - # check if the metric already exists - if self.pmc_metric_selected(metric_name, col): - return - - # metric is not bucket yet, add it! - if self.table.rowCount() == 0: - # starting from scratch! - self.table.insertRow(0) - self.table.setItem(0, col, QTableWidgetItem(metric_name)) - return - - # find the row to insert - for row in range(self.table.rowCount()): - entry = self.table.item(row, col) - if not entry: - # print("search insert pos, row:", row, ", cell empty") - break - - if len(entry.text().split(sep="\n")) < self.perfmon_config[IP_block]: - # print("found") - break - - entry = self.table.item(row, col) - if not entry: - # put it into the empty cell - self.table.setItem(row, col, QTableWidgetItem(metric_name)) - return - - pmc_list = entry.text().split(sep="\n") - - if len(pmc_list) < self.perfmon_config[IP_block]: - # we still have hit per-IP HW counters limit, add it to the last row - pmc_list.append(metric_name) - pmc_str = "\n".join(pmc_list) - self.table.setItem(row, col, QTableWidgetItem(pmc_str)) - self.table.resizeRowsToContents() - else: - # Start a new row - row = row + 1 - self.table.insertRow(row) - self.table.setItem(row, col, QTableWidgetItem(metric_name)) - - def pmc_select(self, item): - metric_name = item.data() - if ( - not metric_name in self.nodes_dict - or not self.nodes_dict[metric_name].isCheckable() - ): - return - - # only proper metrics check/uncheck is processed here. - IP_block = item.data().split(sep="_")[0] - - if self.nodes_dict[metric_name].checkState() == 0: - # unselect the metric in the table if it is currently selected - self.pmc_remove_metric(metric_name, IP_block) - - elif self.nodes_dict[metric_name].checkState() == 2: - self.pmc_add_metric(metric_name, IP_block) - - # Function to save populate treeview with a dictionary - def importData(self, xmlparsed, root=None): - self.model.setRowCount(0) - if root is None: - root = self.model.invisibleRootItem() - - for x in xmlparsed.getiterator(): - # Add SoC node to Root - if x.tag in self.soc_arch_list: - parent = root - parent.appendRow([QStandardItem(x.tag)]) - self.nodes_dict[x.tag] = parent.child(parent.rowCount() - 1) - - # check all metrics in an SoC family - if x.tag == "metric" and x.getparent().tag in self.soc_arch_list: - # New IP block (e.g., SQ), detected, create a new hierarchy for the block - if not x.attrib["block"] in self.block_list: - self.block_list.append(x.attrib["block"]) - parent = self.nodes_dict[x.getparent().tag] # the SoC node - parent.appendRow( - [ - QStandardItem(x.attrib["block"]), - QStandardItem(""), - QStandardItem(""), - QStandardItem(""), - ] - ) - - # record the tree node for the block - self.nodes_dict[x.attrib["block"]] = parent.child( - parent.rowCount() - 1 - ) - - # Add metric node to the Block node - parent = self.nodes_dict[x.attrib["block"]] - metric_name = QStandardItem(x.attrib["name"]) - metric_name.setCheckable(True) - parent.appendRow( - [ - metric_name, - QStandardItem(x.attrib["block"]), - QStandardItem(x.attrib["event"]), - QStandardItem(x.attrib["descr"]), - ] - ) - - self.nodes_dict[x.attrib["name"]] = parent.child(parent.rowCount() - 1) - - -if __name__ == "__main__": - app = QApplication(sys.argv) - app.setStyle("Fusion") - - # populate the view with GFX metrics.xml - window = mainWindow() - - # show the view - window.setGeometry(300, 100, 600, 300) - # view.setWindowTitle('GFX Perfmon Counters') - window.show() - - # start the application - sys.exit(app.exec_()) +##############################################################################bl +# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +##############################################################################el + +from PyQt5.QtWidgets import ( + QMainWindow, + QApplication, + QTreeView, + QTableWidget, + QTableWidgetItem, +) +from PyQt5.QtWidgets import ( + QHBoxLayout, + QWidget, + QAction, + QFileDialog, + QAbstractItemView, + qApp, +) +from PyQt5.QtGui import QStandardItemModel, QStandardItem +from lxml import html +import sys + + +# class view(QWidget): +class mainWindow(QMainWindow): + def __init__(self): + super(QMainWindow, self).__init__() + + ############################################################################### + # SOC Parameters + ############################################################################## + + # Per IP block max number of simulutaneous counters + # GFX IP Blocks + self.perfmon_config = { + "SQ": 8, + "TA": 2, + "TD": 2, + "TCP": 4, + "TCC": 4, + "CPC": 2, + "CPF": 2, + "SPI": 2, + "GRBM": 2, + "GDS": 4, + } + + # GFX Architectures + self.soc_arch_list = ["gfx906", "gfx908", "gfx90a"] + + ############################################################################### + # Window layout Design + ############################################################################## + + self.block_list = [] + self.nodes_dict = {} # list of QStandardItem + + self.tree = QTreeView(self) + self.table = QTableWidget() + + # Tree setup + self.tree.header().setDefaultSectionSize(180) + self.model = QStandardItemModel() + self.model.setHorizontalHeaderLabels(["Metric", "Block", "Event", "Definition"]) + + self.tree.setModel(self.model) + # self.importData(data) + self.tree.setEditTriggers(QAbstractItemView.NoEditTriggers) + + # Set up click processing + self.tree.clicked.connect(self.pmc_select) + # self.tree.expandAll() + + # Table setup + tableHeader = list(self.perfmon_config.keys()) + self.table.setColumnCount(len(tableHeader)) + self.table.setHorizontalHeaderLabels(tableHeader) + self.table.setEditTriggers(QAbstractItemView.NoEditTriggers) + self.table.showGrid() + + self.setWindowTitle("GFX Perfmon Builder") + # layout: lhs: metrics; rhs: selected perfmon + layout = QHBoxLayout(self) + layout.addWidget(self.tree) + layout.addWidget(self.table) + + widget = QWidget() + widget.setLayout(layout) + self.setCentralWidget(widget) + + # Add Status + self.statusBar() + + ############################################################################### + # Window Menu Design + ############################################################################## + + # Setup file menu + menuBar = self.menuBar() + menuBar.setNativeMenuBar(False) + + openAction = QAction("&Open", self) + openAction.setShortcut("Ctrl+O") + openAction.setStatusTip("Open GFX Metrics file") + openAction.triggered.connect(self.openGFXDialog) + + saveAction = QAction("&Save", self) + saveAction.setShortcut("Ctrl+S") + saveAction.setStatusTip("Save to PMC file") + saveAction.triggered.connect(self.exportGFXDialog) + + exitAction = QAction("&Exit", self) + exitAction.setShortcut("Ctrl+Q") + exitAction.setStatusTip("Exit") + exitAction.triggered.connect(self.close) + + # Create new action + fileMenu = menuBar.addMenu("&File") + fileMenu.addActions([openAction, saveAction]) + fileMenu.addSeparator() + fileMenu.addActions([exitAction]) + + def openGFXDialog(self): + options = QFileDialog.Options() + options |= QFileDialog.DontUseNativeDialog + fileName, _ = QFileDialog.getOpenFileName( + self, "Open GFX Metrics", "", "XML Files (*.xml)", "XML(*.xml)" + ) + + # Parse the xml + if fileName: + xmlparsed = html.parse(fileName) + self.importData(xmlparsed) + + def exportGFXDialog(self): + options = QFileDialog.Options() + options |= QFileDialog.DontUseNativeDialog + fileName, _ = QFileDialog.getSaveFileName( + self, "Export PMC Counters", "", "Text File (*.txt)", "Text File(*.txt)" + ) + + # Parse the xml + if fileName: + self.exportPMCCounters(fileName) + + def exportPMCCounters(self, fileName): + f = open(fileName, "w") + + total_IP_blocks = len(list(self.perfmon_config.keys())) + for row in range(self.table.rowCount()): + pmc_str = "pmc: " + for col in range(total_IP_blocks): + cell = self.table.item(row, col) + + if cell: + pmc_str = pmc_str + " ".join(cell.text().split("\n")) + " " + + f.write(pmc_str + "\n") + + # Add standard lines + f.write("\n\n") + f.write("gpu: \n") + f.write("dispatch: \n") + f.write("kernel: \n") + + f.close() + + return + + def pmc_metric_selected(self, metric_name, col): + # check if the metric already exists + metric_selected = False + + for row in range(self.table.rowCount()): + entry = self.table.item(row, col) + if entry: + pmc_list = entry.text().split(sep="\n") + if metric_name in pmc_list: + metric_selected = True + break + + return metric_selected + + def pmc_remove_metric(self, metric_name, IP_block): + # Remove the metric to pmc table, if it is selected + + # Map SQC to SQ, since they share the same Perfmon block + if IP_block == "SQC": + IP_block = "SQ" + + # not action if it is for a ghost IP! + if not IP_block in list(self.perfmon_config.keys()): + return + + # This is the column we need to add/remove perfmon counters + col = list(self.perfmon_config.keys()).index(IP_block) + + if not self.pmc_metric_selected(metric_name, col): + return + + pmc_list = [] + for row in range(self.table.rowCount()): + entry = self.table.item(row, col) + + if entry: + pmc_list = pmc_list + entry.text().split(sep="\n") + # clear the cell, we will re-allocate the pmc + + self.table.takeItem(row, col) + + # allowed PMC counters per batch + max_pmc_num = self.perfmon_config[IP_block] + + # remote this metric and re-segment the list and refill all rows in this column + pmc_list.remove(metric_name) + + # We are empty now, do nothing + if len(pmc_list) == 0: + return + + for row in range((len(pmc_list) + max_pmc_num - 1) // max_pmc_num): + start_index = row * max_pmc_num + pmc_str = "\n".join(pmc_list[start_index : start_index + max_pmc_num]) + self.table.setItem(row, col, QTableWidgetItem(pmc_str)) + + # Remove last row, if empty + last_row = self.table.rowCount() - 1 + empty_row = True + total_cols = len(list(self.perfmon_config.keys())) + for cindex in range(total_cols): + x = self.table.item(last_row, cindex) + + if x and x.text(): + empty_row = False + break + + if empty_row: + self.table.removeRow(last_row) + + def pmc_add_metric(self, metric_name, IP_block): + # Add the metric to pmc table, if not there yet + + # Map SQC to SQ, since they share the same Perfmon block + if IP_block == "SQC": + IP_block = "SQ" + + if not IP_block in list(self.perfmon_config.keys()): + return + + # This is the column we need to add/remove perfmon counters + col = list(self.perfmon_config.keys()).index(IP_block) + + # check if the metric already exists + if self.pmc_metric_selected(metric_name, col): + return + + # metric is not bucket yet, add it! + if self.table.rowCount() == 0: + # starting from scratch! + self.table.insertRow(0) + self.table.setItem(0, col, QTableWidgetItem(metric_name)) + return + + # find the row to insert + for row in range(self.table.rowCount()): + entry = self.table.item(row, col) + if not entry: + # print("search insert pos, row:", row, ", cell empty") + break + + if len(entry.text().split(sep="\n")) < self.perfmon_config[IP_block]: + # print("found") + break + + entry = self.table.item(row, col) + if not entry: + # put it into the empty cell + self.table.setItem(row, col, QTableWidgetItem(metric_name)) + return + + pmc_list = entry.text().split(sep="\n") + + if len(pmc_list) < self.perfmon_config[IP_block]: + # we still have hit per-IP HW counters limit, add it to the last row + pmc_list.append(metric_name) + pmc_str = "\n".join(pmc_list) + self.table.setItem(row, col, QTableWidgetItem(pmc_str)) + self.table.resizeRowsToContents() + else: + # Start a new row + row = row + 1 + self.table.insertRow(row) + self.table.setItem(row, col, QTableWidgetItem(metric_name)) + + def pmc_select(self, item): + metric_name = item.data() + if ( + not metric_name in self.nodes_dict + or not self.nodes_dict[metric_name].isCheckable() + ): + return + + # only proper metrics check/uncheck is processed here. + IP_block = item.data().split(sep="_")[0] + + if self.nodes_dict[metric_name].checkState() == 0: + # unselect the metric in the table if it is currently selected + self.pmc_remove_metric(metric_name, IP_block) + + elif self.nodes_dict[metric_name].checkState() == 2: + self.pmc_add_metric(metric_name, IP_block) + + # Function to save populate treeview with a dictionary + def importData(self, xmlparsed, root=None): + self.model.setRowCount(0) + if root is None: + root = self.model.invisibleRootItem() + + for x in xmlparsed.getiterator(): + # Add SoC node to Root + if x.tag in self.soc_arch_list: + parent = root + parent.appendRow([QStandardItem(x.tag)]) + self.nodes_dict[x.tag] = parent.child(parent.rowCount() - 1) + + # check all metrics in an SoC family + if x.tag == "metric" and x.getparent().tag in self.soc_arch_list: + # New IP block (e.g., SQ), detected, create a new hierarchy for the block + if not x.attrib["block"] in self.block_list: + self.block_list.append(x.attrib["block"]) + parent = self.nodes_dict[x.getparent().tag] # the SoC node + parent.appendRow( + [ + QStandardItem(x.attrib["block"]), + QStandardItem(""), + QStandardItem(""), + QStandardItem(""), + ] + ) + + # record the tree node for the block + self.nodes_dict[x.attrib["block"]] = parent.child( + parent.rowCount() - 1 + ) + + # Add metric node to the Block node + parent = self.nodes_dict[x.attrib["block"]] + metric_name = QStandardItem(x.attrib["name"]) + metric_name.setCheckable(True) + parent.appendRow( + [ + metric_name, + QStandardItem(x.attrib["block"]), + QStandardItem(x.attrib["event"]), + QStandardItem(x.attrib["descr"]), + ] + ) + + self.nodes_dict[x.attrib["name"]] = parent.child(parent.rowCount() - 1) + + +if __name__ == "__main__": + app = QApplication(sys.argv) + app.setStyle("Fusion") + + # populate the view with GFX metrics.xml + window = mainWindow() + + # show the view + window.setGeometry(300, 100, 600, 300) + # view.setWindowTitle('GFX Perfmon Counters') + window.show() + + # start the application + sys.exit(app.exec_()) From 3d7a7a6f324a1af64b860cbc9efe1bf8a79a72f6 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 13:47:11 -0600 Subject: [PATCH 06/11] updating copyright header for 2023 using newly-added "make license" target Signed-off-by: Karl W. Schulz --- cmake/Dockerfile | 20 +++++++++------- cmake/rocm_install.sh | 20 +++++++++------- docker/docker-entrypoint.sh | 24 ++++++++++--------- src/common.py | 20 +++++++++------- src/omniperf | 20 +++++++++------- .../convertor/mongodb/convert | 20 +++++++++------- .../convertor/sql/convertor.py | 20 +++++++++------- src/omniperf_analyze/omniperf_analyze.py | 20 +++++++++------- .../tests/unit/ast_parser_tester.py | 20 +++++++++------- src/omniperf_analyze/utils/file_io.py | 20 +++++++++------- src/omniperf_analyze/utils/gui.py | 20 +++++++++------- .../utils/gui_components/header.py | 20 +++++++++------- .../utils/gui_components/memchart.py | 20 +++++++++------- .../utils/gui_components/roofline.py | 20 +++++++++------- src/omniperf_analyze/utils/parser.py | 20 +++++++++------- src/omniperf_analyze/utils/roofline_calc.py | 20 +++++++++------- src/omniperf_analyze/utils/schema.py | 20 +++++++++------- src/omniperf_analyze/utils/tty.py | 20 +++++++++------- src/parser.py | 20 +++++++++------- src/utils/csv_converter.py | 20 +++++++++------- src/utils/gfx_perfmon_builder.py | 20 +++++++++------- src/utils/perfagg.py | 20 +++++++++------- src/utils/remove_workload.py | 20 +++++++++------- src/utils/resources.py | 20 +++++++++------- src/utils/specs.py | 20 +++++++++------- 25 files changed, 277 insertions(+), 227 deletions(-) diff --git a/cmake/Dockerfile b/cmake/Dockerfile index d216fd23ab..8a92eef25f 100644 --- a/cmake/Dockerfile +++ b/cmake/Dockerfile @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el FROM ubuntu:20.04 diff --git a/cmake/rocm_install.sh b/cmake/rocm_install.sh index c550c3e2fa..2b053f6a44 100755 --- a/cmake/rocm_install.sh +++ b/cmake/rocm_install.sh @@ -1,25 +1,27 @@ #!/usr/bin/env bash ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el declare -a rocm_versions=("4.3.1" "4.5.2" "5.0.2" "5.1.3" "5.2.3") diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 52b3e3914a..4ab480fe10 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,26 +1,28 @@ #!/bin/bash -################################################################################ -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +##############################################################################bl +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -################################################################################ +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +##############################################################################el pushd /var/lib/grafana/plugins/omniperfData_plugin npm run server & diff --git a/src/common.py b/src/common.py index 30ed28c5f2..69859a9509 100644 --- a/src/common.py +++ b/src/common.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import os diff --git a/src/omniperf b/src/omniperf index d27f295a20..76c97d0f00 100755 --- a/src/omniperf +++ b/src/omniperf @@ -1,25 +1,27 @@ #!/usr/bin/env python3 ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import sys diff --git a/src/omniperf_analyze/convertor/mongodb/convert b/src/omniperf_analyze/convertor/mongodb/convert index 6b63033d19..49e013761b 100755 --- a/src/omniperf_analyze/convertor/mongodb/convert +++ b/src/omniperf_analyze/convertor/mongodb/convert @@ -1,25 +1,27 @@ #!/usr/bin/env python3 ##############################################################################bl -# Copyright (C) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import ast diff --git a/src/omniperf_analyze/convertor/sql/convertor.py b/src/omniperf_analyze/convertor/sql/convertor.py index 28de3b4fc4..20aaa76142 100644 --- a/src/omniperf_analyze/convertor/sql/convertor.py +++ b/src/omniperf_analyze/convertor/sql/convertor.py @@ -1,25 +1,27 @@ #!/usr/bin/env python3 ##############################################################################bl -# Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import re diff --git a/src/omniperf_analyze/omniperf_analyze.py b/src/omniperf_analyze/omniperf_analyze.py index 5a1bcba62f..aa9936193c 100644 --- a/src/omniperf_analyze/omniperf_analyze.py +++ b/src/omniperf_analyze/omniperf_analyze.py @@ -1,25 +1,27 @@ #!/usr/bin/env python3 ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el """ diff --git a/src/omniperf_analyze/tests/unit/ast_parser_tester.py b/src/omniperf_analyze/tests/unit/ast_parser_tester.py index 573590b543..c8fa49bc39 100644 --- a/src/omniperf_analyze/tests/unit/ast_parser_tester.py +++ b/src/omniperf_analyze/tests/unit/ast_parser_tester.py @@ -1,25 +1,27 @@ #!/usr/bin/env python3 ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import ast diff --git a/src/omniperf_analyze/utils/file_io.py b/src/omniperf_analyze/utils/file_io.py index ad447b05c2..1d2de6318e 100644 --- a/src/omniperf_analyze/utils/file_io.py +++ b/src/omniperf_analyze/utils/file_io.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import os diff --git a/src/omniperf_analyze/utils/gui.py b/src/omniperf_analyze/utils/gui.py index 31e8ed61a4..a9aadc8df5 100644 --- a/src/omniperf_analyze/utils/gui.py +++ b/src/omniperf_analyze/utils/gui.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el from selectors import EpollSelector diff --git a/src/omniperf_analyze/utils/gui_components/header.py b/src/omniperf_analyze/utils/gui_components/header.py index 70fb5bcf6b..7fc8ddaed6 100644 --- a/src/omniperf_analyze/utils/gui_components/header.py +++ b/src/omniperf_analyze/utils/gui_components/header.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el from dash import html, dcc diff --git a/src/omniperf_analyze/utils/gui_components/memchart.py b/src/omniperf_analyze/utils/gui_components/memchart.py index 2a09b21600..69a0594ffa 100644 --- a/src/omniperf_analyze/utils/gui_components/memchart.py +++ b/src/omniperf_analyze/utils/gui_components/memchart.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import sys diff --git a/src/omniperf_analyze/utils/gui_components/roofline.py b/src/omniperf_analyze/utils/gui_components/roofline.py index 8c74ca0b85..0d5ea113c5 100644 --- a/src/omniperf_analyze/utils/gui_components/roofline.py +++ b/src/omniperf_analyze/utils/gui_components/roofline.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el from omniperf_analyze.utils import roofline_calc diff --git a/src/omniperf_analyze/utils/parser.py b/src/omniperf_analyze/utils/parser.py index 5c94e5b4e0..ba92bc34f8 100644 --- a/src/omniperf_analyze/utils/parser.py +++ b/src/omniperf_analyze/utils/parser.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import ast diff --git a/src/omniperf_analyze/utils/roofline_calc.py b/src/omniperf_analyze/utils/roofline_calc.py index 12f1a63c68..f9aa28b3db 100644 --- a/src/omniperf_analyze/utils/roofline_calc.py +++ b/src/omniperf_analyze/utils/roofline_calc.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import sys diff --git a/src/omniperf_analyze/utils/schema.py b/src/omniperf_analyze/utils/schema.py index 65a2fa8413..e0da44034f 100644 --- a/src/omniperf_analyze/utils/schema.py +++ b/src/omniperf_analyze/utils/schema.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el # diff --git a/src/omniperf_analyze/utils/tty.py b/src/omniperf_analyze/utils/tty.py index ade1a9b37b..310c2c10b3 100644 --- a/src/omniperf_analyze/utils/tty.py +++ b/src/omniperf_analyze/utils/tty.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import pandas as pd diff --git a/src/parser.py b/src/parser.py index bce1f705f3..fbc1c34e85 100644 --- a/src/parser.py +++ b/src/parser.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import os diff --git a/src/utils/csv_converter.py b/src/utils/csv_converter.py index 191550b0ff..3d8a381a5c 100644 --- a/src/utils/csv_converter.py +++ b/src/utils/csv_converter.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import argparse diff --git a/src/utils/gfx_perfmon_builder.py b/src/utils/gfx_perfmon_builder.py index ac26df682d..c298e57561 100755 --- a/src/utils/gfx_perfmon_builder.py +++ b/src/utils/gfx_perfmon_builder.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el from PyQt5.QtWidgets import ( diff --git a/src/utils/perfagg.py b/src/utils/perfagg.py index c2cdc7fdf1..5bc9d6be32 100755 --- a/src/utils/perfagg.py +++ b/src/utils/perfagg.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import sys, os, pathlib, shutil, subprocess, argparse, glob, re diff --git a/src/utils/remove_workload.py b/src/utils/remove_workload.py index 6627b64051..d389106e10 100755 --- a/src/utils/remove_workload.py +++ b/src/utils/remove_workload.py @@ -1,25 +1,27 @@ #!/usr/bin/env python3 ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import argparse diff --git a/src/utils/resources.py b/src/utils/resources.py index 5408a90ab7..23b684c2fb 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -1,23 +1,25 @@ ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import pathlib diff --git a/src/utils/specs.py b/src/utils/specs.py index b385c9d053..5f32a977f6 100644 --- a/src/utils/specs.py +++ b/src/utils/specs.py @@ -1,25 +1,27 @@ """Get host/gpu specs.""" ##############################################################################bl -# Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved. -# +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ##############################################################################el import os From 70662311281233a7d11fc10c4b70a0092e0fed06 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 14:28:25 -0600 Subject: [PATCH 07/11] placate the formatter Signed-off-by: Karl W. Schulz --- utils/update_license.py | 60 +++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/utils/update_license.py b/utils/update_license.py index db87d7cb30..9594823b83 100755 --- a/utils/update_license.py +++ b/utils/update_license.py @@ -12,33 +12,33 @@ import re import filecmp import shutil -begDelim='######bl$' -endDelim='######el$' -maxHeaderLines=200 +begDelim = "######bl$" +endDelim = "######el$" +maxHeaderLines = 200 -def cacheLicenseFile(infile,comment='#'): +def cacheLicenseFile(infile, comment="#"): if not os.path.isfile(infile): logging.error("Unable to access license file - >%s" % infile) sys.exit(1) license = "" - with open(infile, 'r') as file_in: + with open(infile, "r") as file_in: for line in file_in: - license += comment + ' ' + line - return(license) + license += comment + " " + line + return license parser = argparse.ArgumentParser() -parser.add_argument('--license', required=True,help='License File') -parser.add_argument('--source', required=True,help='Source directory') +parser.add_argument("--license", required=True, help="License File") +parser.add_argument("--source", required=True, help="Source directory") parser.add_argument("--dryrun", help="enable dryrun mode", action="store_true") group = parser.add_mutually_exclusive_group(required=True) -group.add_argument('--extension',help='file extension to parse') -group.add_argument('--files', help='specific file(s) to parse') +group.add_argument("--extension", help="file extension to parse") +group.add_argument("--files", help="specific file(s) to parse") -logging.basicConfig(format='%(levelname)s: %(message)s',level=logging.INFO) +logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.INFO) args = parser.parse_args() @@ -61,13 +61,13 @@ if specificFiles: license = cacheLicenseFile(args.license) # Scan files in provided source directory... -for filename in glob.iglob(srcDir + '/**', recursive=True): - # skip directories +for filename in glob.iglob(srcDir + "/**", recursive=True): + # skip directories if os.path.isdir(filename): - continue + continue # File matching options: - + # (1) filter non-matching extensions if fileExtension: if not filename.endswith(fileExtension): @@ -77,26 +77,26 @@ for filename in glob.iglob(srcDir + '/**', recursive=True): if specificFiles: found = False for file in specificFiles: - fullPath = os.path.join(srcDir,file) + fullPath = os.path.join(srcDir, file) if fullPath == filename: found = True break if not found: continue - + logging.debug("Examining %s for license..." % filename) # Update license header contents if delimiters are found - with open(filename, 'r') as file_in: + with open(filename, "r") as file_in: baseName = os.path.basename(filename) - dirName = os.path.dirname(filename) - tmpFile = dirName + "/." + baseName + ".tmp" + dirName = os.path.dirname(filename) + tmpFile = dirName + "/." + baseName + ".tmp" + + file_out = open(tmpFile, "w") - file_out = open(tmpFile,'w') - for line in file_in: - if re.search(begDelim,line): + if re.search(begDelim, line): logging.debug("Found beginning delimiter") file_out.write(line) file_out.write(license) @@ -105,7 +105,7 @@ for filename in glob.iglob(srcDir + '/**', recursive=True): for i in range(maxHeaderLines): line = file_in.readline() - if re.search(endDelim,line): + if re.search(endDelim, line): logging.debug("Found ending delimiter") file_out.write(line) foundEnd = True @@ -119,15 +119,11 @@ for filename in glob.iglob(srcDir + '/**', recursive=True): file_out.close() - # Check if file changed and update - if not filecmp.cmp(filename,tmpFile,shallow=False): + if not filecmp.cmp(filename, tmpFile, shallow=False): logging.info("%s changed" % filename) - shutil.copystat(filename,tmpFile) + shutil.copystat(filename, tmpFile) if not args.dryrun: - os.rename(tmpFile,filename) + os.rename(tmpFile, filename) else: os.unlink(tmpFile) - - - From 980fb08c9257efb6f9a33731faded75e6d169275 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 14:48:56 -0600 Subject: [PATCH 08/11] Update license header tool to not include a space after comment if rest of line is blank. Needed to make python formatting check happy. Signed-off-by: Karl W. Schulz --- utils/update_license.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/update_license.py b/utils/update_license.py index 9594823b83..4342508c4e 100755 --- a/utils/update_license.py +++ b/utils/update_license.py @@ -25,7 +25,10 @@ def cacheLicenseFile(infile, comment="#"): license = "" with open(infile, "r") as file_in: for line in file_in: - license += comment + " " + line + license += comment + if line.strip() != "": + license += " " + license += line return license From 574ebcf75548d7ea6ce39874443311a26622710f Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 14:50:24 -0600 Subject: [PATCH 09/11] apply "make license" update Signed-off-by: Karl W. Schulz --- cmake/Dockerfile | 8 +- cmake/rocm_install.sh | 8 +- docker/docker-entrypoint.sh | 8 +- src/common.py | 8 +- src/omniperf | 116 +++++++++++------- .../convertor/mongodb/convert | 8 +- .../convertor/sql/convertor.py | 8 +- src/omniperf_analyze/omniperf_analyze.py | 8 +- .../tests/unit/ast_parser_tester.py | 8 +- src/omniperf_analyze/utils/file_io.py | 8 +- src/omniperf_analyze/utils/gui.py | 8 +- .../utils/gui_components/header.py | 8 +- .../utils/gui_components/memchart.py | 8 +- .../utils/gui_components/roofline.py | 8 +- src/omniperf_analyze/utils/parser.py | 8 +- src/omniperf_analyze/utils/roofline_calc.py | 8 +- src/omniperf_analyze/utils/schema.py | 8 +- src/omniperf_analyze/utils/tty.py | 8 +- src/parser.py | 8 +- src/utils/csv_converter.py | 8 +- src/utils/gfx_perfmon_builder.py | 8 +- src/utils/perfagg.py | 8 +- src/utils/remove_workload.py | 8 +- src/utils/resources.py | 8 +- src/utils/specs.py | 8 +- 25 files changed, 168 insertions(+), 140 deletions(-) diff --git a/cmake/Dockerfile b/cmake/Dockerfile index 8a92eef25f..766be0894f 100644 --- a/cmake/Dockerfile +++ b/cmake/Dockerfile @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/cmake/rocm_install.sh b/cmake/rocm_install.sh index 2b053f6a44..57d2331779 100755 --- a/cmake/rocm_install.sh +++ b/cmake/rocm_install.sh @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 4ab480fe10..6a2923f6f3 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/common.py b/src/common.py index 69859a9509..70cdcd8239 100644 --- a/src/common.py +++ b/src/common.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf b/src/omniperf index 76c97d0f00..554e59a6e2 100755 --- a/src/omniperf +++ b/src/omniperf @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -39,7 +39,7 @@ from utils import specs from utils.perfagg import perfmon_filter, pmc_filter from utils import remove_workload from utils import csv_converter # Import workload -from omniperf_analyze.omniperf_analyze import roofline_only # Standalone roofline +from omniperf_analyze.omniperf_analyze import roofline_only # Standalone roofline from omniperf_analyze.omniperf_analyze import analyze # CLI analysis from common import ( @@ -55,10 +55,8 @@ from common import getVersion # Helper Functions ################################################ def run_subprocess(cmd): - subprocess.run( - cmd, - check=True - ) + subprocess.run(cmd, check=True) + def resolve_rocprof(): # ROCPROF INFO @@ -127,7 +125,9 @@ def replace_timestamps(workload_dir): df_pmc_perf["EndNs"] = df_stamps["EndNs"] df_pmc_perf.to_csv(workload_dir + "/pmc_perf.csv", index=False) else: - warnings.warn("WARNING: Incomplete profiling data detected. Unable to update timestamps.") + warnings.warn( + "WARNING: Incomplete profiling data detected. Unable to update timestamps." + ) def gen_sysinfo(workload_name, workload_dir, ip_blocks, app_cmd, skip_roof): @@ -152,7 +152,7 @@ def gen_sysinfo(workload_name, workload_dir, ip_blocks, app_cmd, skip_roof): timestamp = now.strftime("%c") + " (" + local_tzname + ")" # host info param = [workload_name] - param += ["\"" + app_cmd + "\""] + param += ['"' + app_cmd + '"'] param += [ mspec.hostname, mspec.cpu, @@ -259,6 +259,7 @@ def roof_setup(args, my_parser): else: characterize_app(args.path, args.remaining, args.verbose) + def detect_roofline(): mspec = specs.get_machine_specs(0) rocm_ver = mspec.rocmversion[:1] @@ -293,6 +294,7 @@ def detect_roofline(): target_binary = {"rocm_ver": rocm_ver, "distro": distro} return target_binary + def mibench(args): print("No roofline data found. Generating...") @@ -326,6 +328,7 @@ def mibench(args): ] ) + def characterize_app(path, cmd, verbose): target = get_soc() workload_dir = path @@ -357,27 +360,38 @@ def characterize_app(path, cmd, verbose): # Update pmc_perf.csv timestamps replace_timestamps(workload_dir) + ################################################ # Profiling Helpers ################################################ + def run_rocscope(args, fname): # profile the app if args.use_rocscope == True: - result = subprocess.run(["which", "rocscope"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + result = subprocess.run( + ["which", "rocscope"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL + ) if result.returncode == 0: - rs_cmd = [result.stdout.decode('ascii').strip(), - "metrics", - "-p", args.path, - "-n", args.name, - "-t", fname, - "--"] + rs_cmd = [ + result.stdout.decode("ascii").strip(), + "metrics", + "-p", + args.path, + "-n", + args.name, + "-t", + fname, + "--", + ] for i in args.remaining.split(): rs_cmd.append(i) print(rs_cmd) - result = run_subprocess(rs_cmd) #, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + result = run_subprocess( + rs_cmd + ) # , stdout=subprocess.PIPE, stderr=subprocess.PIPE) if result.returncode != 0: - print(result.stderr.decode('ascii')) + print(result.stderr.decode("ascii")) sys.exit(1) @@ -410,7 +424,7 @@ def omniperf_profile(args, VER): parse.print_help(sys.stderr) sys.exit(1) - #Verify valid name + # Verify valid name if args.name.find(".") != -1 or args.name.find("-") != -1: raise ValueError("'-' and '.' are not permited in workload name", args.name) @@ -430,59 +444,75 @@ def omniperf_profile(args, VER): # Set up directories workload_dir = args.path + "/" + args.name + "/" + args.target perfmon_dir = str(OMNIPERF_HOME) + "/perfmon_pub" - + # Perfmon filtering perfmon_filter(workload_dir, perfmon_dir, args) if not args.lucky == None and args.lucky == True: print("You're feeling lucky - only profiling top N kernels") - #look for whether workload_dir exists - create if not + # look for whether workload_dir exists - create if not try: - os.makedirs(workload_dir, exist_ok = True) + os.makedirs(workload_dir, exist_ok=True) except Exception as e: print("Unable to create workload directory: ", workload_dir) print(e) sys.exit(1) - result = subprocess.run(["which", "rocscope"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + result = subprocess.run( + ["which", "rocscope"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL + ) if result.returncode == 0: - rs_cmd = [result.stdout.decode('ascii').strip(), - "top10", - "-p", args.path, - "-n", args.name, - "--"] + rs_cmd = [ + result.stdout.decode("ascii").strip(), + "top10", + "-p", + args.path, + "-n", + args.name, + "--", + ] for i in args.remaining.split(): rs_cmd.append(i) print(rs_cmd) - result = run_subprocess(rs_cmd) #, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + result = run_subprocess( + rs_cmd + ) # , stdout=subprocess.PIPE, stderr=subprocess.PIPE) if result.returncode != 0: - print(result.stderr.decode('ascii')) + print(result.stderr.decode("ascii")) else: print("rocscope must be in the PATH") sys.exit(1) elif not args.summaries == None and args.summaries == True: print("creating kernel summaries") - #look for whether workload_dir exists - create if not + # look for whether workload_dir exists - create if not try: - os.makedirs(workload_dir, exist_ok = True) + os.makedirs(workload_dir, exist_ok=True) except Exception as e: print("Unable to create workload directory: ", workload_dir) print(e) sys.exit(1) - result = subprocess.run(["which", "rocscope"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + result = subprocess.run( + ["which", "rocscope"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL + ) if result.returncode == 0: - rs_cmd = [result.stdout.decode('ascii').strip(), - "summary", - "-p", args.path, - "-n", args.name, - "--"] + rs_cmd = [ + result.stdout.decode("ascii").strip(), + "summary", + "-p", + args.path, + "-n", + args.name, + "--", + ] for i in args.remaining.split(): rs_cmd.append(i) print(rs_cmd) - result = run_subprocess(rs_cmd) #, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + result = run_subprocess( + rs_cmd + ) # , stdout=subprocess.PIPE, stderr=subprocess.PIPE) if result.returncode != 0: - print(result.stderr.decode('ascii')) + print(result.stderr.decode("ascii")) else: print("rocscope must be in the PATH") sys.exit(1) @@ -516,8 +546,6 @@ def omniperf_profile(args, VER): run_rocscope(args, fname) else: run_prof(fname, workload_dir, perfmon_dir, args.remaining, args.verbose) - - # run again with timestamps run_subprocess( diff --git a/src/omniperf_analyze/convertor/mongodb/convert b/src/omniperf_analyze/convertor/mongodb/convert index 49e013761b..dc8a33e920 100755 --- a/src/omniperf_analyze/convertor/mongodb/convert +++ b/src/omniperf_analyze/convertor/mongodb/convert @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/convertor/sql/convertor.py b/src/omniperf_analyze/convertor/sql/convertor.py index 20aaa76142..c6b36b5f97 100644 --- a/src/omniperf_analyze/convertor/sql/convertor.py +++ b/src/omniperf_analyze/convertor/sql/convertor.py @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/omniperf_analyze.py b/src/omniperf_analyze/omniperf_analyze.py index aa9936193c..368e5c50c5 100644 --- a/src/omniperf_analyze/omniperf_analyze.py +++ b/src/omniperf_analyze/omniperf_analyze.py @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/tests/unit/ast_parser_tester.py b/src/omniperf_analyze/tests/unit/ast_parser_tester.py index c8fa49bc39..f728743c2d 100644 --- a/src/omniperf_analyze/tests/unit/ast_parser_tester.py +++ b/src/omniperf_analyze/tests/unit/ast_parser_tester.py @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/file_io.py b/src/omniperf_analyze/utils/file_io.py index 1d2de6318e..05219dbcca 100644 --- a/src/omniperf_analyze/utils/file_io.py +++ b/src/omniperf_analyze/utils/file_io.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/gui.py b/src/omniperf_analyze/utils/gui.py index a9aadc8df5..eb083bfe9d 100644 --- a/src/omniperf_analyze/utils/gui.py +++ b/src/omniperf_analyze/utils/gui.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/gui_components/header.py b/src/omniperf_analyze/utils/gui_components/header.py index 7fc8ddaed6..3dcf34be69 100644 --- a/src/omniperf_analyze/utils/gui_components/header.py +++ b/src/omniperf_analyze/utils/gui_components/header.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/gui_components/memchart.py b/src/omniperf_analyze/utils/gui_components/memchart.py index 69a0594ffa..f8af87d547 100644 --- a/src/omniperf_analyze/utils/gui_components/memchart.py +++ b/src/omniperf_analyze/utils/gui_components/memchart.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/gui_components/roofline.py b/src/omniperf_analyze/utils/gui_components/roofline.py index 0d5ea113c5..8fb6e36a74 100644 --- a/src/omniperf_analyze/utils/gui_components/roofline.py +++ b/src/omniperf_analyze/utils/gui_components/roofline.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/parser.py b/src/omniperf_analyze/utils/parser.py index ba92bc34f8..7d6dcab493 100644 --- a/src/omniperf_analyze/utils/parser.py +++ b/src/omniperf_analyze/utils/parser.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/roofline_calc.py b/src/omniperf_analyze/utils/roofline_calc.py index f9aa28b3db..987b6694de 100644 --- a/src/omniperf_analyze/utils/roofline_calc.py +++ b/src/omniperf_analyze/utils/roofline_calc.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/schema.py b/src/omniperf_analyze/utils/schema.py index e0da44034f..13d930916d 100644 --- a/src/omniperf_analyze/utils/schema.py +++ b/src/omniperf_analyze/utils/schema.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/omniperf_analyze/utils/tty.py b/src/omniperf_analyze/utils/tty.py index 310c2c10b3..0900fd689f 100644 --- a/src/omniperf_analyze/utils/tty.py +++ b/src/omniperf_analyze/utils/tty.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/parser.py b/src/parser.py index fbc1c34e85..b305b60187 100644 --- a/src/parser.py +++ b/src/parser.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/utils/csv_converter.py b/src/utils/csv_converter.py index 3d8a381a5c..b178439aca 100644 --- a/src/utils/csv_converter.py +++ b/src/utils/csv_converter.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/utils/gfx_perfmon_builder.py b/src/utils/gfx_perfmon_builder.py index c298e57561..c5a77908ac 100755 --- a/src/utils/gfx_perfmon_builder.py +++ b/src/utils/gfx_perfmon_builder.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/utils/perfagg.py b/src/utils/perfagg.py index 5bc9d6be32..0606b4dc4b 100755 --- a/src/utils/perfagg.py +++ b/src/utils/perfagg.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/utils/remove_workload.py b/src/utils/remove_workload.py index d389106e10..02ba864f59 100755 --- a/src/utils/remove_workload.py +++ b/src/utils/remove_workload.py @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/utils/resources.py b/src/utils/resources.py index 23b684c2fb..4986394811 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -1,18 +1,18 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/src/utils/specs.py b/src/utils/specs.py index 5f32a977f6..a040fcbf68 100644 --- a/src/utils/specs.py +++ b/src/utils/specs.py @@ -2,19 +2,19 @@ ##############################################################################bl # MIT License -# +# # Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE From 0125c2179bd9270241c1a596d8041391d7e4b8a2 Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Mon, 13 Feb 2023 14:55:26 -0600 Subject: [PATCH 10/11] another formatting change Signed-off-by: Karl W. Schulz --- utils/update_license.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/update_license.py b/utils/update_license.py index 4342508c4e..353c4a7eba 100755 --- a/utils/update_license.py +++ b/utils/update_license.py @@ -96,9 +96,7 @@ for filename in glob.iglob(srcDir + "/**", recursive=True): tmpFile = dirName + "/." + baseName + ".tmp" file_out = open(tmpFile, "w") - for line in file_in: - if re.search(begDelim, line): logging.debug("Found beginning delimiter") file_out.write(line) From 6f498686c38cf5456d7712199c46ac657125b697 Mon Sep 17 00:00:00 2001 From: coleramos425 Date: Tue, 14 Feb 2023 09:54:29 -0600 Subject: [PATCH 11/11] Tested out the new make license on convertor2.py Signed-off-by: coleramos425 --- .../convertor/sql/convertor2.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/omniperf_analyze/convertor/sql/convertor2.py b/src/omniperf_analyze/convertor/sql/convertor2.py index df4e2e5135..cc2b89e6d7 100644 --- a/src/omniperf_analyze/convertor/sql/convertor2.py +++ b/src/omniperf_analyze/convertor/sql/convertor2.py @@ -1,7 +1,9 @@ #!/usr/bin/env python3 -################################################################################ -# Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +################################################################################bl +# MIT License +# +# Copyright (c) 2021 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -10,17 +12,17 @@ # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -################################################################################ +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +################################################################################el import re import sys