tinygrad/extra/thunder/amd/include/pyutils/util.cuh
2026-06-17 22:35:36 -07:00

17 lines
No EOL
470 B
Text

#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);
}
}