/// <summary> /// Finds, Parses and Loads all define statements /// </summary> private static void ParseDefines(string key, DefineHandler handler, List <string> source, Dictionary <string, CLBufferInfo> defines, int width, int height, int depth, int channelCount, KernelDatabase kernelDb) { for (int i = source.Count - 1; i >= 0; i--) { if (source[i].StartsWith(key)) { string[] kvp = source[i].Remove(0, key.Length).Split(FunctionNamePostfix); handler?.Invoke(kvp, defines, width, height, depth, channelCount, kernelDb); source.RemoveAt(i); } } }
/// <summary> /// Finds, Parses and Loads all define statements /// </summary> private void ParseDefines(CLAPI instance, string key, DefineHandler handler, List <string> source, Dictionary <string, CLBufferInfo> defines, int width, int height, int depth, int channelCount, KernelDatabase kernelDb) { for (int i = source.Count - 1; i >= 0; i--) { if (source[i].StartsWith(key)) { string[] kvp = source[i].Remove(0, key.Length) .Split(new[] { FUNCTION_NAME_POSTFIX }, StringSplitOptions.None); handler?.Invoke(instance, kvp, defines, width, height, depth, channelCount, kernelDb); source.RemoveAt(i); } } }