Exemplo n.º 1
0
        /// <summary>
        /// Manually adds a Program to the database
        /// </summary>
        /// <param name="instance">CLAPI Instance for the current thread</param>
        /// <param name="file">Path fo the file</param>
        public void AddProgram(CLAPI instance, string file)
        {
            if (!CLAPI.FileExists(file))
            {
                throw new Exception(file);
            }


            string path = Path.GetFullPath(file);

            logger.Log(LogType.Log, "Creating CLProgram from file: " + file);
            CLProgram program = new CLProgram(instance, path, GenDataType);

            foreach (KeyValuePair <string, CLKernel> containedKernel in program.ContainedKernels)
            {
                if (!LoadedKernels.ContainsKey(containedKernel.Key))
                {
                    logger.Log(LogType.Log, "Adding Kernel: " + containedKernel.Key);
                    LoadedKernels.Add(containedKernel.Key, containedKernel.Value);
                }
                else
                {
                    logger.Log(LogType.Log,
                               "Kernel with name: " + containedKernel.Key + " is already loaded. Skipping...");
                }
            }
        }
Exemplo n.º 2
0
 public bool FileExists(string file)
 {
     return(CLAPI.FileExists(file));
 }