/* * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * * SPDX-License-Identifier: MIT */ #include #include #include "hip/hip_runtime.h" #ifndef checkHipErrors #define checkHipErrors(err) __checkHipErrors(err, __FILE__, __LINE__) inline void __checkHipErrors(hipError_t err, const char* file, const int line) { if (HIP_SUCCESS != err) { const char* errorStr = hipGetErrorString(err); fprintf(stderr, "checkHipErrors() HIP API error = %04d \"%s\" from file <%s>, " "line %i.\n", err, errorStr, file, line); exit(EXIT_FAILURE); } } #endif