// Copyright © Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #pragma once #include #include #define HIP_CHECK(status) \ do \ { \ if((status) != hipSuccess) \ { \ std::cerr << "HIP Error: " << hipGetErrorString((status)) << " in file " << __FILE__ \ << " at line " << __LINE__ << "\n"; \ exit(EXIT_FAILURE); \ } \ } while(0) #define HIPDNN_CHECK(status) \ do \ { \ if((status) != HIPDNN_STATUS_SUCCESS) \ { \ std::cerr << "hipDNN Error: " << hipdnnGetErrorString((status)) << " in file " \ << __FILE__ << " at line " << __LINE__ << "\n"; \ exit(EXIT_FAILURE); \ } \ } while(0) #define HIPDNN_FE_CHECK(statusObj) \ do \ { \ auto const& status = statusObj; \ if(!status.is_good()) \ { \ std::cerr << "hipDNN Frontend Error: " << status.get_message() << " in file " \ << __FILE__ << " at line " << __LINE__ << "\n"; \ exit(EXIT_FAILURE); \ } \ } while(0)