Exemple #1
0
            public override string Output(LinqParser parser)
            {
                var result = string.Format("{0}{1} {2}", parser.MapType(Type),
                                           Kind == KernelArgumentKind.Buffer ? "*" : "",
                                           Name);

                switch (Access)
                {
                case KernelArgumentAccess.Read:
                    result = "read_only " + result;
                    break;

                case KernelArgumentAccess.Write:
                    result = "write_only " + result;
                    break;

                default:
                    break;
                }
                switch (Memory)
                {
                case KernelArgumentMemory.Global:
                    result = "global " + result;
                    break;

                case KernelArgumentMemory.Local:
                    result = "local " + result;
                    break;

                default:
                    break;
                }
                return(result);
            }
Exemple #2
0
 public override string Output(LinqParser parser)
 {
     return(string.Format("({0}) {{ {1} }}",
                          parser.MapType(StructType),
                          InitFields.Select(t => (StructType.IsCLUnion() ?
                                                  string.Format(".{0} = {1}", t.Item1.Output(parser), t.Item2.Output(parser)) :
                                                  t.Item2.Output(parser)))
                          .SeparateWith(", ")));
 }
Exemple #3
0
 public override string Output(LinqParser parser)
 {
     return(string.Format("{0}[{1}] ( {2} )", parser.MapType(ItemType), ItemCount,
                          Items.Select(e => e.Output(parser)).SeparateWith(",\n\t")));
 }