Beispiel #1
0
        /// <summary>
        /// Copy data from GPU to CPU
        /// </summary>
        unsafe public void CopyOutFromCuda(int SpecifiedSize)
        {
            if (cudaPiecePointer == IntPtr.Zero)
            {
                return;
            }
            if (cpuMemArray == null)
            {
                throw new Exception("Error! Must set needCpuMem=true for CopyOutFromCuda() operation!");
            }

            fixed(float *pb = &cpuMemArray[0])
            {
                Cudalib.CudaCopyOutFloat(cudaPiecePointer, (IntPtr)pb, SpecifiedSize);
            }
        }