Files
rocm-systems/projects/rocprofiler-compute/src/omniperf
T

48 строки
1.8 KiB
Python
Исходник Обычный вид История

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
#
# Copyright (c) 2021 - 2023 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
2023-10-31 15:11:17 -05:00
from omniperf_base import Omniperf
2022-11-04 14:49:36 -05:00
def main():
2023-10-31 15:11:17 -05:00
omniperf = Omniperf()
omniperf.parse_args() #TODO: We already do this in the __init__ for Omniperf(). Change that?
2022-11-04 14:49:36 -05:00
2023-10-31 15:11:17 -05:00
mode = omniperf.get_mode()
2022-11-04 14:49:36 -05:00
2023-10-31 15:11:17 -05:00
# major omniperf execution modes
if mode == "profile":
omniperf.run_profiler()
elif mode == "database":
omniperf.update_DB()
elif mode == "analyze":
omniperf.run_analysis()
else:
omniperf.error("Unsupported execution mode")
2022-11-04 14:49:36 -05:00
if __name__ == "__main__":
main()