@@ -460,7 +460,7 @@ static int get_counter_availability(cuptip_gpu_state_t *gpu_ctl)
460460
461461 // Allocate the necessary memory for data
462462 gpu_ctl -> counterAvailabilityImage .size = getCounterAvailabilityParams .counterAvailabilityImageSize ;
463- gpu_ctl -> counterAvailabilityImage .data = (uint8_t * ) papi_malloc (gpu_ctl -> counterAvailabilityImage .size );
463+ gpu_ctl -> counterAvailabilityImage .data = (uint8_t * ) malloc (gpu_ctl -> counterAvailabilityImage .size );
464464 if (gpu_ctl -> counterAvailabilityImage .data == NULL ) {
465465 ERRDBG ("Failed to allocate memory for counterAvailabilityImage.data.\n" );
466466 return PAPI_ENOMEM ;
@@ -484,23 +484,23 @@ void free_and_reset_configuration_images(cuptip_gpu_state_t *gpu_ctl)
484484 COMPDBG ("Entering.\n" );
485485 // Note that you can find the memory allocation for the below variables
486486 // in cuptip_ctx_start as of April 21st, 2025
487- papi_free (gpu_ctl -> configImage .data );
487+ free (gpu_ctl -> configImage .data );
488488 gpu_ctl -> configImage .data = NULL ;
489489 gpu_ctl -> configImage .size = 0 ;
490490
491- papi_free (gpu_ctl -> counterDataPrefixImage .data );
491+ free (gpu_ctl -> counterDataPrefixImage .data );
492492 gpu_ctl -> counterDataPrefixImage .data = NULL ;
493493 gpu_ctl -> counterDataPrefixImage .size = 0 ;
494494
495- papi_free (gpu_ctl -> counterDataScratchBuffer .data );
495+ free (gpu_ctl -> counterDataScratchBuffer .data );
496496 gpu_ctl -> counterDataScratchBuffer .data = NULL ;
497497 gpu_ctl -> counterDataScratchBuffer .size = 0 ;
498498
499- papi_free (gpu_ctl -> counterDataImage .data );
499+ free (gpu_ctl -> counterDataImage .data );
500500 gpu_ctl -> counterDataImage .data = NULL ;
501501 gpu_ctl -> counterDataImage .size = 0 ;
502502
503- papi_free (gpu_ctl -> counterAvailabilityImage .data );
503+ free (gpu_ctl -> counterAvailabilityImage .data );
504504 gpu_ctl -> counterAvailabilityImage .data = NULL ;
505505 gpu_ctl -> counterAvailabilityImage .size = 0 ;
506506}
@@ -534,7 +534,7 @@ static int init_main_htable(void)
534534 val *= base ;
535535 }
536536
537- cuptiu_table_p = (cuptiu_event_table_t * ) papi_malloc (sizeof (cuptiu_event_table_t ));
537+ cuptiu_table_p = (cuptiu_event_table_t * ) malloc (sizeof (cuptiu_event_table_t ));
538538 if (cuptiu_table_p == NULL ) {
539539 ERRDBG ("Failed to allocate memory for cuptiu_table_p.\n" );
540540 return PAPI_ENOMEM ;
@@ -543,19 +543,19 @@ static int init_main_htable(void)
543543 cuptiu_table_p -> count = 0 ;
544544 cuptiu_table_p -> event_stats_count = 0 ;
545545
546- cuptiu_table_p -> events = (cuptiu_event_t * ) papi_calloc (val , sizeof (cuptiu_event_t ));
546+ cuptiu_table_p -> events = (cuptiu_event_t * ) calloc (val , sizeof (cuptiu_event_t ));
547547 if (cuptiu_table_p -> events == NULL ) {
548548 ERRDBG ("Failed to allocate memory for cuptiu_table_p->events.\n" );
549549 return PAPI_ENOMEM ;
550550 }
551551
552- cuptiu_table_p -> event_stats = (StringVector * ) papi_calloc (val , sizeof (StringVector ));
552+ cuptiu_table_p -> event_stats = (StringVector * ) calloc (val , sizeof (StringVector ));
553553 if (cuptiu_table_p -> event_stats == NULL ) {
554554 ERRDBG ("Failed to allocate memory for cuptiu_table_p->event_stats.\n" );
555555 return PAPI_ENOMEM ;
556556 }
557557
558- cuptiu_table_p -> avail_gpu_info = (gpu_record_t * ) papi_calloc (numDevicesOnMachine , sizeof (gpu_record_t ));
558+ cuptiu_table_p -> avail_gpu_info = (gpu_record_t * ) calloc (numDevicesOnMachine , sizeof (gpu_record_t ));
559559 if (cuptiu_table_p -> avail_gpu_info == NULL ) {
560560 ERRDBG ("Failed to allocate memory for cuptiu_table_p->avail_gpu_info.\n" );
561561 return PAPI_ENOMEM ;
@@ -732,19 +732,19 @@ int cuptip_ctx_create(cuptic_info_t thr_info, cuptip_control_t *pstate, uint32_t
732732{
733733 COMPDBG ("Entering.\n" );
734734
735- cuptip_control_t state = (cuptip_control_t ) papi_calloc (1 , sizeof (struct cuptip_control_s ));
735+ cuptip_control_t state = (cuptip_control_t ) calloc (1 , sizeof (struct cuptip_control_s ));
736736 if (state == NULL ) {
737737 SUBDBG ("Failed to allocate memory for state.\n" );
738738 return PAPI_ENOMEM ;
739739 }
740740
741- state -> gpu_ctl = (cuptip_gpu_state_t * ) papi_calloc (numDevicesOnMachine , sizeof (cuptip_gpu_state_t ));
741+ state -> gpu_ctl = (cuptip_gpu_state_t * ) calloc (numDevicesOnMachine , sizeof (cuptip_gpu_state_t ));
742742 if (state -> gpu_ctl == NULL ) {
743743 SUBDBG ("Failed to allocate memory for state->gpu_ctl.\n" );
744744 return PAPI_ENOMEM ;
745745 }
746746
747- long long * counters = (long long * ) papi_malloc (num_events * sizeof (* counters ));
747+ long long * counters = (long long * ) malloc (num_events * sizeof (* counters ));
748748 if (counters == NULL ) {
749749 SUBDBG ("Failed to allocate memory for counters.\n" );
750750 return PAPI_ENOMEM ;
@@ -1034,7 +1034,7 @@ int cuptip_ctx_read(cuptip_control_t state, long long **counters)
10341034 }
10351035 }
10361036 }
1037- papi_free (metricValues );
1037+ free (metricValues );
10381038 * counters = counter_vals ;
10391039
10401040 papi_errno = begin_pass ();
@@ -1165,15 +1165,15 @@ int cuptip_ctx_destroy(cuptip_control_t *pstate)
11651165 // Free the created rawMetricRequests from cuptip_ctx_start
11661166 int j ;
11671167 for (j = 0 ; j < state -> gpu_ctl [i ].numberOfRawMetricRequests ; j ++ ) {
1168- papi_free ((void * ) state -> gpu_ctl [i ].rawMetricRequests [j ].pMetricName );
1168+ free ((void * ) state -> gpu_ctl [i ].rawMetricRequests [j ].pMetricName );
11691169 }
1170- papi_free (state -> gpu_ctl [i ].rawMetricRequests );
1170+ free (state -> gpu_ctl [i ].rawMetricRequests );
11711171 }
11721172
11731173 // Free the allocated memory from cuptip_ctx_create
1174- papi_free (state -> counters );
1175- papi_free (state -> gpu_ctl );
1176- papi_free (state );
1174+ free (state -> counters );
1175+ free (state -> gpu_ctl );
1176+ free (state );
11771177 * pstate = NULL ;
11781178
11791179 return PAPI_OK ;
@@ -1522,13 +1522,13 @@ static void shutdown_event_table(void)
15221522{
15231523 cuptiu_table_p -> count = 0 ;
15241524
1525- papi_free (cuptiu_table_p -> avail_gpu_info );
1525+ free (cuptiu_table_p -> avail_gpu_info );
15261526 cuptiu_table_p -> avail_gpu_info = NULL ;
15271527
1528- papi_free (cuptiu_table_p -> events );
1528+ free (cuptiu_table_p -> events );
15291529 cuptiu_table_p -> events = NULL ;
15301530
1531- papi_free (cuptiu_table_p );
1531+ free (cuptiu_table_p );
15321532 cuptiu_table_p = NULL ;
15331533}
15341534
@@ -1545,7 +1545,7 @@ static void shutdown_event_stats_table(void)
15451545
15461546 cuptiu_table_p -> event_stats_count = 0 ;
15471547
1548- papi_free (cuptiu_table_p -> event_stats );
1548+ free (cuptiu_table_p -> event_stats );
15491549}
15501550
15511551/** @class cuptip_evt_enum
0 commit comments