Update bandwidth and latency calculations

- Refined bandwidth and latency calculations for improved accuracy


[ROCm/rocshmem commit: c155636da4]
Αυτή η υποβολή περιλαμβάνεται σε:
avinashkethineedi
2025-02-17 06:18:46 +00:00
γονέας 04889cb71c
υποβολή dba989733f
26 αρχεία άλλαξαν με 283 προσθήκες και 270 διαγραφές
@@ -31,11 +31,13 @@ using namespace rocshmem;
/******************************************************************************
* DEVICE TEST KERNEL
*****************************************************************************/
__global__ void ExtendedPrimitiveTest(int loop, int skip, uint64_t *timer,
char *s_buf, char *r_buf, int size,
TestType type,
__global__ void ExtendedPrimitiveTest(int loop, int skip,
long long int *start_time,
long long int *end_time, char *s_buf,
char *r_buf, int size, TestType type,
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);
@@ -44,13 +46,14 @@ __global__ void ExtendedPrimitiveTest(int loop, int skip, uint64_t *timer,
* If the number of work groups is greater than 1, this kernel performs a
* tiled functional test
*/
uint64_t start;
uint64_t idx = size * get_flat_grid_id();
s_buf += idx;
r_buf += idx;
for (int i = 0; i < loop + skip; i++) {
if (i == skip) start = rocshmem_timer();
if (i == skip) {
start_time[wg_id] = wall_clock64();
}
switch (type) {
case WGGetTestType:
@@ -73,7 +76,7 @@ __global__ void ExtendedPrimitiveTest(int loop, int skip, uint64_t *timer,
rocshmem_ctx_quiet(ctx);
if (hipThreadIdx_x == 0) {
timer[hipBlockIdx_x] = rocshmem_timer() - start;
end_time[wg_id] = wall_clock64();
}
rocshmem_wg_ctx_destroy(&ctx);
@@ -105,8 +108,8 @@ void ExtendedPrimitiveTester::launchKernel(dim3 gridSize, dim3 blockSize,
size_t shared_bytes = 0;
hipLaunchKernelGGL(ExtendedPrimitiveTest, gridSize, blockSize, shared_bytes,
stream, loop, args.skip, timer, (char*)s_buf,
(char*)r_buf, size, _type, _shmem_context);
stream, loop, args.skip, start_time, end_time,
(char*)s_buf, (char*)r_buf, size, _type, _shmem_context);
num_msgs = (loop + args.skip) * gridSize.x;
num_timed_msgs = loop * gridSize.x;