public static void ApplyPrecompile(CudaCompiler compiler, DeviceKernelTemplate template, int tensorCount) { foreach (ApplySpecialization spec in ApplySpecialization.AllSpecializations(tensorCount)) { template.PtxForConfig(compiler, spec.GetConfig()); } }
public byte[] GetPtx(CudaCompiler compiler) { if (this.ptx == null) { this.Precompile(compiler); } return(this.ptx); }
/// <summary> /// Gets the PTX. /// </summary> /// <param name="compiler">The compiler.</param> /// <returns>System.Byte[].</returns> public byte[] GetPtx(CudaCompiler compiler) { if (ptx == null) { Precompile(compiler); } return(ptx); }
public static void PrecompileAllFields(object instance, CudaCompiler compiler) { var type = instance.GetType(); foreach (var field in type.GetFields()) { if (typeof(IPrecompilable).IsAssignableFrom(field.FieldType)) { var precompilableField = (IPrecompilable)field.GetValue(instance); Console.WriteLine("Compiling field " + field.Name); precompilableField.Precompile(compiler); } } }
public void Precompile(CudaCompiler compiler) { this.ptx = compiler.CompileToPtx(this.code, this.requiredHeaders); }
/// <summary> /// Precompiles the specified compiler. /// </summary> /// <param name="compiler">The compiler.</param> public void Precompile(CudaCompiler compiler) { ptx = compiler.CompileToPtx(code, requiredHeaders); }