I have a struct and a class with Execute() method and a cudafying method uses the struct.
PROBLEM: Cuda says: ".../CUDAFYSOURCETEMP.cu(3): error: identifier "PointGPU" is undefined"
[Cudafy]
public struct PointGPU
{
public double x;
public double y;
public double z;
public PointGPU(double xVal, double yVal, double zVal)
{
x = xVal;
y = yVal;
z = zVal;
}
}
class MarchingCubesOnGPU
{
CudafyModule km = CudafyTranslator.Cudafy();
GPGPU gpu = CudafyHost.GetDevice();
private static PointGPU[] pointsGpu = new PointGPU[8];
public void Execute()
{
gpu.LoadModule(km);
PointGPU[] dev_points = gpu.CopyToDevice(pointsGpu);
gpu.Launch().PolygoniseOnGpu(dev_points, ...);
...
}
[Cudafy]
public static void PolygoniseOnGpu(PointGPU[] p, ...)
{
...
}
public List<Triangle> setPolygoniseParameters(...)
{
pointsGpu = ...
}
}
This line in CudafySourceTemp.cu is
extern "C" __global__ void PolygoniseOnGpu( PointGPU* p, ...);
The decision is: