Files
rocm-systems/src/omniperf
T

52 lines
1.8 KiB
Python
Raw Normal View History

2022-11-04 14:49:36 -05:00
#!/usr/bin/env python3
2023-02-13 09:26:12 -06:00
##############################################################################bl
# MIT License
2023-02-13 14:50:24 -06:00
#
2024-01-24 17:11:39 -06:00
# Copyright (c) 2021 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
2023-02-13 14:50:24 -06:00
#
2022-11-04 14:49:36 -05:00
# 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:
2023-02-13 14:50:24 -06:00
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
2023-02-13 14:50:24 -06:00
#
2022-11-04 14:49:36 -05:00
# 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
2022-11-04 14:49:36 -05:00
# 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.
2023-02-13 09:26:12 -06:00
##############################################################################el
2022-11-04 14:49:36 -05:00
import sys
import logging
2023-10-31 15:11:17 -05:00
from omniperf_base import Omniperf
2024-01-30 17:25:16 -06:00
from utils.utils import console_error
2022-11-04 14:49:36 -05:00
def main():
2023-10-31 15:11:17 -05:00
omniperf = Omniperf()
2023-10-31 15:11:17 -05:00
mode = omniperf.get_mode()
2023-10-31 15:11:17 -05:00
# major omniperf execution modes
if mode == "profile":
omniperf.run_profiler()
elif mode == "database":
2024-01-30 10:43:30 -06:00
omniperf.update_db()
2023-10-31 15:11:17 -05:00
elif mode == "analyze":
omniperf.run_analysis()
else:
2024-01-30 17:25:16 -06:00
console_error("Unsupported execution mode")
2022-11-04 14:49:36 -05:00
sys.exit(0)
2022-11-04 14:49:36 -05:00
if __name__ == "__main__":
main()