Beispiel #1
0
 // GPU AMD
 /// <summary>
 /// Initializes a new instance of the <see cref="ComputeDevice"/> class.
 /// </summary>
 /// <param name="amdDevice">The <see cref="AmdGpuDevice"/></param>
 /// <param name="GPUCount">The <see cref="int"/></param>
 /// <param name="isDetectionFallback">The <see cref="bool"/></param>
 public ComputeDevice(AmdGpuDevice amdDevice, int GPUCount, bool isDetectionFallback)
 {
     ID              = amdDevice.DeviceID;
     BusID           = amdDevice.BusID;
     DeviceGroupType = DeviceGroupType.AMD_OpenCL;
     Name            = amdDevice.DeviceName;
     Enabled         = true;
     IsEtherumCapale = amdDevice.IsEtherumCapable();
     DeviceType      = DeviceType.AMD;
     NameCount       = String.Format(International.GetText("ComputeDevice_Short_Name_AMD_GPU"), GPUCount);
     if (isDetectionFallback)
     {
         UUID = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
     }
     else
     {
         UUID = amdDevice.UUID;
     }
     // sgminer extra
     //IsOptimizedVersion = amdDevice.UseOptimizedVersion;
     Codename           = amdDevice.Codename;
     InfSection         = amdDevice.InfSection;
     AlgorithmSettings  = GroupAlgorithms.CreateForDeviceList(this);
     DriverDisableAlgos = amdDevice.DriverDisableAlgos;
     GpuRam             = amdDevice.DeviceGlobalMemory;
 }
 public AmdComputeDevice(AmdGpuDevice amdDevice, int GPUCount, bool isDetectionFallback)
     : base(amdDevice.DeviceID,
            amdDevice.DeviceName,
            true,
            DeviceGroupType.AMD_OpenCL,
            amdDevice.IsEtherumCapable(),
            DeviceType.AMD,
            String.Format(International.GetText("ComputeDevice_Short_Name_AMD_GPU"), GPUCount),
            amdDevice.DeviceGlobalMemory)
 {
     if (isDetectionFallback)
     {
         UUID = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
     }
     else
     {
         UUID = amdDevice.UUID;
     }
     BusID              = amdDevice.BusID;
     Codename           = amdDevice.Codename;
     InfSection         = amdDevice.InfSection;
     AlgorithmSettings  = GroupAlgorithms.CreateForDeviceList(this);
     DriverDisableAlgos = amdDevice.DriverDisableAlgos;
     Index              = ID + ComputeDeviceManager.Avaliable.AvailCPUs + ComputeDeviceManager.Avaliable.AvailNVGPUs;
     adapterIndex       = amdDevice.AdapterIndex;
 }
Beispiel #3
0
 // Fake dev
 /// <summary>
 /// Initializes a new instance of the <see cref="ComputeDevice"/> class.
 /// </summary>
 /// <param name="id">The <see cref="int"/></param>
 public ComputeDevice(int id)
 {
     ID              = id;
     Name            = "fake_" + id;
     NameCount       = Name;
     Enabled         = true;
     DeviceType      = DeviceType.CPU;
     DeviceGroupType = DeviceGroupType.NONE;
     IsEtherumCapale = false;
     //IsOptimizedVersion = false;
     Codename = "fake";
     UUID     = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
     GpuRam   = 0;
 }
Beispiel #4
0
 // CPU
 /// <summary>
 /// Initializes a new instance of the <see cref="ComputeDevice"/> class.
 /// </summary>
 /// <param name="id">The <see cref="int"/></param>
 /// <param name="group">The <see cref="string"/></param>
 /// <param name="name">The <see cref="string"/></param>
 /// <param name="threads">The <see cref="int"/></param>
 /// <param name="affinityMask">The <see cref="ulong"/></param>
 /// <param name="CPUCount">The <see cref="int"/></param>
 public ComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int CPUCount)
 {
     ID                = id;
     Name              = name;
     Threads           = threads;
     AffinityMask      = affinityMask;
     Enabled           = true;
     DeviceGroupType   = DeviceGroupType.CPU;
     DeviceType        = DeviceType.CPU;
     NameCount         = String.Format(International.GetText("ComputeDevice_Short_Name_CPU"), CPUCount);
     UUID              = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
     AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this);
     IsEtherumCapale   = false;
     GpuRam            = 0;
 }
Beispiel #5
0
        public CPUComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int CPUCount)
            : base(id,
                   name,
                   true,
                   DeviceGroupType.CPU,
                   false,
                   DeviceType.CPU,
                   String.Format(International.GetText("ComputeDevice_Short_Name_CPU"), CPUCount),
                   0)
        {
            Threads           = threads;
            AffinityMask      = affinityMask;
            UUID              = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
            AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this);
            Index             = ID; // Don't increment for CPU

            cpuCounter = new PerformanceCounter();
            cpuCounter.CategoryName = "Processor";
            cpuCounter.CounterName  = "% Processor Time";
            cpuCounter.InstanceName = "_Total";
        }