FZGPUModules 2.0
GPU-accelerated modular compression pipelines
Loading...
Searching...
No Matches
cuda_check.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdexcept>
4#include <string>
5
6#include "backend/types.h"
7#include "log.h"
8
39#define FZ_CUDA_CHECK(call) \
40 do { \
41 fz::error_t _fz_cuda_err_ = (call); \
42 if (_fz_cuda_err_ != fz::kBackendSuccess) { \
43 throw std::runtime_error( \
44 std::string("[fzgmod] CUDA error at " __FILE__ ":") + \
45 std::to_string(__LINE__) + \
46 " — " #call " → " + \
47 fz::getBackendErrorString(_fz_cuda_err_)); \
48 } \
49 } while (0)
50
51#define FZ_CUDA_CHECK_WARN(call) \
52 do { \
53 fz::error_t _fz_cuda_err_ = (call); \
54 if (_fz_cuda_err_ != fz::kBackendSuccess) { \
55 FZ_LOG(WARN, \
56 "CUDA error at %s:%d — " #call " → %s", \
57 __FILE__, __LINE__, \
58 fz::getBackendErrorString(_fz_cuda_err_)); \
59 } \
60 } while (0)
Logging infrastructure and macros.
Backend-neutral GPU type aliases.