Skip to content

Commit

Permalink
Address reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Aug 4, 2021
1 parent 0806353 commit 6b5e6ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/MLCompute/MLHelpers.cs
Expand Up @@ -240,9 +240,10 @@ public static string GetDebugDescription (this MLCComparisonOperation self)
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[NoWatch]
[TV (15,0), Mac (12,0), iOS (15,0)]
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#endif
public static class MLCGradientClippingTypeExtensions {

Expand Down
15 changes: 9 additions & 6 deletions src/mlcompute.cs
Expand Up @@ -110,6 +110,7 @@ enum MLCDeviceType /* int32_t */ {
Cpu = 0,
Gpu = 1,
Any = 2,
[iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)]
Ane = 3, // Apple neural engine
// Count, // must be last, not available in swift
}
Expand All @@ -123,6 +124,7 @@ enum MLCExecutionOptions : ulong {
Synchronous = 0x2,
Profiling = 0x4,
ForwardForInference = 0x8,
[iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)]
PerLayerProfiling = 0x10,
}

Expand Down Expand Up @@ -237,7 +239,7 @@ enum MLCSoftmaxOperation {
LogSoftmax = 1,
}

[iOS (15,0), TV (15,0), Mac (12,0), NoWatch]
[iOS (15,0), TV (15,0), Mac (12,0), NoWatch, MacCatalyst (15,0)]
public enum MLCGradientClippingType {
Value = 0,
Norm = 1,
Expand Down Expand Up @@ -596,7 +598,7 @@ interface MLCDevice : NSCopying {
[return: NullAllowed]
MLCDevice GetDevice (IMTLDevice[] gpus);

[TV (15,0), Mac (12,0), iOS (15,0)]
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Static]
[Export ("aneDevice")]
[return: NullAllowed]
Expand Down Expand Up @@ -765,7 +767,7 @@ interface MLCTensor : NSCopying {
[Static]
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("tensorWithShape:randomInitializerType:dataType:")]
MLCTensor Create (NSNumber[] shape, MLCRandomInitializerType randomInitializerType, MLCDataType dataType);
MLCTensor Create ([BindAs (typeof (nint[]))] NSNumber[] shape, MLCRandomInitializerType randomInitializerType, MLCDataType dataType);
}

[iOS (14,0)][TV (14,0)][Mac (11,0)]
Expand Down Expand Up @@ -2378,19 +2380,20 @@ interface MLCSelectionLayer {

[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface MLCPlatform {

[Static]
[Export ("setRNGSeedTo:")]
void SetRngSeedTo ([BindAs (typeof (nuint))] NSNumber seed);
void SetRngSeed ([BindAs (typeof (nuint))] NSNumber seed);

[return: BindAs (typeof (nuint)), NullAllowed]
[Static]
[Export ("getRNGseed")]
NSNumber GetRngSeed ();
}

[TV (15,0), Mac (12,0), iOS (15,0)]
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (MLCOptimizer))]
[DisableDefaultCtor]
interface MLCAdamWOptimizer : NSCopying
Expand All @@ -2416,7 +2419,7 @@ interface MLCAdamWOptimizer : NSCopying

[Static]
[Export ("optimizerWithDescriptor:beta1:beta2:epsilon:usesAMSGrad:timeStep:")]
MLCAdamWOptimizer GetOptimizer (MLCOptimizerDescriptor optimizerDescriptor, float beta1, float beta2, float epsilon, bool usesAMSGrad, nuint timeStep);
MLCAdamWOptimizer GetOptimizer (MLCOptimizerDescriptor optimizerDescriptor, float beta1, float beta2, float epsilon, bool usesAmsGrad, nuint timeStep);
}

}
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/common-MLCompute.ignore
Expand Up @@ -2,8 +2,6 @@
!missing-enum-value! MLCActivationType native value MLCActivationTypeCount = 21 not bound
!missing-enum-value! MLCArithmeticOperation native value MLCArithmeticOperationCount = 30 not bound
!missing-enum-value! MLCComparisonOperation native value MLCComparisonOperationCount = 12 not bound
## missing-enum-value! MLCDataType native value MLCDataTypeCount = 8 not bound
## missing-enum-value! MLCDeviceType native value MLCDeviceTypeCount = 3 not bound
!missing-enum-value! MLCLossType native value MLCLossTypeCount = 9 not bound
!missing-enum-value! MLCPoolingType native value MLCPoolingTypeCount = 4 not bound
!missing-enum-value! MLCRandomInitializerType native value MLCRandomInitializerTypeCount = 4 not bound
Expand Down

0 comments on commit 6b5e6ae

Please sign in to comment.