improved cuda error checking

This commit is contained in:
djaidjai committed 2025-01-06 13:18:19 +01:00
1 parent edf4d9fd60
commit 04defb563f
5 files changed
+46 -88

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#include "cuda_error.h"
#include "cuda_runtime.h"
#include <iostream>
void check_cuda(cudaError_t res, char const* const func, const char* const file, int const line) {
if (res) {
std::cout << "CUDA encountered an error: " << cudaGetErrorString(res) << " in " << file << ":" << line << std::endl;
cudaDeviceReset();
exit(1);
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.