__eh_curr_region

I’m getting some funner errors with ‘__eh_curr_region’ in them when I try to compile a simple 3 element vector class of complex numbers.

The vector class looks something like:

[codebox]

class tvec {

public:

tvec() {};

~tvec() {};

private:

zcmplx a, b, c;

}

[/codebox]

The zcmplx class inherits from cuDoubleComplex in cuComplex.h that comes with the toolkit and implements a set of convenient operators.

[codebox]

class zcmplx : public cuDoubleComplex {

}

[/codebox]

I can change the elements (a, b, and c) in the 3 vector class to be cuDoubleComplex variables and get the code to compile and work. The casting between cuDoubleComplex and zcmplx isn’t much of a problem, and it can mostly be done automatically with operator overloading, but it still seems a bit clunky.

Any ideas why I can’t just use my zcmplx class? Have I committed any C++ sins I’m not seeing offhand?

Ben

Edit: I forgot to mention that I have looked on the forums, and I don’t see immediately where I might be having shared memory problems. I do not allocate any arrays in shared memory. I only have pointers and single variables in shared memory.

The previous posts on this issue talk about having variably-sized arrays in shared memory (i.e. arrays whose size is only determined at runtime). I had this issue with arrays like this, but in registers (not shared memory). Do you have any variably-sized arrays in your code?

All my arrays sit in global memory.

Ben

removing the destructor will fix this.
destructors on the device are not supported yet.

Ah, thanks.

Ben