silence warnings in functional testsuite

check the return code of hip functions in order to silence some
warnings.


[ROCm/rocshmem commit: 7e7bc4b0a9]
This commit is contained in:
Edgar Gabriel
2024-07-02 10:07:43 -07:00
parent bce3a09408
commit ac3c18bc7c
11 changed files with 50 additions and 40 deletions
@@ -135,9 +135,9 @@ RandomAccessTester::RandomAccessTester(TesterArguments args) : Tester(args) {
r_buf = (int *)roc_shmem_malloc(max_size * wg_size * space);
h_buf = (int *)malloc(max_size * wg_size * space);
h_dev_buf = (int *)malloc(max_size * wg_size * space);
hipMalloc((void **)&_threads_bins, sizeof(uint32_t) * _num_waves * _num_bins);
hipMalloc((void **)&_off_bins, sizeof(uint32_t) * _num_waves * _num_bins);
hipMalloc((void **)&_PE_bins, sizeof(uint32_t) * _num_waves * _num_bins);
CHECK_HIP(hipMalloc((void **)&_threads_bins, sizeof(uint32_t) * _num_waves * _num_bins));
CHECK_HIP(hipMalloc((void **)&_off_bins, sizeof(uint32_t) * _num_waves * _num_bins));
CHECK_HIP(hipMalloc((void **)&_PE_bins, sizeof(uint32_t) * _num_waves * _num_bins));
memset(_threads_bins, 0, sizeof(uint32_t) * _num_waves * _num_bins);
memset(_off_bins, 0, sizeof(uint32_t) * _num_waves * _num_bins);
memset(_PE_bins, 0, sizeof(uint32_t) * _num_waves * _num_bins);
@@ -148,9 +148,9 @@ RandomAccessTester::~RandomAccessTester() {
roc_shmem_free(r_buf);
free(h_buf);
free(h_dev_buf);
hipFree(_threads_bins);
hipFree(_off_bins);
hipFree(_PE_bins);
CHECK_HIP(hipFree(_threads_bins));
CHECK_HIP(hipFree(_off_bins));
CHECK_HIP(hipFree(_PE_bins));
}
void RandomAccessTester::resetBuffers(uint64_t size) {
@@ -209,9 +209,9 @@ void RandomAccessTester::verifyResults(uint64_t size) {
}
}
hipMemcpy(h_dev_buf, r_buf, space * args.wg_size * size,
hipMemcpyDeviceToHost);
hipDeviceSynchronize();
CHECK_HIP(hipMemcpy(h_dev_buf, r_buf, space * args.wg_size * size,
hipMemcpyDeviceToHost));
CHECK_HIP(hipDeviceSynchronize());
for (i = 0; i < (space * args.wg_size * size / sizeof(int)); i++) {
if (h_dev_buf[i] != h_buf[i]) {
printf("PE %d Got Data Validation: expecting %d got %d at %d \n",