-
Notifications
You must be signed in to change notification settings - Fork 758
STATIC_ASSERTION_FAILURE when compiling *.cpp files #526
Comments
This is the expected behavior, right? I get the same error with each release of Thrust going back to 1.5. When you create a |
The compiler problem does not occur e.g. with this commit: b1b7d28 |
That may be, but it's unintentional. Every released version of Thrust treats this as an error. Constructing |
Is there any way to avoid having to use a *.cu file? I use thrust::device_vector in combination with boost::mpl which nvcc complains about, so I compiled it (successfully) using gcc alone in a *.cpp file. |
Yes, use Alternatively, you could separate the code which constructs the |
I still have issues with this. This compiles // compiles.cpp
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
int main()
{
thrust::host_vector<int> hVec(100);
thrust::device_vector<int> dVec = hVec;
return 0;
} but this does not: // compiles_not.cpp
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
#include <thrust/complex.h>
int main()
{
typedef thrust::complex<float> Complex;
thrust::host_vector<Complex> hVec(100);
thrust::device_vector<Complex> dVec = hVec;
return 0;
} Which behavior is the intended one? |
The second example is intended to be an error. I'm not sure about the first one -- it may be a bug, because we don't test to ensure such code works. It looks like we explicitly removed testing for this case a few years ago. The first one compiles because If we could do it over again, we probably wouldn't allow |
/home/amax/HeartNext/src/VectorWrapper.cpp: In function ‘int parse_tissue(lua_State*)’: |
CUDA 10.0 |
Trying to compile https://github.com/che-shr-cat/currennt/ with CUDA 10.0:
yields
|
When using the latest thrust version from git in my project, I get a lot of the following errors:
I tried to reproduce it in a small example, turns out I cannot use a device_vector with initial size > 0 in a cpp-file.
test.cpp
When I compile using
I get this output: https://gist.github.com/dachziegel/90ebaf38c8249f1f094c
When the file is named test.cu, compiling works without a problem.
CUDA Version: 6.0
gcc-version: 4.8.1
The text was updated successfully, but these errors were encountered: