Given the following code:
#define DEVICE __device__
#define HOST __host__
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
template <typename T, std::size_t N>
class Container {
public:
DEVICE HOST
Container() {
}
private:
T data[N];
};
typedef Container<double, 7> double7;
template <std::size_t N = 10 >
class History {
public:
DEVICE HOST
History() {
}
DEVICE HOST
virtual ~History() {
}
private:
double7 history[N];
};
int main() {
try {
thrust::host_vector<History<> > histories(1);
thrust::device_vector<History<> > d_histories = histories;
} catch (const thrust::system_error &) {
std::cerr << "boo boo" << std::endl;
}
return 0;
}
The above runs without error on toolkit release nvcc 5.0, v 0.2.1221
and fails on nvcc 5.5 v5.5.0
. I realize virtual functions in __global__
are not supported as the documentation clearly states.
My question is this: what changed between the two versions to "break" virtual functions? Was this an accidental omission in 5.0
that was corrected in 5.5
?