About the Sample
- The first portion of code is the multiplication of two matrices. Matrices in this sample are square, and you can set their size.
- The second calculates the Nth approximation of the number 2 / pi. You can set the parameter N, an increase in N leads to an increase in the accuracy of the approximation.
- The last one includes both parts – matrix multiplication and approximation 2 / pi.
- __itt_domain_create(domain_name)- Create ITT domain.
- __itt_string_handle_create(measurement_name)- Create ITT task handle.
- __itt_task_begin(domain, __itt_null, __itt_null, measurement)- Collect the measurement start time based on the CPU’s timestamp counter (TSC).
- __itt_task_end(domain)- Collect the measurement end time based on the TSC and calculate the difference between the start and end times to get the latency measurement.
- The sample starts by defining the ITT domain and the task handle.
- When all the required variables are initialized, the sample runs therun_measurement_cyclefunction which starts two workloads:
- The first workload executes matrices multiplication.
- The second workload calculates the Nth approximation of the 2/pi number.
- The sample measures the overall latency for both workloads and the latencies for each workload.