コード例 #1
0
ファイル: View.cs プロジェクト: nguyenvuduc/ILGPU
        private static TypeNode ComputeType(
            IRContext context,
            TypeNode pointerType)
        {
            var type = pointerType as PointerType;

            return(context.CreateViewType(
                       type.ElementType,
                       type.AddressSpace));
        }
コード例 #2
0
        private static AddressSpaceType ComputeType(
            IRContext context,
            TypeNode sourceType,
            TypeNode targetElementType)
        {
            var viewType = sourceType as ViewType;

            Debug.Assert(viewType != null, "Invalid view type");
            return(context.CreateViewType(
                       targetElementType,
                       viewType.AddressSpace));
        }
コード例 #3
0
 private static AddressSpaceType ComputeType(
     IRContext context,
     TypeNode sourceType,
     MemoryAddressSpace targetAddressSpace)
 {
     if (sourceType is ViewType viewType)
     {
         return(context.CreateViewType(
                    viewType.ElementType,
                    targetAddressSpace));
     }
     else
     {
         var pointerType = sourceType as PointerType;
         return(context.CreatePointerType(
                    pointerType.ElementType,
                    targetAddressSpace));
     }
 }