Addition of new files to demonstrate top-level data structure refactoring for

2.x version.  Introduces an Omniperf class as the primary structure to organize
work elements and allows for a simple main() which is highlighted in a
omniperf2 example. Demonstrates desired logger functionality including a custom
trace loglevel that can be used to provide more verbosity beyond the debug
level. Also introduces three abstract base classes to organize flexibility for
alternative implementations of key elements within omniperf:

  * underlying profiler tool (e.g. rocprof, rocscope, etc)
  * supported GPU architectures (SoC)
  * analysis environments (e.g. CLI, web-based, etc)

Stub examples for child classes relevant to currently supported options within
omniperf are included in separate files.

Signed-off-by: Karl W. Schulz <karl.schulz@amd.com>
Цей коміт міститься в:
Karl W. Schulz
2023-09-06 16:29:48 -05:00
джерело cc5bba19f4
коміт f3e5db714c
14 змінених файлів з 764 додано та 0 видалено
+44
Переглянути файл
@@ -0,0 +1,44 @@
##############################################################################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
# 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 abc import ABC, abstractmethod
class OmniAnalyze_Base():
def __init__(self,args,options):
self.__args = args
self.__options = options
# Required methods to be implemented by child classes
@abstractmethod
def pre_processing(self):
"""Perform initialization prior to analysis.
"""
pass
@abstractmethod
def run_analysis(self):
"""Run analysis.
"""
pass
+42
Переглянути файл
@@ -0,0 +1,42 @@
##############################################################################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
# 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
import logging
from analysis_base import OmniAnalyze_Base
from utils.utils import demarcate
class cli_analysis(OmniAnalyze_Base):
# Required child methods
@demarcate
def pre_processing(self):
"""Perform any pre-processing steps prior to analysis.
"""
logging.debug("[analysis] prepping to do some analysis")
@demarcate
def run_analysis(self):
"""Run CLI analysis.
"""
logging.debug("[analysis] check out this wicked cli ascii art")
+42
Переглянути файл
@@ -0,0 +1,42 @@
##############################################################################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
# 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
import logging
from analysis_base import OmniAnalyze_Base
from utils.utils import demarcate
class webui_analysis(OmniAnalyze_Base):
# Required child methods
@demarcate
def pre_processing(self):
"""Perform any pre-processing steps prior to analysis.
"""
logging.debug("[analysis] prepping to do some analysis")
@demarcate
def run_analysis(self):
"""Run CLI analysis.
"""
logging.debug("[analysis] would you like to check out a groovy profiling web site?")
Виконуваний файл
+47
Переглянути файл
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
##############################################################################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
# 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 omniperf_base import Omniperf
def main():
omniperf2 = Omniperf()
omniperf2.parseArgs()
mode = omniperf2.get_mode()
# major omniperf execution modes
if mode == "profile":
omniperf2.run_profiler()
elif mode == "database":
omniperf2.update_DB()
elif mode == "analyze":
omniperf2.run_analysis()
else:
omniperf2.error("Unsupported execution mode")
if __name__ == "__main__":
main()
+180
Переглянути файл
@@ -0,0 +1,180 @@
##############################################################################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
# 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
import argparse
import logging
import sys
import os
from utils.utils import demarcate, trace_logger
class Omniperf:
def __init__(self):
self.__args = None
self.__profiler_mode = None
self.__soc_name = None
self.__soc = None
self.__options = {}
self.setup_logging()
self.parseArgs()
# hard-coding dummy examples (comment/uncomment below to instantiate different implementations)
self.__profiler_mode = "rocprof_v1"
self.__profiler_mode = "rocprof_v2"
#self.__profiler_mode = "rocscope"
self.__analyze_mode = "cli"
self.__analyze_mode = "webui"
# hard-code execution mode
self.__mode = "profile"
#self.__mode = "analyze"
logging.info("Execution mode = %s" % self.__mode)
def setup_logging(self):
# register a trace level logger
logging.TRACE = logging.DEBUG - 5
logging.addLevelName(logging.TRACE, "TRACE")
setattr(logging, "TRACE", logging.TRACE)
setattr(logging, "trace", trace_logger)
# demonstrate override of default loglevel via env variable
loglevel=logging.INFO
if "OMNIPERF_LOGLEVEL" in os.environ.keys():
loglevel = os.environ['OMNIPERF_LOGLEVEL']
if loglevel in {"DEBUG","debug"}:
loglevel = logging.DEBUG
elif loglevel in {"TRACE","trace"}:
loglevel = logging.TRACE
elif loglevel in {"INFO","info"}:
loglevel = logging.INFO
elif loglevel in {"ERROR","error"}:
loglevel = logging.ERROR
else:
print("Ignoring unsupported OMNIPERF_LOGLEVEL setting (%s)" % loglevel)
sys.exit(1)
logging.basicConfig(format="%(message)s", level=loglevel, stream=sys.stdout)
def get_mode(self):
return self.__mode
def error(self,message):
logging.error("")
logging.error("[ERROR]: " + message)
logging.error("")
sys.exit(1)
@demarcate
def detectSoC(self):
# hard-coded example
self.__soc_name = "gfx906"
self.__soc_name = "gfx908"
self.__soc_name = "gfx90a"
# instantiate underlying SoC support class
if self.__soc_name == "gfx906":
from soc_gfx906 import gfx906_soc
self.__soc = gfx906_soc(self.__args)
elif self.__soc_name == "gfx908":
from soc_gfx908 import gfx908_soc
self.__soc = gfx908_soc(self.__args)
elif self.__soc_name == "gfx90a":
from soc_gfx90a import gfx90a_soc
self.__soc = gfx90a_soc(self.__args)
else:
logging.error("Unsupported SoC")
sys.exit(1)
logging.info("SoC = %s" % self.__soc_name)
return
def parseArgs(self):
self.__args = "some arguments"
return
@demarcate
def run_profiler(self):
self.detectSoC()
logging.info("Profiler choice = %s" % self.__profiler_mode)
# instantiate desired profiler
if self.__profiler_mode == "rocprof_v1":
from profiler_rocprof import rocprof_v1_profiler
profiler = rocprof_v1_profiler(self.__soc, self.__args)
elif self.__profiler_mode == "rocprof_v2":
from profiler_rocprof_v2 import rocprof_v2_profiler
profiler = rocprof_v2_profiler(self.__soc, self.__args)
elif self.__profiler_mode == "rocscope":
from profiler_rocscope import rocscope_profiler
profiler = rocscope_profiler(self.__soc, self.__args)
else:
logging.error("Unsupported profiler")
sys.exit(1)
#-----------------------
# run profiling workflow
#-----------------------
self.__soc.profiling_setup()
profiler.pre_processing()
profiler.run_profiling()
profiler.post_processing()
return
@demarcate
def update_DB(self):
return
@demarcate
def run_analysis(self):
self.detectSoC()
logging.info("Analysis mode choie = %s" % self.__analyze_mode)
if self.__analyze_mode == "cli":
from analysis_cli import cli_analysis
analyzer = cli_analysis(self.__args,self.__options)
elif self.__analyze_mode == "webui":
from analysis_webui import webui_analysis
analyzer = webui_analysis(self.__args,self.__options)
else:
self.error("Unsupported anlaysis mode -> %s" % self.__analyze_mode)
#-----------------------
# run analysis workflow
#-----------------------
self.__soc.analysis_setup()
analyzer.pre_processing()
analyzer.run_analysis()
return
+50
Переглянути файл
@@ -0,0 +1,50 @@
##############################################################################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
# 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 abc import ABC, abstractmethod
# from utils2 import demarcate
class OmniProfiler_Base():
def __init__(self,soc,profiling_args):
self.__soc = soc
self.__args = profiling_args
# Required methods to be implemented by child classes
@abstractmethod
def pre_processing(self):
"""Perform any pre-processing steps prior to profiling.
"""
pass
@abstractmethod
def run_profiling(self):
"""Run profiling.
"""
pass
@abstractmethod
def post_processing(self):
"""Perform any post-processing steps prior to profiling.
"""
pass
+49
Переглянути файл
@@ -0,0 +1,49 @@
##############################################################################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
# 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
import logging
from profiler_base import OmniProfiler_Base
from utils.utils import demarcate
class rocprof_v1_profiler(OmniProfiler_Base):
# Required child methods
@demarcate
def pre_processing(self):
"""Perform any pre-processing steps prior to profiling.
"""
self.__profiler="rocprof"
logging.debug("[profiling] pre-processing using %s profiler (v1)" % self.__profiler)
@demarcate
def run_profiling(self):
"""Run profiling.
"""
logging.debug("[profiling] performing profiling using %s profiler (v1)" % self.__profiler)
@demarcate
def post_processing(self):
"""Perform any post-processing steps prior to profiling.
"""
logging.debug("[profiling] performing post-processing using %s profiler (v1)" % self.__profiler)
+49
Переглянути файл
@@ -0,0 +1,49 @@
##############################################################################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
# 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
import logging
from profiler_base import OmniProfiler_Base
from utils.utils import demarcate
class rocprof_v2_profiler(OmniProfiler_Base):
# Required child methods
@demarcate
def pre_processing(self):
"""Perform any pre-processing steps prior to profiling.
"""
self.__profiler="rocprof_v2"
logging.debug("[profiling] pre-processing using %s profiler (v1)" % self.__profiler)
@demarcate
def run_profiling(self):
"""Run profiling.
"""
logging.debug("[profiling] performing profiling using %s profiler (v1)" % self.__profiler)
@demarcate
def post_processing(self):
"""Perform any post-processing steps prior to profiling.
"""
logging.debug("[profiling] performing post-processing using %s profiler (v1)" % self.__profiler)
+47
Переглянути файл
@@ -0,0 +1,47 @@
##############################################################################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
# 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
import logging
from profiler_base import OmniProfiler_Base
from utils.utils import demarcate
class rocscope_profiler(OmniProfiler_Base):
# Required child methods
@demarcate
def pre_processing(self):
"""Perform any pre-processing steps prior to profiling.
"""
self.__profiler="rocscope"
logging.debug("[profiling] pre-processing using %s profiler" % self.__profiler)
@demarcate
def run_profiling(self):
"""Run profiling.
"""
logging.debug("[profiling] performing profiling using %s profiler" % self.__profiler)
@demarcate
def post_processing(self):
"""Perform any post-processing steps prior to profiling.
"""
logging.debug("[profiling] performing post-processing using %s profiler" % self.__profiler)
+43
Переглянути файл
@@ -0,0 +1,43 @@
##############################################################################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
# 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 abc import ABC, abstractmethod
class OmniSoC_Base():
def __init__(self,args):
self.__args = args
# Required methods to be implemented by child classes
@abstractmethod
def profiling_setup(self):
"""Perform any SoC-specific setup prior to profiling.
"""
pass
@abstractmethod
def analysis_setup(self):
"""Perform any SoC-specific setup prior to analysis.
"""
pass
+45
Переглянути файл
@@ -0,0 +1,45 @@
##############################################################################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
# 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
import logging
from soc_base import OmniSoC_Base
from utils.utils import demarcate
class gfx906_soc (OmniSoC_Base):
def __init__(self,args):
self.__args = args
self.__soc = "gfx906"
# Required methods to be implemented by child classes
@demarcate
def profiling_setup(self):
"""Perform any SoC-specific setup prior to profiling.
"""
logging.debug("[profiling] perform profiling setup for %s" % self.__soc)
@demarcate
def analysis_setup(self):
"""Perform any SoC-specific setup prior to analysis.
"""
logging.debug("[analysis] perform analysis setup for %s" % self.__soc)
+45
Переглянути файл
@@ -0,0 +1,45 @@
##############################################################################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
# 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
import logging
from soc_base import OmniSoC_Base
from utils.utils import demarcate
class gfx908_soc (OmniSoC_Base):
def __init__(self,args):
self.__args = args
self.__soc = "gfx908"
# Required methods to be implemented by child classes
@demarcate
def profiling_setup(self):
"""Perform any SoC-specific setup prior to profiling.
"""
logging.debug("[profiling] perform profiling setup for %s" % self.__soc)
@demarcate
def analysis_setup(self):
"""Perform any SoC-specific setup prior to analysis.
"""
logging.debug("[analysis] perform analysis setup for %s" % self.__soc)
+45
Переглянути файл
@@ -0,0 +1,45 @@
##############################################################################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
# 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
import logging
from soc_base import OmniSoC_Base
from utils.utils import demarcate
class gfx90a_soc (OmniSoC_Base):
def __init__(self,args):
self.__args = args
self.__soc = "gfx90a"
# Required methods to be implemented by child classes
@demarcate
def profiling_setup(self):
"""Perform any SoC-specific setup prior to profiling.
"""
logging.debug("[profiling] perform profiling setup for %s" % self.__soc)
@demarcate
def analysis_setup(self):
"""Perform any SoC-specific setup prior to analysis.
"""
logging.debug("[analysis] perform analysis setup for %s" % self.__soc)
+36
Переглянути файл
@@ -0,0 +1,36 @@
##############################################################################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
# 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
import logging
def demarcate(function):
def wrap_function(*args, **kwargs):
logging.trace("----- [entering function] -> %s()" % (function.__qualname__))
result = function(*args, **kwargs)
logging.trace("----- [exiting function] -> %s()" % function.__qualname__)
return result
return wrap_function
def trace_logger(message, *args, **kwargs):
logging.log(logging.TRACE, message, *args, **kwargs)