示例#1
0
        public static string GetPathFor(MinerBaseType minerBaseType, AlgorithmType algoType, DeviceGroupType devGroupType, string devCodenameAMD, bool isOptimizedAMD, CPUExtensionType MostOptimizedCPUExtensionType)
        {
            switch (minerBaseType)
            {
            case MinerBaseType.cpuminer:
                return(CPU_GROUP.cpu_miner_opt(MostOptimizedCPUExtensionType));

            case MinerBaseType.ccminer:
                return(NVIDIA_GROUPS.ccminer_path(algoType, devGroupType));

            case MinerBaseType.sgminer:
                return(AMD_GROUP.sgminer_path(algoType, devCodenameAMD, isOptimizedAMD));

            case MinerBaseType.nheqminer:
                return(MinerPaths.nheqminer);

            case MinerBaseType.eqm:
                return(MinerPaths.eqm);

            case MinerBaseType.ethminer:
                return(MinerPaths.ethminer);

            case MinerBaseType.ClaymoreAMD:
                return(AMD_GROUP.ClaymorePath(algoType));

            case MinerBaseType.OptiminerAMD:
                return(MinerPaths.OptiminerZcashMiner);

            case MinerBaseType.excavator:
                return(MinerPaths.excavator);
            }
            return(MinerPaths.NONE);
        }
示例#2
0
        public static string GetOptimizedMinerPath(AlgorithmType algorithmType, DeviceType deviceType, DeviceGroupType deviceGroupType, string devCodename, bool isOptimized)
        {
            // special cases
            // AlgorithmType.DaggerHashimoto special shared case
            if (algorithmType == AlgorithmType.DaggerHashimoto &&
                (deviceType == DeviceType.AMD || deviceType == DeviceType.NVIDIA))
            {
                return(MinerPaths.ethminer);
            }
            // AlgorithmType.Equihash special shared case
            if (algorithmType == AlgorithmType.Equihash)
            {
                if (deviceGroupType == DeviceGroupType.NVIDIA_5_x || deviceGroupType == DeviceGroupType.NVIDIA_6_x ||
                    (MinersManager.EquihashCPU_USE_eqm() && DeviceGroupType.CPU == deviceGroupType))
                {
                    return(MinerPaths.eqm);
                }
                else if (deviceType == DeviceType.AMD && ConfigManager.GeneralConfig.Use3rdPartyMiners == Use3rdPartyMiners.YES)    // TODO remove state
                {
                    return(MinerPaths.ClaymoreZcashMiner);
                }
                else   // supports all DeviceTypes
                {
                    return(MinerPaths.nheqminer);
                }
            }
            // normal stuff
            // CPU
            if (deviceType == DeviceType.CPU)
            {
                return(CPU_GROUP.cpu_miner_opt(CPUUtils.GetMostOptimized()));
            }
            // NVIDIA
            if (deviceType == DeviceType.NVIDIA)
            {
                var nvidiaGroup = deviceGroupType;
                // sm21 and sm3x have same settings
                if (nvidiaGroup == DeviceGroupType.NVIDIA_2_1 || nvidiaGroup == DeviceGroupType.NVIDIA_3_x)
                {
                    return(NVIDIA_GROUPS.ccminer_sm21_or_sm3x(algorithmType));
                }
                // sm5x and sm6x have same settings
                if (nvidiaGroup == DeviceGroupType.NVIDIA_5_x || nvidiaGroup == DeviceGroupType.NVIDIA_6_x)
                {
                    return(NVIDIA_GROUPS.ccminer_sm5x_or_sm6x(algorithmType));
                }
            }
            // AMD
            if (deviceType == DeviceType.AMD)
            {
                return(AMD_GROUP.sgminer_path(algorithmType, devCodename, isOptimized));
            }

            return(NONE);
        }
示例#3
0
        // NEW START
        ////////////////////////////////////////////
        // Pure functions
        //public static bool IsMinerAlgorithmAvaliable(List<Algorithm> algos, MinerBaseType minerBaseType, AlgorithmType algorithmType) {
        //    return algos.FindIndex((a) => a.MinerBaseType == minerBaseType && a.CryptoMiner937ID == algorithmType) > -1;
        //}
        /// <summary>
        /// The GetPathFor
        /// </summary>
        /// <param name="minerBaseType">The <see cref="MinerBaseType"/></param>
        /// <param name="algoType">The <see cref="AlgorithmType"/></param>
        /// <param name="devGroupType">The <see cref="DeviceGroupType"/></param>
        /// <param name="def">The <see cref="bool"/></param>
        /// <returns>The <see cref="string"/></returns>
        public static string GetPathFor(MinerBaseType minerBaseType, AlgorithmType algoType, DeviceGroupType devGroupType, CPUExtensionType MostOptimizedCPUExtensionType, bool def = false)
        {
            if (!def & configurableMiners.Contains(minerBaseType))
            {
                // Override with internals
                var path = minerPathPackages.Find(p => p.DeviceType == devGroupType)
                           .MinerTypes.Find(p => p.Type == minerBaseType)
                           .Algorithms.Find(p => p.Algorithm == algoType);
                if (path != null)
                {
                    if (File.Exists(path.Path))
                    {
                        return(path.Path);
                    }
                    else
                    {
                        Helpers.ConsolePrint("PATHS", String.Format("Path {0} not found, using defaults", path.Path));
                    }
                }
            }
            switch (minerBaseType)
            {
            case MinerBaseType.cpuminer:
                return(CPU_GROUP.cpu_miner_opt(MostOptimizedCPUExtensionType));

            case MinerBaseType.ccminer:
                return(NVIDIA_GROUPS.Ccminer_path(algoType, devGroupType));

            case MinerBaseType.ccminer_tpruvot2:
                return(NVIDIA_GROUPS.Ccminer_path(algoType, devGroupType));

            case MinerBaseType.sgminer:
                return(AMD_GROUP.Sgminer_path(algoType));

            case MinerBaseType.GatelessGate:
                return(AMD_GROUP.Glg_path(algoType));

            case MinerBaseType.Claymore:
                return(AMD_GROUP.ClaymorePath(algoType));

            case MinerBaseType.OptiminerAMD:
                return(Data.OptiminerZcashMiner);

            case MinerBaseType.experimental:
                return(EXPERIMENTAL.GetPath(algoType, devGroupType));

            case MinerBaseType.CPU_XMRig:
                return(Data.CPU_XMRig);

            case MinerBaseType.CPU_XMRigUPX:
                return(Data.CPU_XMRigUPX);

            case MinerBaseType.CPU_RKZ:
                return(Data.CPU_RKZ);

            case MinerBaseType.CPU_rplant:
                return(Data.CPU_rplant);

            case MinerBaseType.CPU_nosuch:
                return(Data.CPU_nosuch);

            case MinerBaseType.trex:
                return(NVIDIA_GROUPS.trex(algoType, devGroupType));

            case MinerBaseType.MiniZ:
                return(NVIDIA_GROUPS.MiniZ(algoType, devGroupType));

            case MinerBaseType.ZEnemy:
                return(NVIDIA_GROUPS.ZEnemy(algoType, devGroupType));

            case MinerBaseType.CryptoDredge:
                return(NVIDIA_GROUPS.CryptoDredge(algoType, devGroupType));

            case MinerBaseType.CPU_verium:
                return(Data.CPU_verium);
            }
            return(Data.NONE);
        }