Library/ManagedCuda/CudaArray2D.cs
/// <summary>
/// Copy from this array to a pitched device variable
/// </summary>
/// <typeparam name="T">device variable base type</typeparam>
/// <param name="aDeviceVariable">Destination</param>
Copy from this array to a pitched device variable
Copy from this array to a pitched device variable
public void CopyFromThisToDevice<T>(CudaPitchedDeviceVariable<T> aDeviceVariable) where T : struct
        {
            CUDAMemCpy2D copyParams = new CUDAMemCpy2D();
            copyParams.dstDevice = aDeviceVariable.DevicePointer;
            copyParams.dstMemoryType = CUMemoryType.Device;
            copyParams.dstPitch = aDeviceVariable.Pitch;
            copyParams.srcArray = _cuArray;
            copyParams.srcMemoryType = CUMemoryType.Array;
            copyParams.Height = aDeviceVariable.Height;
            copyParams.WidthInBytes = aDeviceVariable.WidthInBytes;
            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 CopyFromThisToDevice < T > ( CudaPitchedDeviceVariable < T > aDeviceVariable ) where T : struct { CUDAMemCpy2D copyParams = new CUDAMemCpy2D ( ) ; copyParams . dstDevice = aDeviceVariable . DevicePointer ; copyParams . dstMemoryType = CUMemoryType . Device ; copyParams . dstPitch = aDeviceVariable . Pitch ; copyParams . srcArray = _cuArray ; copyParams . srcMemoryType = CUMemoryType . Array ; copyParams . Height = aDeviceVariable . Height ; copyParams . WidthInBytes = aDeviceVariable . WidthInBytes ; 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 this array to a pitched device variable
Copy from this array to a pitched device variable
aDeviceVariable
CudaPitchedDeviceVariable<T>
None
typeparam
device variable base type
device variable base type