Ejemplo n.º 1
0
 // CPU
 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;
 }
Ejemplo n.º 2
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";
        }