private static void StartServer() { //fire up the CUDA_Core; CUDA_Core = new CUDAProcessor(); CUDA_Core.Init(); CUDA_Core.SetContext(); //fire up the IPC server ipc_server = new SharedMemoryIPC(); }
/// <summary> /// Starts the compute core with no source specified, CUDA thread starts in the background /// </summary> public ComputeCore(bool init_cuda = true) { Console.WriteLine(":: ExcelIdea Advanced Computation Engine starting ::"); Console.WriteLine("[64-bit OS: " + Environment.Is64BitOperatingSystem + ", 64-bit process: " + Environment.Is64BitProcess + ", Processors: " + Environment.ProcessorCount + ", High-res timer: " + Stopwatch.IsHighResolution + "]"); if (init_cuda) { //initialise CUDA in the background if not started if (CUDA_Core == null || !CUDA_Core.core_up) { Console.WriteLine("=> Starting CUDA cores"); CUDA_Core = new CUDAProcessor(); cuda_thread = new Thread(new ThreadStart(CUDA_Core.Init)); cuda_thread.Start(); } } load_error = true; }
/// <summary> /// Initialise the Advanced Computation Engine with source data from an Excel file. /// </summary> /// <param name="sourcePath">The path of the source data Excel file</param> public ComputeCore(string sourcePath) { Stopwatch sw = new Stopwatch(); Console.WriteLine(":: ExcelIdea Advanced Computation Engine starting ::"); Console.WriteLine("[64-bit OS: " + Environment.Is64BitOperatingSystem + ", 64-bit process: " + Environment.Is64BitProcess + ", Processors: " + Environment.ProcessorCount + ", High-res timer: " + Stopwatch.IsHighResolution + "]"); //initialise CUDA in the background if not started if (CUDA_Core == null || !CUDA_Core.core_up) { Console.WriteLine("=> Starting CUDA cores"); CUDA_Core = new CUDAProcessor(); cuda_thread = new Thread(new ThreadStart(CUDA_Core.Init)); cuda_thread.Start(); } Console.WriteLine("=> Reading Excel file"); sw.Start(); FileLoader loader = new FileLoader(sourcePath); str_error_message = loader.LoadFile(out dict_loader_formulas, out dict_loader_constants, out dict_loader_array_formulas, out dict_loader_string_constants, out dict_sheet_name_map); if (dict_loader_constants == null && dict_loader_formulas == null) { Console.WriteLine("!! Error: Could not open the specified file"); if (str_error_message != "") { Console.WriteLine("\t Reason: " + str_error_message); } Console.ReadLine(); load_error = true; return; } sw.Stop(); Console.WriteLine("\t --Loader time: " + sw.Elapsed.TotalMilliseconds + " ms"); load_error = false; }
public void SetCUDAProcessor(CUDAProcessor cuda_in) { CUDA_Core = cuda_in; CUDA_Core.SetContext(); }