Improve the roctx markers performance when the tracer is not engaged
(the application is not running with rocprof).
The performance of roctx push/pop, measured with:
-----------------------------------------------------------------------
auto start = std::chrono::steady_clock::now();
for (int i = 0; i < 10000000; ++i) {
roctxRangePush ("A");
roctxRangePop ();
}
auto end = std::chrono::steady_clock::now();
std::cout << "ns = " << std::chrono::nanoseconds(end - start).count()
/ 10000000 << std::endl;
-----------------------------------------------------------------------
w/o rocprof | with rocprof | commit
92ns | 770ns | 0d6e132: Cleanup CallbackTable::Get
28ns | 712ns | 6421bd5: Cleanup ROCTX's implementation
20ns | 664ns | 7f0e5e5: Remove the roctx range message...
6ns | 665ns | this commit
Change-Id: Id679dcbd0fb190a3179be98a9b2c1db151efee3d
[ROCm/roctracer commit: a794247c55]
ROC-tracer
-
ROC-tracer library: Runtimes Generic Callback/Activity APIs
The goal of the implementation is to provide a generic independent from specific runtime profiler to trace API and asynchronous activity.
The API provides functionality for registering the runtimes API callbacks and asynchronous activity records pool support.
-
ROC-TX library: Code Annotation Events API
Includes API for:
roctxMarkroctxRangePushroctxRangePop
Usage
rocTracer API
To use the rocTracer API you need the API header and to link your application with roctracer .so library:
-
/opt/rocm/roctracer/include/roctracer.hAPI header.
-
/opt/rocm/lib/libroctracer64.so.so library.
rocTX API
To use the rocTX API you need the API header and to link your application with roctx .so library:
-
/opt/rocm/roctracer/include/roctx.hAPI header.
-
/opt/rocm/lib/libroctx64.so.so library.
Library source tree
-
docDocumentation.
-
incInclude header files.
-
roctracer.hrocTacerlibrary public API header. -
roctx.hrocTXlibrary public API header.
-
-
srcLibrary sources.
-
corerocTracerlibrary API sources. -
roctxrocTXlibrary API sources. -
utilLibrary utils sources.
-
-
testTest suit.
-
MatrixTransposeTest based on HIP MatrixTranspose sample.
-
Documentation
- API description:
- Code examples:
Build and run tests
-
ROCm is required
-
Python modules requirements:
CppHeaderParser,argparse.To install:
pip3 install CppHeaderParser argparse -
Clone development branch of
roctracer:git clone -b amd-master https://github.com/ROCm-Developer-Tools/roctracer -
To build
roctracerlibrary:cd <your path>/roctracer mkdir build && cd build cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_INSTALL_PREFIX=/opt/rocm .. make -
To build and run test:
make mytest run.sh
Installation
Install by:
make install
or:
make package && dpkg -i *.deb