I have the following code and it has an error only with cuda9 + gcc7. Cuda9 + gcc6 doesn’t have compilation. This is a minimal reproducer I wrote for the error. I suspect it is a compiler error but I have to fix my code to work with gcc7. I want to know a workaround to get rid of the compilation error.
Cuda compilation tools, release 9.2, V9.2.148
gcc version 7.3.0 (Ubuntu 7.3.0-21ubuntu1~16.04)
Error:
$ nvcc test.cu
test.h: In constructor ‘TestOp::TestOp()’:
test.h:6:54: error: ‘Dummy’ is not a member of ‘TestOp’
class OperatorBase {
public:
template
inline bool Dummy(T default_value) {
return true;
}
};
template <class Context>
class Operator : public OperatorBase {
};
#include “test.h”
#include “op.h”
template
class TestOp : public Operator {
public:
TestOp()
: msg_(
OperatorBase::Dummy(true)) {}
private:
bool msg_;
};