mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-27 11:03:47 +08:00
0b2c431d3a
version: sunnypilot v2026.003.000 (dev)
date: 2026-09-14T15:43:39
master commit: a5f44653d7
17 lines
470 B
Plaintext
17 lines
470 B
Plaintext
#pragma once
|
|
|
|
#include <iostream>
|
|
|
|
#define CHECK_CUDA_ERROR(val) check((val), #val, __FILE__, __LINE__)
|
|
template <typename T>
|
|
void check(T err, char const* const func, char const* const file,
|
|
int const line)
|
|
{
|
|
if (err != hipSuccess)
|
|
{
|
|
std::cerr << "HIP Runtime Error at: " << file << ":" << line
|
|
<< std::endl;
|
|
std::cerr << hipGetErrorString(err) << " " << func << std::endl;
|
|
//std::exit(EXIT_FAILURE);
|
|
}
|
|
} |