Update bandwidth and latency calculations

- Refined bandwidth and latency calculations for improved accuracy
This commit is contained in:
avinashkethineedi
2025-02-17 06:18:46 +00:00
parent 40bd8a38a0
commit c155636da4
26 changed files with 283 additions and 270 deletions
+7 -5
View File
@@ -29,9 +29,11 @@ using namespace rocshmem;
/******************************************************************************
* DEVICE TEST KERNEL
*****************************************************************************/
__global__ void PingPongTest(int loop, int skip, uint64_t *timer, int *r_buf,
__global__ void PingPongTest(int loop, int skip, long long int *start_time,
long long int *end_time, int *r_buf,
ShmemContextType ctx_type) {
__shared__ rocshmem_ctx_t ctx;
int wg_id = get_flat_grid_id();
rocshmem_wg_init();
rocshmem_wg_ctx_create(ctx_type, &ctx);
@@ -39,11 +41,10 @@ __global__ void PingPongTest(int loop, int skip, uint64_t *timer, int *r_buf,
int pe = rocshmem_ctx_my_pe(ctx);
if (hipThreadIdx_x == 0) {
uint64_t start;
for (int i = 0; i < loop + skip; i++) {
if (i == skip) {
start = rocshmem_timer();
start_time[wg_id] = wall_clock64();
}
if (pe == 0) {
@@ -56,7 +57,7 @@ __global__ void PingPongTest(int loop, int skip, uint64_t *timer, int *r_buf,
rocshmem_ctx_int_p(ctx, &r_buf[hipBlockIdx_x], i + 1, 0);
}
}
timer[hipBlockIdx_x] = rocshmem_timer() - start;
end_time[wg_id] = wall_clock64();
}
rocshmem_wg_ctx_destroy(&ctx);
rocshmem_wg_finalize();
@@ -80,7 +81,8 @@ void PingPongTester::launchKernel(dim3 gridSize, dim3 blockSize, int loop,
size_t shared_bytes = 0;
hipLaunchKernelGGL(PingPongTest, gridSize, blockSize, shared_bytes, stream,
loop, args.skip, timer, r_buf, _shmem_context);
loop, args.skip, start_time, end_time, r_buf,
_shmem_context);
num_msgs = (loop + args.skip) * gridSize.x;
num_timed_msgs = loop;