- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在具有 2.1 计算能力的 Nvidia 卡上使用 Thrust 运行蒙特卡洛模拟。如果我尝试一次 transform_reduce 整个 device_vector,我会收到以下错误。这不是耗尽设备内存的问题,因为 vector 很大(~1-10mb)。我知道我的代码是正确的,因为如果我使用 openmp 编译并仅在主机上运行,它就可以工作。是什么导致了这个问题?
mccva.exe 中 0x776e15de 处的未处理异常:Microsoft C++ 异常:内存位置 0x0014cb28 处的 thrust::system::system_error。
但是,如果我分块执行 transform_reduce,它会正常工作,直到我缩放模拟中的时间步数,然后它会给出相同的错误。
//run the Monte Carlo simulation
zpath * norm_ptr = thrust::raw_pointer_cast(&z[0]);
cout << "initialized raw pointer" << endl;
thrust::device_vector<ctrparty> devctrp = ctrp;
assert(devctrp.size()==ctrp.size());
cout << "Initialized device vector" << endl;
cout << "copied host vec to device vec" << endl;
float cva = 0;
for(unsigned int i=0; i<5; i++)
{
if(i<4)
cva += (1-R) * thrust::transform_reduce(devctrp.begin()+i*2000, devctrp.begin() + (i+1)*2000 - 1, calc(norm_ptr, dt, r, sims, N), 0.0f, sum());
else
cva += (1-R) * thrust::transform_reduce(devctrp.begin()+i*2000, devctrp.begin() + (i+1)*2000, calc(norm_ptr, dt, r, sims, N), 0.0f, sum());
}
当我尝试这个时出现错误:
float cva = 0.0f;
try
{
cva = thrust::transform_reduce(devctrp.begin(), devctrp.end(), calc(norm_ptr, dt, r, sims, N), 0.0f, sum()); //get the simulated CVA
}
catch(thrust::system_error e)
{
printf(e.what());
}
我正在使用 VS2010,当它因错误而中断时,它指向 dbgheap.c 文件中的以下内容。
__finally {
/* unlock the heap
*/
_munlock(_HEAP_LOCK);
}
最佳答案
当我忘记将项目的 Properties
调整为我的 CUDA 卡计算能力时,我遇到了这种推力错误
Configuration Properties > CUDA C\C++ > Device > Code Generation
将 compute_10,sm_10
更改为您的 GPU 计算能力
对于具有 2.1 计算能力的 Nvidia 卡,它将是 compute_20,sm_21
关于c++ - transform_reduce 中的 thrust::system::system_error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15289030/
我正在尝试编写一个多线程记录器,当我测试要写出的行队列是否为空时,出现带有无效参数的std::system_error。构造unique_lock时会发生这种情况。如果我通过std::try_to_l
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Why does this simple std::thread example not work? 代码:
这个问题在这里已经有了答案: Why is locking a std::mutex twice 'Undefined Behaviour'? (2 个答案) 关闭 7 年前。 这是代码 mutex
C++11 引入了包含处理错误代码的通用系统的 header 。一个 std::error_code是一个包含 int 的元组、错误代码和对 std::error_category 的引用,它定义了错
我正在尝试运行我的程序,但在几次运行中我遇到了一个错误: terminate called after throwing an instance of 'std::system_error' wh
我的线程代码中存在异常问题。基本上这是一个生产者-消费者问题,不同之处在于消费者必须先清空自己的队列,然后再从主队列消费,此外,根据值,他们将数字添加到另一个消费者队列或对其进行处理。 代码按预期工作
当我运行我的代码时: nb workers = 12 I'm i : 0 HELLO I'm func1 BYE I'm func2 terminate called after throwing a
最近我开始研究 Grpc。在 Grpc C++ 编译中出现以下错误,不确定是什么导致了这个问题。 我不是 C++ 背景,任何帮助对我来说都会非常有用。 [HOSTLD] 链接/home/test/gr
我开发了一种使用推力 的算法。我的办公室计算机有一张支持 CUDA 的卡,其架构为: --- General information about Device 0 Name: Quadro 2000
我有这个抛出异常的代码(非常类似于 what is suggested here): int accept4(int sockfd, sockaddr *addr, socklen_t *addrle
我在具有 2.1 计算能力的 Nvidia 卡上使用 Thrust 运行蒙特卡洛模拟。如果我尝试一次 transform_reduce 整个 device_vector,我会收到以下错误。这不是耗尽设
中定义的异常(例如 std::logic_error 、 std::runtime_error 及其子类,例如 std::system_error )具有需要字符串参数的构造函数,例如: domai
我正在开发一个系统,该系统旨在使用名为 error_code、error_condition 和 error_category 的类——一个新的方案std:在 C++11 中,尽管目前我实际上正在使用
我看了一篇深思熟虑的series of blog posts关于新 C++11 中的 header 。它说标题定义了 error_code表示操作(例如系统调用)返回的特定错误值的类。它说标题定义了
这个问题在这里已经有了答案: What are the correct link options to use std::thread in GCC under linux? (5 个回答) 关闭9年
我正在使用 tensorflow 训练 resNet50,使用具有以下属性的共享服务器: Ubuntu 16.04 3 gtx 1080 gpu tensorflow 1.3 python 2.7 但
我在Android应用程序中使用boost inide并获得随机SIGABRT: "terminating with uncaught exception of type boost::wra
我使用从 std::system_error 继承的类进行错误处理,我想控制调用 what() 时返回的内容。原因:标准(C++11 和 C++1y CD 草案 - N3690,下面的 § 引用是后者
如果我调用通过 GetLastError 报告错误的 Win32 函数,例如 RegisterClassEx ,如何为该错误抛出 std::system_error ? 最佳答案 检查 GetLast
我正在尝试使用 system_error 工具来处理我的库中的错误。我将简要讨论该库的结构,以防您发现它对您有所帮助:该库的 namespace 称为 commons,在此之下我还有另一个 names
我是一名优秀的程序员,十分优秀!