public unsafe KernelNetworkTrain(global::Org.Encog.Engine.Opencl.EncogCLDevice p0, global::Org.Encog.Engine.Network.Flat.FlatNetwork p1, global::Org.Encog.Engine.Data.IEngineIndexableSet p2, int p3)
            : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
        {
            if (((global::Java.Lang.Object) this).Handle != IntPtr.Zero)
            {
                return;
            }

            try {
                JValue *__args = stackalloc JValue [4];
                __args [0] = new JValue(p0);
                __args [1] = new JValue(p1);
                __args [2] = new JValue(p2);
                __args [3] = new JValue(p3);
                if (GetType() != typeof(KernelNetworkTrain))
                {
                    SetHandle(
                        global::Android.Runtime.JNIEnv.StartCreateInstance(GetType(), "(Lorg/encog/engine/opencl/EncogCLDevice;Lorg/encog/engine/network/flat/FlatNetwork;Lorg/encog/engine/data/EngineIndexableSet;I)V", __args),
                        JniHandleOwnership.TransferLocalRef);
                    global::Android.Runtime.JNIEnv.FinishCreateInstance(((global::Java.Lang.Object) this).Handle, "(Lorg/encog/engine/opencl/EncogCLDevice;Lorg/encog/engine/network/flat/FlatNetwork;Lorg/encog/engine/data/EngineIndexableSet;I)V", __args);
                    return;
                }

                if (id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_Lorg_encog_engine_network_flat_FlatNetwork_Lorg_encog_engine_data_EngineIndexableSet_I == IntPtr.Zero)
                {
                    id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_Lorg_encog_engine_network_flat_FlatNetwork_Lorg_encog_engine_data_EngineIndexableSet_I = JNIEnv.GetMethodID(class_ref, "<init>", "(Lorg/encog/engine/opencl/EncogCLDevice;Lorg/encog/engine/network/flat/FlatNetwork;Lorg/encog/engine/data/EngineIndexableSet;I)V");
                }
                SetHandle(
                    global::Android.Runtime.JNIEnv.StartCreateInstance(class_ref, id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_Lorg_encog_engine_network_flat_FlatNetwork_Lorg_encog_engine_data_EngineIndexableSet_I, __args),
                    JniHandleOwnership.TransferLocalRef);
                JNIEnv.FinishCreateInstance(((global::Java.Lang.Object) this).Handle, class_ref, id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_Lorg_encog_engine_network_flat_FlatNetwork_Lorg_encog_engine_data_EngineIndexableSet_I, __args);
            } finally {
            }
        }
        public unsafe OpenCLTrainingProfile(global::Org.Encog.Engine.Opencl.EncogCLDevice p0)
            : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
        {
            if (((global::Java.Lang.Object) this).Handle != IntPtr.Zero)
            {
                return;
            }

            try {
                JValue *__args = stackalloc JValue [1];
                __args [0] = new JValue(p0);
                if (GetType() != typeof(OpenCLTrainingProfile))
                {
                    SetHandle(
                        global::Android.Runtime.JNIEnv.StartCreateInstance(GetType(), "(Lorg/encog/engine/opencl/EncogCLDevice;)V", __args),
                        JniHandleOwnership.TransferLocalRef);
                    global::Android.Runtime.JNIEnv.FinishCreateInstance(((global::Java.Lang.Object) this).Handle, "(Lorg/encog/engine/opencl/EncogCLDevice;)V", __args);
                    return;
                }

                if (id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_ == IntPtr.Zero)
                {
                    id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_ = JNIEnv.GetMethodID(class_ref, "<init>", "(Lorg/encog/engine/opencl/EncogCLDevice;)V");
                }
                SetHandle(
                    global::Android.Runtime.JNIEnv.StartCreateInstance(class_ref, id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_, __args),
                    JniHandleOwnership.TransferLocalRef);
                JNIEnv.FinishCreateInstance(((global::Java.Lang.Object) this).Handle, class_ref, id_ctor_Lorg_encog_engine_opencl_EncogCLDevice_, __args);
            } finally {
            }
        }
Exemple #3
0
        static IntPtr n_Add_Lorg_encog_engine_opencl_EncogCLDevice_arrayDarrayD(IntPtr jnienv, IntPtr native__this, IntPtr native_p0, IntPtr native_p1, IntPtr native_p2)
        {
            global::Org.Encog.Engine.Opencl.Kernels.KernelVectorAdd __this = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Opencl.Kernels.KernelVectorAdd> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
            global::Org.Encog.Engine.Opencl.EncogCLDevice           p0     = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Opencl.EncogCLDevice> (native_p0, JniHandleOwnership.DoNotTransfer);
            double[] p1    = (double[])JNIEnv.GetArray(native_p1, JniHandleOwnership.DoNotTransfer, typeof(double));
            double[] p2    = (double[])JNIEnv.GetArray(native_p2, JniHandleOwnership.DoNotTransfer, typeof(double));
            IntPtr   __ret = JNIEnv.NewArray(__this.Add(p0, p1, p2));

            if (p1 != null)
            {
                JNIEnv.CopyArray(p1, native_p1);
            }
            if (p2 != null)
            {
                JNIEnv.CopyArray(p2, native_p2);
            }
            return(__ret);
        }
Exemple #4
0
        public virtual unsafe double[] Add(global::Org.Encog.Engine.Opencl.EncogCLDevice p0, double[] p1, double[] p2)
        {
            if (id_add_Lorg_encog_engine_opencl_EncogCLDevice_arrayDarrayD == IntPtr.Zero)
            {
                id_add_Lorg_encog_engine_opencl_EncogCLDevice_arrayDarrayD = JNIEnv.GetMethodID(class_ref, "add", "(Lorg/encog/engine/opencl/EncogCLDevice;[D[D)[D");
            }
            IntPtr native_p1 = JNIEnv.NewArray(p1);
            IntPtr native_p2 = JNIEnv.NewArray(p2);

            try {
                JValue *__args = stackalloc JValue [3];
                __args [0] = new JValue(p0);
                __args [1] = new JValue(native_p1);
                __args [2] = new JValue(native_p2);

                double[] __ret;
                if (GetType() == ThresholdType)
                {
                    __ret = (double[])JNIEnv.GetArray(JNIEnv.CallObjectMethod(((global::Java.Lang.Object) this).Handle, id_add_Lorg_encog_engine_opencl_EncogCLDevice_arrayDarrayD, __args), JniHandleOwnership.TransferLocalRef, typeof(double));
                }
                else
                {
                    __ret = (double[])JNIEnv.GetArray(JNIEnv.CallNonvirtualObjectMethod(((global::Java.Lang.Object) this).Handle, ThresholdClass, JNIEnv.GetMethodID(ThresholdClass, "add", "(Lorg/encog/engine/opencl/EncogCLDevice;[D[D)[D"), __args), JniHandleOwnership.TransferLocalRef, typeof(double));
                }
                return(__ret);
            } finally {
                if (p1 != null)
                {
                    JNIEnv.CopyArray(native_p1, p1);
                    JNIEnv.DeleteLocalRef(native_p1);
                }
                if (p2 != null)
                {
                    JNIEnv.CopyArray(native_p2, p2);
                    JNIEnv.DeleteLocalRef(native_p2);
                }
            }
        }
 static void n_SetDevice_Lorg_encog_engine_opencl_EncogCLDevice_(IntPtr jnienv, IntPtr native__this, IntPtr native_p0)
 {
     global::Org.Encog.Engine.Network.Train.Prop.OpenCLTrainingProfile __this = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Network.Train.Prop.OpenCLTrainingProfile> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
     global::Org.Encog.Engine.Opencl.EncogCLDevice p0 = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Opencl.EncogCLDevice> (native_p0, JniHandleOwnership.DoNotTransfer);
     __this.Device = p0;
 }
 static IntPtr n_GetDevice(IntPtr jnienv, IntPtr native__this)
 {
     global::Org.Encog.Engine.Opencl.EncogCLDevice __this = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Opencl.EncogCLDevice> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
     return(JNIEnv.ToLocalJniHandle(__this.Device));
 }
 static IntPtr n_GetDeviceString_I(IntPtr jnienv, IntPtr native__this, int p0)
 {
     global::Org.Encog.Engine.Opencl.EncogCLDevice __this = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Opencl.EncogCLDevice> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
     return(JNIEnv.NewString(__this.GetDeviceString(p0)));
 }
 static long n_GetMaxWorkGroupSize(IntPtr jnienv, IntPtr native__this)
 {
     global::Org.Encog.Engine.Opencl.EncogCLDevice __this = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Opencl.EncogCLDevice> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
     return(__this.MaxWorkGroupSize);
 }
 static bool n_IsCPU(IntPtr jnienv, IntPtr native__this)
 {
     global::Org.Encog.Engine.Opencl.EncogCLDevice __this = global::Java.Lang.Object.GetObject <global::Org.Encog.Engine.Opencl.EncogCLDevice> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
     return(__this.IsCPU);
 }