Example #1
0
 private static int GetDevicePciBusID(OpenCl.DotNetCore.Devices.Device device, int deviceID)
 {
     try { return(API.AMD.GetAmdDevicePciBusID(device)); }
     catch (Exception ex)
     {
         Log(ex);
         Log(Level.Error, $"Failed to get PCI bus ID from device #{deviceID}");
     }
     return(-1);
 }
Example #2
0
 public static ulong GetAvailableMemory(OpenCl.DotNetCore.Devices.Device device, int deviceID)
 {
     try { return(API.AMD.GetAvailableMemory(device)); }
     catch (Exception ex)
     {
         Log(ex);
         Log(Level.Error, $"Failed to get free memory from device #{deviceID}");
     }
     return(0);
 }
Example #3
0
 private static string GetDeviceName(OpenCl.DotNetCore.Devices.Device device, int deviceID)
 {
     try
     {
         var deviceName = API.AMD.GetAmdDeviceName(device);
         return(string.IsNullOrWhiteSpace(deviceName)
             ? device.Name
             : deviceName);
     }
     catch (Exception ex)
     {
         Log(ex);
         Log(Level.Error, $"Failed to get device name from device #{deviceID}");
     }
     return(device.Name);
 }