コード例 #1
0
        private static string getOpenCLSource(HighLevel.HlGraph HLgraph)
        {
            using (StringWriter Srcwriter = new StringWriter())
            {
                OpenCLInterop.WriteOpenCL(HLgraph, Srcwriter);
                string OpenClSource = Srcwriter.ToString();

                if (DumpCode > 2)
                {
                    System.Console.WriteLine(OpenClSource);
                }

                return(OpenClSource);
            }
        }
コード例 #2
0
        private static void writeOpenClStructs(Hybrid.MsilToOpenCL.HighLevel.HlGraph HLgraph, StringWriter Srcwriter)
        {
            Dictionary <Type, int> TypeMarks = new Dictionary <Type, int>();

            foreach (HighLevel.ArgumentLocation Argument in HLgraph.Arguments)
            {
                if (HLgraph.ValueTypeMap.ContainsKey(Argument.DataType))
                {
                    TypeMarks[Argument.DataType] = 1;
                }
                else if ((Argument.DataType.IsByRef || Argument.DataType.IsPointer) && HLgraph.ValueTypeMap.ContainsKey(Argument.DataType.GetElementType()))
                {
                    TypeMarks[Argument.DataType.GetElementType()] = 1;
                }
            }
            foreach (KeyValuePair <Type, int> Entry in TypeMarks)
            {
                OpenCLInterop.WriteOpenCL(HLgraph, Entry.Key, Srcwriter);
            }
        }
コード例 #3
0
        private static string getOpenCLSource(List <HighLevel.HlGraph> List)
        {
            using (StringWriter Srcwriter = new StringWriter())
            {
                foreach (HighLevel.HlGraph HLgraph in List)
                {
                    writeOpenClStructs(HLgraph, Srcwriter);
                }

                foreach (HighLevel.HlGraph HLgraph in List)
                {
                    OpenCLInterop.WriteOpenCL(HLgraph, Srcwriter);
                }

                string OpenClSource = Srcwriter.ToString();

                if (DumpCode > 2)
                {
                    System.Console.WriteLine(OpenClSource);
                }

                return(OpenClSource);
            }
        }