Hello
After reinstaling VS2015 to have version of with Update 3 on my Windows 7 dell laptop I have started to have problem with compilation of cuda projects with future header:
kernel.cu:
#include "cuda_runtime.h"
#include <future>
#include <iostream>
int main()
{
auto future = std::async(std::launch::async, [](int i) {
std::cout << i << std::endl;
}
,2);
future.get();
}
output:
1>------ Build started: Project: TestFuture, Configuration: Debug x64 ------
1>Build started 2019-05-16 01:23:56.
1> 1>
1>InitializeBuildStatus:
1> Touching “x64\Debug\TestFuture.tlog\unsuccessfulbuild”.
1> AddCudaCompileDeps:
1> Skipping target “AddCudaCompileDeps” because all output files are up-to-date with respect to the input files.
1> 1>
1>CudaBuildCore:
1> Compiling CUDA source file kernel.cu…
1>
1> C:\Users\dell\documents\visual studio 2015\Projects\TestFuture\TestFuture>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe” -gencode=arch=compute_20,code="sm_20,compute_20" --use-local-env --cl-version 2015 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64” -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\8.1\Include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\Include\shared" -I"C:\Program Files (x86)\Windows Kits\8.1\Include\winrt" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler “/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj “C:\Users\dell\documents\visual studio 2015\Projects\TestFuture\TestFuture\kernel.cu”
1> 1>
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(445): error : static assertion failed with “tuple index out of bounds”
1> detected during:
1> instantiation of class “std::tuple_element<_Index, std::tuple<>> [with _Index=0ULL]”
1> (461): here
1> instantiation of class “std::tuple_element<_Index, std::tuple<_This, _Rest…>> [with _Index=1ULL, _This=std::decay_t, _Rest=<>]”
1> (461): here
1> instantiation of class “std::tuple_element<_Index, std::tuple<_This, _Rest…>> [with _Index=2ULL, _This=std::decay_t<lambda ->void>, _Rest=<std::decay_t>]”
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\future(1888): here
1> instantiation of class “std::_Fake_no_copy_callable_adapter<_Types…> [with _Types=<lambda ->void, int>]”
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\future(1925): here
1> instantiation of “std::future<std::result_of_t<std::decay_t<_Fty> (std::decay_t<_ArgTypes>…)>> std::async(std::launch, _Fty &&, _ArgTypes &&…) [with _Fty=lambda ->void, _ArgTypes=]”
1> C:/Users/dell/documents/visual studio 2015/Projects/TestFuture/TestFuture/kernel.cu(19): here
1>
1> 1>
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\future(1888): error : no instance of function template “std::_Invoke_stored” matches the argument list
1> argument types are: (std::tuple<std::decay_t<lambda ->void>, std::decay_t>)
1> detected during:
1> instantiation of class “std::_Fake_no_copy_callable_adapter<_Types…> [with _Types=<lambda ->void, int>]”
1> (1925): here
1> instantiation of “std::future<std::result_of_t<std::decay_t<_Fty> (std::decay_t<_ArgTypes>…)>> std::async(std::launch, _Fty &&, _ArgTypes &&…) [with _Fty=lambda ->void, _ArgTypes=]”
1> C:/Users/dell/documents/visual studio 2015/Projects/TestFuture/TestFuture/kernel.cu(19): here
1>
1> 1>
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\future(720): error : no instance of constructor “std::function<_Fty>::function [with _Fty=void ()]” matches the argument list
1> argument types are: (std::_Fake_no_copy_callable_adapter<lambda ->void, int>)
1> detected during:
1> instantiation of “std::_Packaged_state<void (_ArgTypes…)>::_Packaged_state(_Fty2 &&) [with _ArgTypes=<>, _Fty2=std::_Fake_no_copy_callable_adapter<lambda ->void, int>]”
1> (902): here
1> instantiation of “std::_Task_async_state<_Rx, _Inline>::_Task_async_state(_Fty2 &&) [with _Rx=std::result_of_t<std::decay_t<lambda ->void> (std::decay_t)>, _Inline=false, _Fty2=std::_Fake_no_copy_callable_adapter<lambda ->void, int>]”
1> (1906): here
1> instantiation of “std::_Associated_state<std::_P_arg_type<_Ret>::type> *std::_Get_associated_state<_Ret,_Fty>(std::_Launch_type, _Fty &&) [with _Ret=std::result_of_t<std::decay_t<lambda ->void> (std::decay_t)>, _Fty=std::_Fake_no_copy_callable_adapter<lambda ->void, int>]”
1> (1928): here
1> instantiation of “std::future<std::result_of_t<std::decay_t<_Fty> (std::decay_t<_ArgTypes>…)>> std::async(std::launch, _Fty &&, _ArgTypes &&…) [with _Fty=lambda ->void, _ArgTypes=]”
1> C:/Users/dell/documents/visual studio 2015/Projects/TestFuture/TestFuture/kernel.cu(19): here
1>
1> 3 errors detected in the compilation of “C:/Users/dell/AppData/Local/Temp/tmpxft_0000182c_00000000-8_kernel.cpp1.ii”.
1> 1>
1>CUDACOMPILE : nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
1> kernel.cu
1> 1>
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets(689,9): error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe” -gencode=arch=compute_20,code="sm_20,compute_20" --use-local-env --cl-version 2015 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64” -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include” -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include” -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\8.1\Include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\Include\shared" -I"C:\Program Files (x86)\Windows Kits\8.1\Include\winrt" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler “/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj “C:\Users\dell\documents\visual studio 2015\Projects\TestFuture\TestFuture\kernel.cu”” exited with code 2.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.80
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Before reinstalation I had installed VS2019 comunity, firstly i thought that there is some bad correlation in fact of to Visuals on one system so i decised to uninstall them and install only VS2015 because my GPU is of 2.0 computation capability but it did not help. In console projectes code with future header compile fine. Pleace help I don’t want to reinstall windows.