adding roctx instrumentation to MatrixTranspose test

[ROCm/roctracer commit: 74bf95082a]
Αυτή η υποβολή περιλαμβάνεται σε:
Evgeny
2019-11-25 16:17:29 -06:00
γονέας c1ed67407a
υποβολή 66ef9721d2
2 αρχεία άλλαξαν με 12 προσθήκες και 2 διαγραφές
@@ -1,6 +1,6 @@
ROOT_PATH = ../..
LIB_PATH = $(ROOT_PATH)/build
ROC_LIBS = -Wl,--rpath,${LIB_PATH} $(LIB_PATH)/libroctracer64.so
ROC_LIBS = -Wl,--rpath,${LIB_PATH} $(LIB_PATH)/libroctracer64.so $(LIB_PATH)/libroctx64.so
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
@@ -23,8 +23,10 @@ THE SOFTWARE.
#include <iostream>
// hip header file
#include "hip/hip_runtime.h"
#include <hip/hip_runtime.h>
#include "roctracer_ext.h"
// roctx header file
#include <inc/roctx.h>
#define WIDTH 1024
@@ -94,15 +96,23 @@ int main() {
hipMemcpy(gpuMatrix, Matrix, NUM * sizeof(float), hipMemcpyHostToDevice);
roctracer_mark("before HIP LaunchKernel");
roctxMark("before hipLaunchKernel");
roctxRangePush("hipLaunchKernel");
// Lauching kernel from host
hipLaunchKernelGGL(matrixTranspose, dim3(WIDTH / THREADS_PER_BLOCK_X, WIDTH / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, gpuTransposeMatrix,
gpuMatrix, WIDTH);
roctracer_mark("after HIP LaunchKernel");
roctxMark("after hipLaunchKernel");
// Memory transfer from device to host
roctxRangePush("hipMemcpy");
hipMemcpy(TransposeMatrix, gpuTransposeMatrix, NUM * sizeof(float), hipMemcpyDeviceToHost);
roctxRangePop(); // for "hipMemcpy"
roctxRangePop(); // for "hipLaunchKernel"
// CPU MatrixTranspose computation
matrixTransposeCPUReference(cpuTransposeMatrix, Matrix, WIDTH);