以下CUDA Thrust程序崩溃:
#include <thrust/device_vector.h>
#include <thrust/extrema.h>
int main(void)
{
thrust::device_vector<int> vec;
for (int i(0); i < 1000; ++i) {
vec.push_back(i);
}
thrust::min_element(vec.begin(), vec.end());
}
Run Code Online (Sandbox Code Playgroud)
我得到的例外是:
Unhandled exception at 0x7650b9bc in test_thrust.exe: Microsoft C++
exception:thrust::system::system_error at memory location 0x0017f178..
In `checked_cudaMemcpy()` in `trivial_copy.inl`.
Run Code Online (Sandbox Code Playgroud)
如果我添加#include <thrust/sort.h>
和替换min_element
用sort
,它不会崩溃.
我在Windows 7 64位,compute_20,sm_20(费米),调试版本上使用CUDA 4.1.在发布版本中,我没有得到崩溃,min_element找到了正确的元素.
我做错了什么,或者Thrust中有错误吗?
使用Python和PyOpenSSL,有没有办法检索自定义扩展的价值?通过自定义扩展,我的意思是使用在http://www.openssl.org/docs/apps/x509v3_config.html的 ARBITRARY EXTENSIONS下描述的任意扩展格式编码的扩展.
此外,是否可以使用PyOpenSSL创建包含此类扩展的证书?
如果其中任何一个的答案都是"否",我也会对如何使用任何其他Python库执行此操作的指针感兴趣.我不想对OpenSSL命令行应用程序执行系统调用.
我是Mac OS X的新手,我购买新MacBook Pro R15 Retina Edition的主要原因是开始研究CUDA API.
但我无法建立我的项目.
例如,当我创建一个新的CUDA项目时,我进入项目属性并进行以下更改:
C/C++/Objective-C编译器:LLVM GCC 4.2
其他链接器标志:-lcuda,-lcudart
标题搜索路径:/ usr/local/cuda/include
图书馆搜索路径:/ usr/local/cuda/lib
当我开始在我的代码中添加必要的库时,一切运行正常.我的代码没有输入错误.
当我构建项目时,我得到链接错误(路径缩短和消息分解以便于阅读):
Ld/my_test_project/Build/Products/Debug/test normal x86_64 cd/Users/Admin/Documents/test setenv MACOSX_DEPLOYMENT_TARGET 10.7 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-arch x86_64
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
-L/my_test_project /建设/产品/调试
-L/usr/local/cuda/lib -F/my_test_project/Build/Products/Debug
-filelist /my_test_project/Build/Intermediates/test.build/Debug/test.build/Objects-normal/x86_64/test.LinkFileList
-mmacosx版本分钟= 10.7
-lcudart
-lcuda
-o/my_test_project/Build/Products/Debug/test
ld:找不到文件:@ rpath/CUDA.framework/Versions/A/CUDA for architecture x86_64 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
有点奇怪的是,当我进入描述的路径时,我看到了CUDA可执行文件.文件在那里!
当我使用使用库的cuComplex.h时,每个数学表达式(例如log,cos,sin等等)都是"未定义的变量".但是,cuComplex.h库里面有库.
驱动程序,SDK和工具包都安装得很好,一切都像魅力一样.我可以让SDK示例正常工作.但是我觉得我错过了一个细节来让整个事情发挥作用.
我正在尝试使用CUDA 4.2工具包来使用Visual Studio 2010(c ++ express edition).我在Microsoft Windows 64位上运行它.我目前安装了SDK,工具包和Nsight™Visual Studio Edition 2.2,以及Visual Studio 2010(c ++ express edition).我已经完全安装了CUDA并且本身正常工作,但是当我尝试使用Visual Studio 2010打开源项目时,我收到此错误:
无法读取项目文件"bandwidthTest_vs2010.vcxproj".C:\ ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\src\bandwidthTest\bandwidthTest_vs2010.vcxproj(65,5):导入的项目"C:\ Program Files(x86)\ MSBuild\Microsoft.Cpp\v4.找不到0\BuildCustomization\CUDA 4.2.props".确认Import声明中的路径是否正确,以及该文件是否存在于磁盘上.
我已经尝试卸载工具包和SDK并重新安装,但这并没有解决问题.我想如果有人可以简单地给我这些文件,那么它可能会起作用.但是,我仍然担心为什么我首先要解决这个问题.任何见解将不胜感激.