adding roctx instrumentation to MatrixTranspose test

Bu işleme şunda yer alıyor:
Evgeny
2019-11-25 16:17:29 -06:00
ebeveyn a0a993bf0d
işleme 74bf95082a
2 değiştirilmiş dosya ile 12 ekleme ve 2 silme
+11 -1
Dosyayı Görüntüle
@@ -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);