The error “Error: External calls are not supported (found non-inlined call to _ZN9myarray20I6LINE_CEC1Ev)” pops up when i try to create a new struct object in the device function. My code is as follows.
I think this is probably due to your struct’s constructor (or a constructor of one of its members) not being declared a device function. If you use structs in device code and they have constructors, they should be tagged as device.
Oops, sorry for that, i should have defined the structure here …
[codebox]
template
struct myarray20 {
myarray20() :
arrayvalue(), numberofvaluesused(0){
}
;
T arrayvalue[20];
int numberofvaluesused;
void reset() {numberofvaluesused = 0;}
};
struct LINE_C {
LINE_C() :
lineXY(), direction(0) {
}
;
int lineXY[4]; //Holds the Start and end (x,y) coordinates of the line
SHORT direction; //this indicates increase/decrease X/Y - incY - 0, decY - 1, IncX - 2, decX - 3;
}; //end class line
struct CONTOUR_C {
CONTOUR_C() :
contourBbox(), lineObjectForContour(), linesOfContour(), hasBeenIncludedInAGrid(0) {
}
;
int contourBbox[4]; //This array holds the coordinates of the bounding box
LINE_C lineObjectForContour;
bool hasBeenIncludedInAGrid; //Used to indicate if this contour has been included in a grid already
myarray20 <LINE_C> linesOfContour;