Beispiel #1
0
 /// <summary>
 /// Check if a backend is of a given type.
 /// For example: IsType(Type.CSharpRef, Device.GPU) == true
 /// </summary>
 public static bool IsType(Type type, Device device)
 {
     type = BarracudaBackendsFactory.ResolveAutoType(type);
     if (type == Type.Auto)
     {
         throw new ArgumentException($"Auto type is ambiguous in this context and not supported");
     }
     return(((int)type & (int)device) == (int)device);
 }
Beispiel #2
0
 /// <summary>
 /// Check if a backend is of a given type.
 /// For example: IsType(Type.CSharpRef, Device.GPU) == true
 /// </summary>
 public static bool IsType(Type type, Device device)
 {
     type = BarracudaBackendsFactory.ResolveAutoType(type);
     Assert.AreNotEqual(type, Type.Auto);
     return(((int)type & (int)device) == (int)device);
 }