Files
rocm-systems/projects/rocprofiler-compute/sample/common.h
T
systems-assistant[bot] ee9e74df21 Add 'projects/rocprofiler-compute/' from commit 'd2cec001161fc49761bd71a498474a447b1d6975'
git-subtree-dir: projects/rocprofiler-compute
git-subtree-mainline: 8a4d7262f8
git-subtree-split: d2cec00116
2025-07-17 18:13:42 +00:00

18 خطوط
969 B
C++

#pragma once
#include <hip/hip_runtime.h>
#include <iostream>
#define hipCheck(stmt) \
do { \
hipError_t err = stmt; \
if (err != hipSuccess) { \
char msg[256]; \
sprintf(msg, "%s in file %s, function %s, line %d\n", #stmt, __FILE__, \
__FUNCTION__, __LINE__); \
std::string errstring = hipGetErrorString(err); \
std::cerr << msg << "\t" << errstring << std::endl; \
throw std::runtime_error(msg); \
} \
} while (0)