ColossalAI/extensions/csrc/cuda/utils/micros.h

15 lines
457 B
C
Raw Normal View History

2024-03-08 06:53:29 +00:00
#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)); \
} \
2024-03-08 06:53:29 +00:00
}