mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2026-07-12 02:38:52 +00:00
15 lines
457 B
C++
15 lines
457 B
C++
#pragma once
|
|
|
|
#include <cuda.h>
|
|
#include <cuda_runtime.h>
|
|
|
|
#include <exception>
|
|
|
|
#define CUDA_CHECK(func) \
|
|
{ \
|
|
auto status = func; \
|
|
if (status != cudaSuccess) { \
|
|
throw std::runtime_error(cudaGetErrorString(status)); \
|
|
} \
|
|
}
|