1 // Direct NVCC command line example:
3 // nvcc ./cuda-cpp14.cu -x cu -I"../include" -l"fmtd" -L"../build/Debug" \
4 // -std=c++14 -Xcompiler /std:c++14 -Xcompiler /Zc:__cplusplus
6 // Ensure that we are using the latest C++ standard for NVCC
7 // The version is C++14
9 // https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#c-cplusplus-language-support
10 // https://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros
11 static_assert(__cplusplus >= 201402L, "expect C++ 2014 for nvcc");
18 extern auto make_message_cpp() -> std::string;
19 extern auto make_message_cuda() -> std::string;
22 std::cout << make_message_cuda() << std::endl;
23 std::cout << make_message_cpp() << std::endl;
26 auto make_message_cuda() -> std::string {
27 return fmt::format("nvcc compiler \t: __cplusplus == {}", __cplusplus);