CudaAllocator报错
还没有人认领这个 Issue。
评估
调研方向
Start with the referenced lesson code at 08/04_sugar/01/main.cu#L7 and the allocator instantiation reported at src/allocator.cu line 30. Reproduce the build with Visual Studio 2022 and CUDA 12.2, then compare the CudaAllocator usage with the compiler diagnostics in vector. Done means the lesson code builds successfully without the reported allocator conversion errors.
由索引模型根据 Issue 内容生成。
描述
环境 VS2022 cuda12.2
报错信息
[build] MSBuild version 17.4.0+18d5aef85 for .NET Framework
[build] Compiling CUDA source file ..\src\allocator.cu...
[build]
[build] C:\Dev\mgxpbd\build>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64" -x cu -IC:\Dev\mgxpbd\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include" --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static --generate-code=arch=compute_52,code=[compute_52,sm_52] -std=c++17 -Xcompiler="/EHsc -Ob0 -Zi" -g -D_WINDOWS -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -D"CMAKE_INTDIR=\"Debug\"" -Xcompiler "/EHsc /W1 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/Fdallocator.dir\Debug\vc143.pdb" -o allocator.dir\Debug\allocator.obj "C:\Dev\mgxpbd\src\allocator.cu"
[build] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector(2125): error : no suitable user-defined conversion from "CudaAllocator<int>" to "CudaAllocator<std::_Container_proxy>" exists [C:\Dev\mgxpbd\build\allocator.vcxproj]
[build] auto&& _Alproxy = static_cast<_Rebind_alloc_t<_Alty, _Container_proxy>>(_Al);
[build] ^
[build] detected during:
[build] instantiation of "void std::vector<_Ty, _Alloc>::_Construct_n(std::vector<_Ty, _Alloc>::size_type, _Valty &&...) [with _Ty=int, _Alloc=CudaAllocator<int>, _Valty=<>]" at line 683
[build] instantiation of "std::vector<_Ty, _Alloc>::vector(std::vector<_Ty, _Alloc>::size_type, const _Alloc &) [with _Ty=int, _Alloc=CudaAllocator<int>]" at line 30 of C:\Dev\mgxpbd\src\allocator.cu
[build]
[build] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector(832): error : no suitable user-defined conversion from "CudaAllocator<int>" to "CudaAllocator<std::_Container_proxy>" exists [C:\Dev\mgxpbd\build\allocator.vcxproj]
[build] auto&& _Alproxy = static_cast<_Rebind_alloc_t<_Alty, _Container_proxy>>(_Getal());
[build] ^
[build] detected during instantiation of "std::vector<_Ty, _Alloc>::~vector() noexcept [with _Ty=int, _Alloc=CudaAllocator<int>]" at line 30 of C:\Dev\mgxpbd\src\allocator.cu
[build]
[build] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector(833): error : no instance of function template "std::_Delete_plain_internal" matches the argument list [C:\Dev\mgxpbd\build\allocator.vcxproj]
[build] argument types are: (<error-type>, std::_Container_proxy *)
[build] _Delete_plain_internal(_Alproxy, ::std:: exchange(_Mypair._Myval2._Myproxy, nullptr));
[build] ^
[build] detected during instantiation of "std::vector<_Ty, _Alloc>::~vector() noexcept [with _Ty=int, _Alloc=CudaAllocator<int>]" at line 30 of C:\Dev\mgxpbd\src\allocator.cu
[build]
[build] 3 errors detected in the compilation of "C:/Dev/mgxpbd/src/allocator.cu".
[build] allocator.cu
[build] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.2.targets(799,9): error MSB3721: 命令“"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64" -x cu -IC:\Dev\mgxpbd\include
- 主要语言
- C++
- 星标
- 4.2k
- 派生
- 554
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
parallel101/course 的其他 Issue
-
访问者设计模式缺少继承未关闭
难度 1/5 1-3 小时 新手友好度 68/100
parallel101/course#35 ·
-
难度 1/5 1 小时以内 新手友好度 62/100
parallel101/course#29 ·
-
难度 1/5 1 小时以内 新手友好度 45/100
parallel101/course#39 ·
-
难度 2/5 1-3 小时 新手友好度 42/100
parallel101/course#38 ·
-
函数返回匿名结构体无法编译未关闭
难度 2/5 1-3 小时 新手友好度 45/100
parallel101/course#36 · 2 条评论 ·
查看 parallel101/course 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 66/100
madskristensen/FileIcons#385 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/SysmonCommon#26 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
espressif/esp-matter#1913 ·
-
bug priority: low
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
chipsalliance/verible#2644 ·