/// <summary> /// Copy data from CPU to GPU /// </summary> unsafe public void CopyIntoCuda(int SpecifiedSize) { if (cudaPiecePointer == IntPtr.Zero) { return; } if (cpuMemArray == null) { throw new Exception("Error! Must set needCpuMem=true for CopyIntoCuda() operation!"); } fixed(float *pb = &cpuMemArray[0]) { Cudalib.CudaCopyInFloat(cudaPiecePointer, (IntPtr)pb, SpecifiedSize); } }