Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with nvcc on Windows #58

Open
ezyang opened this issue Jun 26, 2018 · 3 comments
Open

Does not work with nvcc on Windows #58

ezyang opened this issue Jun 26, 2018 · 3 comments

Comments

@ezyang
Copy link

ezyang commented Jun 26, 2018

This probably won't get fixed, but we're posting this here to let anyone else who might be interested in using this know.

@akrzemi1
Copy link
Owner

Can we see the minimal code and the error message?

@ezyang
Copy link
Author

ezyang commented Aug 7, 2018

#include <Optional/optional.hpp>

void f() {
	std::experimental::optional<int> x;
}

I built it with both normal MSVC compiler, and nvcc.

@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
cl.exe -I. -c kernel.cc
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc" -I. -c kernel.cu

The normal MSVC compiler passes. nvcc fails with:

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.4.5
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86_x64'
kernel.cc
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\xlocale(314): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\iosfwd(292): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
kernel.cu
.\Optional/optional.hpp(413): error C2614: 'std::experimental::optional<int>': illegal member initialization: 'OptionalBase' is not a base or member
.\Optional/optional.hpp(413): note: while compiling class template member function 'std::experimental::optional<int>::optional(void) noexcept'
kernel.cu(4): note: see reference to function template instantiation 'std::experimental::optional<int>::optional(void) noexcept' being compiled
kernel.cu(4): note: see reference to class template instantiation 'std::experimental::optional<int>' being compiled

@ezyang
Copy link
Author

ezyang commented Aug 27, 2018

There is a workaround for the problem at pytorch/pytorch#10909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants