Library/ManagedCuda/CudaArray1D.cs
/// <summary>
/// Copy data from host to array memory
/// </summary>
/// <param name="source">Pointer to source data</param>
/// <param name="sizeInBytes">Number of bytes to copy</param>
/// <param name="offsetInBytes">Offset in bytes of destination array</param>
Copy data from host to array memory
Copy data from host to array memory
public void CopyFromHostToArray1D(IntPtr source, SizeT sizeInBytes, SizeT offsetInBytes)
        {
            CUResult res;
            res = DriverAPINativeMethods.SynchronousMemcpy_v2.cuMemcpyHtoA_v2(_cuArray, offsetInBytes, source, sizeInBytes);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpyHtoA", res));
            if (res != CUResult.Success)
                throw new CudaException(res);
        }
public void CopyFromHostToArray1D ( IntPtr source , SizeT sizeInBytes , SizeT offsetInBytes ) { CUResult res ; res = DriverAPINativeMethods . SynchronousMemcpy_v2 . cuMemcpyHtoA_v2 ( _cuArray , offsetInBytes , source , sizeInBytes ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Copy data from host to array memory
Copy data from host to array memory
source
IntPtr
Pointer to source data
Pointer to source data
sizeInBytes
SizeT
Number of bytes to copy
Number of bytes to copy
offsetInBytes
SizeT
Offset in bytes of destination array
Offset in bytes of destination array