GetGroupName() public static méthode

public static GetGroupName ( DeviceGroupType type, int id ) : string
type DeviceGroupType
id int
Résultat string
 // GPU AMD
 public ComputeDevice(AmdGpuDevice amdDevice, int GPUCount, bool isDetectionFallback)
 {
     ID = amdDevice.DeviceID;
     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, int adl2Index)
            : base(amdDevice.DeviceID,
                   amdDevice.DeviceName,
                   true,
                   DeviceGroupType.AMD_OpenCL,
                   DeviceType.AMD,
                   string.Format(Translations.Tr("GPU#{0}"), gpuCount),
                   amdDevice.DeviceGlobalMemory)
        {
            Uuid = isDetectionFallback
                ? GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType)
                : amdDevice.Uuid;
            BusID              = amdDevice.BusID;
            Codename           = amdDevice.Codename;
            InfSection         = amdDevice.InfSection;
            AlgorithmSettings  = DefaultAlgorithms.GetAlgorithmsForDevice(this);
            DriverDisableAlgos = amdDevice.DriverDisableAlgos;
            Index              = ID + AvailableDevices.AvailCpus + AvailableDevices.AvailNVGpus;
            _adapterIndex      = amdDevice.Adl1Index;

            ADL.ADL2_Main_Control_Create?.Invoke(ADL.ADL_Main_Memory_Alloc, 0, ref _adlContext);
            _adapterIndex2 = adl2Index;

            // plugin device
            var bd = new BaseDevice(DeviceType.AMD, Uuid, Name, ID);

            PluginDevice = new AMDDevice(bd, amdDevice.BusID, amdDevice.DeviceGlobalMemory, Codename, InfSection);
        }
        //TODO fix constructor to not include 3rd party handles + refactor inside interface device info (lookup fans speed/temps/...)
        public CudaComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int gpuCount,
                                 NvPhysicalGpuHandle nvHandle, nvmlDevice nvmlHandle)
            : base((int)cudaDevice.DeviceID,
                   cudaDevice.GetName(),
                   true,
                   group,
                   DeviceType.NVIDIA,
                   string.Format(Translations.Tr("GPU#{0}"), gpuCount),
                   cudaDevice.DeviceGlobalMemory)
        {
            BusID   = cudaDevice.pciBusID;
            SMMajor = cudaDevice.SM_major;
            SMMinor = cudaDevice.SM_minor;
            // if no nvml loaded fallback ID
            if (string.IsNullOrEmpty(cudaDevice.UUID))
            {
                Uuid = GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
            }
            else
            {
                Uuid = cudaDevice.UUID;
            }
            AlgorithmSettings = DefaultAlgorithms.GetAlgorithmsForDevice(this);
            Index             = ID + AvailableDevices.AvailCpus; // increment by CPU count

            _nvHandle   = nvHandle;
            _nvmlDevice = nvmlHandle;

            ShouldRunEthlargement = cudaDevice.DeviceName.Contains("1080") || cudaDevice.DeviceName.Contains("Titan Xp");
        }
Exemple #4
0
 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;
 }
Exemple #5
0
        public CpuComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int cpuCount)
            : base(id,
                   name,
                   true,
                   DeviceGroupType.CPU,
                   DeviceType.CPU,
                   string.Format(Translations.Tr("CPU#{0}"), cpuCount),
                   0)
        {
            Threads      = threads;
            AffinityMask = affinityMask;
            var uuid = GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);

            Uuid = uuid;
            AlgorithmSettings = DefaultAlgorithms.GetAlgorithmsForDevice(this);
            Index             = ID; // Don't increment for CPU

            _cpuCounter = new PerformanceCounter
            {
                CategoryName = "Processor",
                CounterName  = "% Processor Time",
                InstanceName = "_Total"
            };

            // plugin device
            var bd = new BaseDevice(DeviceType.CPU, uuid, name, ID);       // TODO UUID

            PluginDevice = new CPUDevice(bd, threads, true, affinityMask); // TODO hyperthreading
        }
 // Fake dev
 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);
 }
 // Fake dev
 public ComputeDevice(int id)
 {
     ID              = id;
     Name            = "fake_" + id;
     NameCount       = Name;
     Enabled         = true;
     DeviceType      = DeviceType.CPU;
     DeviceGroupType = DeviceGroupType.NONE;
     //IsOptimizedVersion = false;
     Codename = "fake";
     Uuid     = GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
     GpuRam   = 0;
 }
Exemple #8
0
 // CPU
 public ComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int CPUCount)
 {
     ID              = id;
     Name            = name;
     Threads         = threads;
     AffinityMask    = affinityMask;
     _nameNoNums     = name;
     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);
 }
 // 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.CreateForDevice(this);
     IsEtherumCapale   = false;
 }
        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";
        }
        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(Translations.Tr("CPU#{0}"), 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
            {
                CategoryName = "Processor",
                CounterName  = "% Processor Time",
                InstanceName = "_Total"
            };
        }
        public AmdComputeDevice(AmdGpuDevice amdDevice, int gpuCount, bool isDetectionFallback, int adl2Index)
            : base(amdDevice.DeviceID,
                   amdDevice.DeviceName,
                   true,
                   DeviceGroupType.AMD_OpenCL,
                   amdDevice.IsEtherumCapable(),
                   DeviceType.AMD,
                   string.Format(Translations.Tr("GPU#{0}"), gpuCount),
                   amdDevice.DeviceGlobalMemory)
        {
            Uuid = isDetectionFallback
                ? GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType)
                : amdDevice.UUID;
            BusID              = amdDevice.BusID;
            Codename           = amdDevice.Codename;
            InfSection         = amdDevice.InfSection;
            AlgorithmSettings  = GroupAlgorithms.CreateForDeviceList(this);
            DriverDisableAlgos = amdDevice.DriverDisableAlgos;
            Index              = ID + ComputeDeviceManager.Available.AvailCpus + ComputeDeviceManager.Available.AvailNVGpus;
            _adapterIndex      = amdDevice.AdapterIndex;

            ADL.ADL2_Main_Control_Create?.Invoke(ADL.ADL_Main_Memory_Alloc, 0, ref _adlContext);
            _adapterIndex2 = adl2Index;
        }