5656Tester::Tester (TesterArguments args) : args(args) {
5757 _type = (TestType)args.algorithm ;
5858 _shmem_context = args.shmem_context ;
59- hipStreamCreate (&stream);
60- hipEventCreate (&start_event);
61- hipEventCreate (&stop_event);
62- hipMalloc ((void **)&timer, sizeof (uint64_t ) * args.num_wgs );
59+ CHECK_HIP ( hipStreamCreate (&stream) );
60+ CHECK_HIP ( hipEventCreate (&start_event) );
61+ CHECK_HIP ( hipEventCreate (&stop_event) );
62+ CHECK_HIP ( hipMalloc ((void **)&timer, sizeof (uint64_t ) * args.num_wgs ) );
6363}
6464
6565Tester::~Tester () {
66- hipFree (timer);
67- hipEventDestroy (stop_event);
68- hipEventDestroy (start_event);
69- hipStreamDestroy (stream);
66+ CHECK_HIP ( hipFree (timer) );
67+ CHECK_HIP ( hipEventDestroy (stop_event) );
68+ CHECK_HIP ( hipEventDestroy (start_event) );
69+ CHECK_HIP ( hipStreamDestroy (stream) );
7070}
7171
7272std::vector<Tester*> Tester::create (TesterArguments args) {
@@ -538,11 +538,11 @@ void Tester::execute() {
538538 const dim3 blockSize (args.wg_size , 1 , 1 );
539539 const dim3 gridSize (args.num_wgs , 1 , 1 );
540540
541- hipEventRecord (start_event, stream);
541+ CHECK_HIP ( hipEventRecord (start_event, stream) );
542542
543543 launchKernel (gridSize, blockSize, num_loops, size);
544544
545- hipEventRecord (stop_event, stream);
545+ CHECK_HIP ( hipEventRecord (stop_event, stream) );
546546
547547 hipError_t err = hipStreamSynchronize (stream);
548548 if (err != hipSuccess) {
@@ -601,7 +601,7 @@ void Tester::print(uint64_t size) {
601601 double avg_msg_rate = num_timed_msgs / (timer_avg / 1e6 );
602602
603603 float total_kern_time_ms;
604- hipEventElapsedTime (&total_kern_time_ms, start_event, stop_event);
604+ CHECK_HIP ( hipEventElapsedTime (&total_kern_time_ms, start_event, stop_event) );
605605 float total_kern_time_s = total_kern_time_ms / 1000 ;
606606 double bandwidth_avg_gbs =
607607 num_msgs * size * bw_factor / total_kern_time_s / pow (2 , 30 );
@@ -624,9 +624,9 @@ void Tester::print(uint64_t size) {
624624void flush_hdp () {
625625 int hip_dev_id{};
626626 unsigned int * hdp_flush_ptr_{nullptr };
627- hipGetDevice (&hip_dev_id);
628- hipDeviceGetAttribute (reinterpret_cast <int *>(&hdp_flush_ptr_),
629- hipDeviceAttributeHdpMemFlushCntl, hip_dev_id);
627+ CHECK_HIP ( hipGetDevice (&hip_dev_id) );
628+ CHECK_HIP ( hipDeviceGetAttribute (reinterpret_cast <int *>(&hdp_flush_ptr_),
629+ hipDeviceAttributeHdpMemFlushCntl, hip_dev_id)) ;
630630 __atomic_store_n (hdp_flush_ptr_, 0x1 , __ATOMIC_SEQ_CST);
631631}
632632
0 commit comments