Library/ManagedCuda/CudaSurface.cs
/// <summary>
/// Bind a CudaArray3D to a surface reference.
/// </summary>
/// <param name="kernel"></param>
/// <param name="surfName"></param>
/// <param name="flags"></param>
/// <param name="array"></param>
Bind a CudaArray3D to a surface reference.
Bind a CudaArray3D to a surface reference .
public static void BindArray(CudaKernel kernel, string surfName, CUSurfRefSetFlags flags, CudaArray3D array)
		{
			CUsurfref surfref = new CUsurfref();
			CUResult res = DriverAPINativeMethods.ModuleManagement.cuModuleGetSurfRef(ref surfref, kernel.CUModule, surfName);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}, Surface name: {3}", DateTime.Now, "cuModuleGetSurfRef", res, surfName));
			if (res != CUResult.Success) throw new CudaException(res);
			res = DriverAPINativeMethods.SurfaceReferenceManagement.cuSurfRefSetArray(surfref, array.CUArray, flags);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuSurfRefSetArray", res));
			if (res != CUResult.Success) throw new CudaException(res);
		}
public static void BindArray ( CudaKernel kernel , string surfName , CUSurfRefSetFlags flags , CudaArray3D array ) { CUsurfref surfref = new CUsurfref ( ) ; CUResult res = DriverAPINativeMethods . ModuleManagement . cuModuleGetSurfRef ( ref surfref , kernel . CUModule , surfName ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res , surfName ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; res = DriverAPINativeMethods . SurfaceReferenceManagement . cuSurfRefSetArray ( surfref , array . CUArray , flags ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Bind a CudaArray3D to a surface reference.
Bind a CudaArray3D to a surface reference .
kernel
CudaKernel
None
surfName
string
None
flags
CUSurfRefSetFlags
None
array
CudaArray3D
None