User regions in Python (#57)
* User regions in Python
* User-region testing + common submodule
- Updated examples/python/source.py to use user-regions
- Python-level user submodule
- Python-level common submodule
- clean-up of profiler python code
- extended source.py testing to include the user-regions
[ROCm/rocprofiler-systems commit: 4dd144a32c]
Bu işleme şunda yer alıyor:
işlemeyi yapan:
GitHub
ebeveyn
10fbc81adc
işleme
d2a39b9066
@@ -1201,7 +1201,7 @@ foreach(_VERSION ${OMNITRACE_PYTHON_VERSIONS})
|
||||
PYTHON_EXECUTABLE ${_PYTHON_EXECUTABLE}
|
||||
PYTHON_VERSION ${_VERSION}
|
||||
FILE ${CMAKE_SOURCE_DIR}/examples/python/source.py
|
||||
RUN_ARGS -v 5 -n 5
|
||||
RUN_ARGS -v 5 -n 5 -s 3
|
||||
ENVIRONMENT "${_python_environment}")
|
||||
|
||||
# ---------------------------------------------------------------------------------- #
|
||||
@@ -1285,39 +1285,45 @@ foreach(_VERSION ${OMNITRACE_PYTHON_VERSIONS})
|
||||
ENVIRONMENT "${_python_environment}")
|
||||
endfunction()
|
||||
|
||||
set(python_source_labels
|
||||
main_loop
|
||||
run
|
||||
fib
|
||||
fib
|
||||
fib
|
||||
fib
|
||||
fib
|
||||
inefficient
|
||||
_sum)
|
||||
set(python_source_count
|
||||
5
|
||||
3
|
||||
3
|
||||
6
|
||||
12
|
||||
18
|
||||
6
|
||||
3
|
||||
3)
|
||||
set(python_source_depth
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
2
|
||||
3)
|
||||
|
||||
omnitrace_add_python_validation_test(
|
||||
NAME python-source
|
||||
TIMEMORY_METRIC "trip_count"
|
||||
TIMEMORY_FILE "trip_count.json"
|
||||
PERFETTO_METRIC "host;user"
|
||||
PERFETTO_FILE "perfetto-trace.proto"
|
||||
ARGS -l
|
||||
run
|
||||
fib
|
||||
fib
|
||||
fib
|
||||
fib
|
||||
fib
|
||||
inefficient
|
||||
_sum
|
||||
-c
|
||||
5
|
||||
5
|
||||
10
|
||||
20
|
||||
30
|
||||
10
|
||||
5
|
||||
5
|
||||
-d
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
1
|
||||
2)
|
||||
ARGS -l ${python_source_labels} -c ${python_source_count} -d
|
||||
${python_source_depth})
|
||||
|
||||
math(EXPR _INDEX "${_INDEX} + 1")
|
||||
endforeach()
|
||||
|
||||
@@ -25,9 +25,9 @@ def validate_json(data, labels, counts, depths):
|
||||
if _prefix != eitr[0]:
|
||||
raise RuntimeError(f"Mismatched prefix: {_prefix} vs. {eitr[0]}")
|
||||
if _count != eitr[1]:
|
||||
raise RuntimeError(f"Mismatched count: {_count} vs. {eitr[1]}")
|
||||
raise RuntimeError(f"Mismatched count for {_prefix}: {_count} vs. {eitr[1]}")
|
||||
if _depth != eitr[2]:
|
||||
raise RuntimeError(f"Mismatched depth: {_depth} vs. {eitr[2]}")
|
||||
raise RuntimeError(f"Mismatched depth for {_prefix}: {_depth} vs. {eitr[2]}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle