To use C++ APIs, include the header AMDProfileController.h. Path of this header is: <Installation Directory>/include/AMDProfileController.h. Example: ~/Foo/Bar/AMDuProf_Linux_x64_5.0.775/include/AMDProfileController.h . Hence, that folder must be in the include path, while building the instrumented application.
For linking, the library, include the library path of libAMDProfileController.so, whose path is: <Installation Directory>/lib/x64/shared/libAMDProfileController.so
There are four C++ based APIs for supporting domain and task.
| API and description | Parameters | Returns |
|---|---|---|
|
This function creates a domain with specified name "name" and returns the handle, as void pointer. If called multiple times within same scope, it returns the same handle. |
const char* name: Name of the domain. It can
contain space, period, etc. such as
amd.com.uprof
|
Handle as void* to the created domain. |
|
This function create the specified string "name", given in the argument and returns the handle, as unsigned long pointer. |
const char* name: Name associated with the handle, which is used as task name. | Handle as void* to the created string. |
|
Marks the beginning of the task in this domain. |
|
Nothing |
|
Marks the end of the task, which was begun by latest(last) runtime call of amdTaskBegin(...) with same domain. |
void* domainHandle: a valid domain handle created by amdDomainCreate(...). | Nothing |
void *execDomain = amdDomainCreate ("Main.ExecuteBenchmark");
void *mulStr = amdStringHandleCreate ("MultiplyMatrices");
// some activities, not within task
int matrixSize =1000;
initialize_matrices(matrixSize);
amdTaskBegin (execDomain, 0, 0, mulStr);
// some activities within task
multiply_matrices(1000);
printOutout();
amdTaskEnd (execDomain);
// some activities, not within task
CleanUp();