Library/ManagedCuda/CudaArray2D.cs
/// <summary>
/// Copy from Host to this array
/// </summary>
/// <param name="aHostSrc">Source</param>
/// <param name="aElementSizeInBytes"></param>
Copy from Host to this array
Copy from Host to this array
public void CopyFromHostToThis(IntPtr aHostSrc, SizeT aElementSizeInBytes)
        {
            CUDAMemCpy2D copyParams = new CUDAMemCpy2D();
            copyParams.srcHost = aHostSrc;
            copyParams.srcMemoryType = CUMemoryType.Host;
            copyParams.dstArray = _cuArray;
            copyParams.dstMemoryType = CUMemoryType.Array;
            copyParams.Height = _arrayDescriptor.Height;
            copyParams.WidthInBytes = _arrayDescriptor.Width * aElementSizeInBytes;
            res = DriverAPINativeMethods.SynchronousMemcpy_v2.cuMemcpy2D_v2(ref copyParams);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpy2D", res));
            if (res != CUResult.Success)
                throw new CudaException(res);
        }
public void CopyFromHostToThis ( IntPtr aHostSrc , SizeT aElementSizeInBytes ) { CUDAMemCpy2D copyParams = new CUDAMemCpy2D ( ) ; copyParams . srcHost = aHostSrc ; copyParams . srcMemoryType = CUMemoryType . Host ; copyParams . dstArray = _cuArray ; copyParams . dstMemoryType = CUMemoryType . Array ; copyParams . Height = _arrayDescriptor . Height ; copyParams . WidthInBytes = _arrayDescriptor . Width * aElementSizeInBytes ; res = DriverAPINativeMethods . SynchronousMemcpy_v2 . cuMemcpy2D_v2 ( ref copyParams ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Copy from Host to this array
Copy from Host to this array
aHostSrc
IntPtr
None
aElementSizeInBytes
SizeT
None