title: CUDAfy Instantiating classes
body: <p>so I'm trying to make a complex calculation in CUDAfy so that it can reduce the current time it takes on the CPU I am trying to make use of "CUDAfy-ed" methods which I can pass variables into and it will return values very similar to the idea with the .NET Math.Sin(x) or Math.Cos(x) function for example. I am trying to make this to work however it is just spitting out errors from the CUDAfy translator, so is what I am trying to do possible/within the power of CUDAfy or am I going down the wrong route to make this work?</p>
  
  <p>Example:</p>
  
  <pre><code>public static void Main(){     
          CudafyModule km = CudafyTranslator.Cudafy();
          GPGPU gpu = CudafyHost.GetDevice(CudafyModes.Target, CudafyModes.DeviceId);
          gpu.LoadModule(km);
          double Value;
          double[] dev_Value = gpu.Allocate&lt;double&gt;(10);
          gpu.Launch(1,1).SumOfSines(dev_Value);
          Console.WriteLine(Value);
          gpu.FreeAll();}
  
  public static void SumOfSines(double[] Value)
      {
       int numThreads = thread.blockDim.x * thread.gridDim.x;
       int threadID = thread.threadIdx.x + thread.blockIdx.x * thread.blockDim.x;
          for (int i = threadID; i &lt; 1000000; i += numThreads)
          {
             for (double a = 0; a &lt; 100; a++) 
             {
               double angle = MathHelper.DegreesToRadians((double)a);     //can I do this?
               Value[i] += Math.Sin(angle);
             }
          }
      }
  </code></pre>
  
  <p>In the MathHelper.cs file it has the method DegreesToRadians which makes this calculation:</p>
  
  <pre><code>    public static double DegreesToRadians(double deg)
      {
          double rad = deg * (Math.PI / 180.0);
          return rad;
      }
  </code></pre>
  
  <p>When I do this it spits out the error at the CUDAfy translator.</p>