Library/ManagedCuda/CudaContext.cs
/// <summary>
/// Load a PTX module from file
/// </summary>
/// <param name="modulePath"></param>
/// <param name="options">Collection of linker and compiler options</param>
/// <returns></returns>
Load a PTX module from file
Load a PTX module from file
public CUmodule LoadModulePTX(string modulePath, CudaJitOptionCollection options)
		{
			if (disposed) throw new ObjectDisposedException(this.ToString());
			byte[] image;
			System.IO.FileInfo fi = new System.IO.FileInfo(modulePath);
			if (!fi.Exists) throw new System.IO.FileNotFoundException("Cannot read from module/kernel file.", modulePath);
			using (System.IO.BinaryReader br = new System.IO.BinaryReader(fi.OpenRead()))
			{
				image = br.ReadBytes((int)br.BaseStream.Length);
			}
			return LoadModulePTX(image, options);
		}
public CUmodule LoadModulePTX ( string modulePath , CudaJitOptionCollection options ) { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; byte [ ] image ; System . IO . FileInfo fi = new System . IO . FileInfo ( modulePath ) ; if ( ! fi . Exists ) throw new System . IO . FileNotFoundException ( " " , modulePath ) ; using ( System . IO . BinaryReader br = new System . IO . BinaryReader ( fi . OpenRead ( ) ) ) { image = br . ReadBytes ( ( int ) br . BaseStream . Length ) ; } return LoadModulePTX ( image , options ) ; }
Load a PTX module from file
Load a PTX module from file
None
modulePath
string
None
options
CudaJitOptionCollection
Collection of linker and compiler options
Collection of linker and compiler options