CHECK(调用)函数在Google Colab中出错
CHECK(call) function get error in Google Colab
我刚刚从CUDA中的普通CHECK(call)
函数复制了一个函数,并在Google Colab 中使用nvcc_plugin
运行
#define CHECK(call)
{
const cudaError_t error = call;
if (error != cudaSuccess)
{
printf("Error: %s:%d, ", __FILE__, __LINE__);
printf("code:%d, reason: %sn", error, cudaGetErrorString(error));
exit(1);
}
}
但它引发了一个错误
/tmp/tmpvc2kvnuh/9c0f913f-6a2c-420d-9e3a-94c6e3123f7f.cu(9): error: expected a declaration
我该怎么做?
#define CHECK(call)
{
const cudaError_t error = call;
if (error != cudaSuccess)
{
printf("Error: %s:%d, ", __FILE__, __LINE__);
printf("code:%d, reason: %sn", error, cudaGetErrorString(error));
exit(1);
}
}
如果你想要一个多行宏,你必须添加反斜杠。
相关文章:
- 如何使用Google Mock来模拟gettimeofday()
- 在Google Kick start中提交时出错
- CHECK(调用)函数在Google Colab中出错
- Google protobuf 时间戳未声明标识符,在 Windows 上具有C++
- 如何使用 Google Test 向测试添加元数据 / 如何将数据从 Google Test 发送到 TestEven
- 在macOS Mojave上发布BOOST unit_test_framework/Google测试
- Google Test for OpenCv c++
- 使用 Google Test 对自定义断言函数进行单元测试
- Google Cloud Pubsub Async Streaming API in C++
- 如何在Google Cloud Functions上运行C++文件?
- 在jupyter notebook和google colab中使用.so
- gmock / google-mock发出警告,并且通过模拟异常未通过测试
- Google Or-Tools Glop:如何创建指向 const 对象的指针数组?
- 如何读取 google::p rotobuf::io::CodedOutputStream::WriteVarint32
- Google Sparsehash 在类型上使用 realloc(),这很难复制
- 如何在 google test in windows 中管理断言
- CMake 在编译 Google 的 protobuf 示例时找不到 protobuf
- google test PrintTo for std::set<std::string>
- Google Colab 看不到 .so 文件
- google-cloud-cpp CMake 生成失败