This project is read-only.

allocate and dispose GPU memory of an array in a struct

Nov 15, 2016 at 11:58 AM
Edited Nov 15, 2016 at 12:56 PM

I don't really know how to proceed and nothing of the stuff I tried seems to allow me to dispose my allocation.

I've got a structure like this :
struc calcAngle
  Cartesian Geo;
Cartesian is an other structure defined like follow :
struct Cartesian
 public double x;
 public double y;
 public double z;
And I wanted to do something like this :
calcAngle angle;

angle.Geo = new CudaDeviceVariable<Cartesian>(628319);
But it doesn't work. I'm not familiar with managedCUDA and not better with C#. But I know CUDA. So how can I do this ?

Edit : If my kernel receive a Cartesian* and I set a CudaDeviceVariable<Cartesian> Alpha = new CudaDeviceVariable<Cartesian>(10) I must send Alpha.DevicePointer ?