Esempio n. 1
0
 public float16(float16 other) : this(CNTKLibPINVOKE.new_float16__SWIG_1(float16.getCPtr(other)), true)
 {
     if (CNTKLibPINVOKE.SWIGPendingException.Pending)
     {
         throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 2
0
        unsafe public void computeD3DPixPackTextures(Synthesiser m_Synthesizer)
        {
            int sz = 0;

            for (int l = 0; l < Globals.cNumLevels /*m_Synthesizer.getAnalyser().nbLevels()*/; l++)
            {
                int csz = Synthesiser.bufferSizeFromWindow(bufferrgn(l));
                sz = Math.Max(csz, sz);
            }

            mD3DPixPackOffsets = new Texture[m_iNbLevels, Globals.cNumCorrectionPasses, 4];

            for (int l = 0; l < m_iNbLevels; l++)
            {
                Window window = bufferrgn(l);
                for (int pass = 0; pass < Globals.cNumCorrectionPasses; pass++)
                {
                    for (int sub = 0; sub < 4; sub++)
                    {
                        // . which quadrant to update ?
                        int ai = (m_Synthesizer.m_SubpassesOrderingTbl[pass % Globals.SYNTH_ORDER_NUM_PASSES][sub][0] + window.left()) & 1;
                        int aj = (m_Synthesizer.m_SubpassesOrderingTbl[pass % Globals.SYNTH_ORDER_NUM_PASSES][sub][1] + window.top()) & 1;
                        Globals.Assert(ai >= 0 && aj >= 0);


                        Vector4 qszs = m_Synthesizer.bufferSize(sz);

                        mD3DPixPackOffsets[l, pass, sub] = new Texture(BRenderDevice.getDevice(), 5, 5, 1, 0, Format.G16R16F, Pool.Managed);
                        GraphicsStream texstream = mD3DPixPackOffsets[l, pass, sub].LockRectangle(0, LockFlags.None);
                        ushort *       data      = (ushort *)texstream.InternalDataPointer;
                        int            rectPitch = 5 * 2;

                        for (int x = 0; x < 5; x++)
                        {
                            for (int y = 0; y < 5; y++)
                            {
                                int     ox = x - 2;
                                int     oy = y - 2;
                                int     fx = (int)Math.Floor((ox + ai) / 2.0f);
                                int     fy = (int)Math.Floor((oy + aj) / 2.0f);
                                Vector4 vq = new Vector4(
                                    ((float)(fx + (sz >> 1) * ox) + ai * (sz >> 1)) / qszs.X,
                                    ((float)(fy + (sz >> 1) * oy) + aj * (sz >> 1)) / qszs.Y,
                                    0, 0);
                                //offs[x + y * 5] = vq;

                                int     srcIndex = x * 2 * sizeof(byte) + y * rectPitch;
                                float16 xx       = new float16(vq.X);
                                float16 yy       = new float16(vq.Y);
                                data[srcIndex]     = xx.getInternalDat();
                                data[srcIndex + 1] = yy.getInternalDat();
                            }
                        }

                        mD3DPixPackOffsets[l, pass, sub].UnlockRectangle(0);
                    }
                }
            }
        }
Esempio n. 3
0
 public void SetValue(float16 value)
 {
     CNTKLibPINVOKE.NDArrayView_SetValue__SWIG_2(swigCPtr, float16.getCPtr(value));
     if (CNTKLibPINVOKE.SWIGPendingException.Pending)
     {
         throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 4
0
        public static float16 create(double d)
        {
            float16 ret = new float16(CNTKLibPINVOKE.float16_create__SWIG_1(d), true);

            if (CNTKLibPINVOKE.SWIGPendingException.Pending)
            {
                throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 5
0
            public Pos16(float _x, float _y, float _z)
            {
                x = new float16(_x); y = new float16(_y); z = new float16(_z);
                w = new float16(0);

                if (Pos16.vertDecl == null)
                {
                    VertexElement[] elements = new VertexElement[]
                    {
                        new VertexElement(0, 0, DeclarationType.Float16Four, DeclarationMethod.Default, DeclarationUsage.Position, 0),
                        VertexElement.VertexDeclarationEnd,
                    };
                    Pos16.vertDecl = new VertexDeclaration(BRenderDevice.getDevice(), elements);
                }
            }
Esempio n. 6
0
            public Pos16_Color(float _x, float _y, float _z, int _color)
            {
                float16 tmp = new float16(0);

                tmp.fromFloat(_x); x = tmp.getInternalDat();
                tmp.fromFloat(_y); y = tmp.getInternalDat();
                tmp.fromFloat(_z); z = tmp.getInternalDat();
                w = 0;

                color = _color;

                if (Pos16_Color.vertDecl == null)
                {
                    VertexElement[] elements = new VertexElement[]
                    {
                        new VertexElement(0, 0, DeclarationType.Float16Four, DeclarationMethod.Default, DeclarationUsage.Position, 0),
                        new VertexElement(0, 8, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),
                        VertexElement.VertexDeclarationEnd,
                    };
                    Pos16_Color.vertDecl = new VertexDeclaration(BRenderDevice.getDevice(), elements);
                }
            }
Esempio n. 7
0
 public int16 isinf(float16 x)
 {
     return(new int16());
 }
Esempio n. 8
0
 public int16 signbit(float16 x)
 {
     return(new int16());
 }
Esempio n. 9
0
 public int16 isfinite(float16 x)
 {
     return(new int16());
 }
Esempio n. 10
0
 public int16 isunordered(float16 x, float16 y)
 {
     return(new int16());
 }
Esempio n. 11
0
 public int16 isnormal(float16 x)
 {
     return(new int16());
 }
Esempio n. 12
0
 public int16 isnan(float16 x)
 {
     return(new int16());
 }
Esempio n. 13
0
 public void vstorea_half16_rtn(float16 data, int offset, half[] p)
 {
 }
Esempio n. 14
0
 public void vstore_half16(float16 data, int offset, half[] p)
 {
 }
Esempio n. 15
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(float16 obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }