Changed backend-priority to be changeable

This commit is contained in:
DarthAffe committed 2024-08-28 20:02:29 +02:00
1 parent 7fbbb70f90
commit bb71986ce7
5 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ public class CpuBackend : IBackend
public bool IsEnabled { get; set; } = true;
public int Priority => 0;
public int Priority { get; set; } = 0;
public bool IsAvailable => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|| RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
+1 -1
View File
@@ -22,7 +22,7 @@ public partial class CudaBackend : IBackend
public bool IsEnabled { get; set; } = true;
public int Priority => 10;
public int Priority { get; set; } = 10;
public bool IsAvailable => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|| RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+1 -1
View File
@@ -6,7 +6,7 @@ namespace StableDiffusion.NET;
public interface IBackend
{
bool IsEnabled { get; set; }
public int Priority { get; }
public int Priority { get; set; }
bool IsAvailable { get; }
string PathPart { get; }
}
+1 -1
View File
@@ -12,7 +12,7 @@ public partial class RocmBackend : IBackend
public bool IsEnabled { get; set; } = true;
public int Priority => 10;
public int Priority { get; set; } = 10;
public bool IsAvailable => ((RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
&& RocmVersion is 5)
+1 -1
View File
@@ -11,7 +11,7 @@ public class SyclBackend : IBackend
//TODO DarthAffe 10.08.2024: tbh I'm not really sure how to detect a sycl-compatible system so for now it's disabled by default
public bool IsEnabled { get; set; } = false;
public int Priority => 5;
public int Priority { get; set; } = 5;
public bool IsAvailable => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|| RuntimeInformation.IsOSPlatform(OSPlatform.Linux))