/// <summary>
        /// Starts a new instance of the miner.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="resource"></param>
        /// <returns></returns>
        public override IMiner StartMiner(IMinerContext context, CpuResource resource)
        {
            var miner = new ManagedMiner(context, (CpuResource)resource);
            miner.Start();

            return miner;
        }
Beispiel #2
0
        /// <summary>
        /// Invoked by the host to begin a new miner.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="resource"></param>
        /// <returns></returns>
        public IMiner StartMiner(IMinerContext context, MinerResource resource)
        {
            var miner = new GpuMiner(context, (GpuResource)resource);
            miner.Start();

            return miner;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="cpu"></param>
 public CpuMiner(IMinerContext context, CpuResource cpu)
 {
     Context = context;
     Cpu = cpu;
 }
Beispiel #4
0
        public void Start(IMinerContext context)
        {
            string code;

            var kernelRes = Assembly.GetExecutingAssembly().GetManifestResourceStream("BitMaker.Miner.Cloo.Miner.cl");
            using (var rdr = new StreamReader(kernelRes))
                code = clProgramSource;

            var platform = ComputePlatform.Platforms[0];
            var properties = new ComputeContextPropertyList(platform);
            device = platform.Devices[0];
            ccontext = new ComputeContext(platform.Devices, properties, null, IntPtr.Zero);
            program = new ComputeProgram(ccontext, clProgramSource);
            program.Build(null, null, notify, IntPtr.Zero);
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="gpu"></param>
 public GpuMiner(IMinerContext context, GpuResource gpu)
 {
     Context = context;
     Gpu = gpu;
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="cpu"></param>
 public AvxMiner(IMinerContext context, CpuResource cpu)
     : base(context, cpu)
 {
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="cpu"></param>
 public SseMiner(IMinerContext context, CpuDevice cpu)
     : base(context, cpu)
 {
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="gpu"></param>
 public GpuMiner(IMinerContext context, GpuDevice gpu)
 {
     Context = context;
     Gpu = gpu;
 }
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="cpu"></param>
 public ManagedMiner(IMinerContext context, CpuResource cpu)
     : base(context, cpu)
 {
 }
Beispiel #10
0
 /// <summary>
 /// Implemented by children of <see cref="T:CpuMinerFactory"/> to start a custom miner implementation.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="resource"></param>
 /// <returns></returns>
 public new abstract IMiner StartMiner(IMinerContext context, CpuResource resource);
Beispiel #11
0
 /// <summary>
 /// Invoked by the host to begin a new miner.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="resource"></param>
 /// <returns></returns>
 public IMiner StartMiner(IMinerContext context, MinerResource resource)
 {
     return StartMiner(context, (CpuResource)resource);
 }
Beispiel #12
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="cpu"></param>
 protected CpuMiner(IMinerContext context, CpuDevice cpu)
 {
     Context = context;
     Cpu = cpu;
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="cpu"></param>
 public ManagedMiner(IMinerContext context, CpuDevice cpu)
     : base(context, cpu)
 {
 }