Skip to content

Commit

Permalink
Availability
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Jan 28, 2025
1 parent 3de4ea0 commit 4d18faa
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 262 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ KernelAbstractions = "0.9.1"
LLVM = "7.2, 8, 9"
LLVMDowngrader_jll = "0.6"
LinearAlgebra = "1"
ObjectiveC = "3.3"
ObjectiveC = "3.4"
PrecompileTools = "1"
Preferences = "1"
Printf = "1"
Expand Down
57 changes: 21 additions & 36 deletions lib/mps/libmps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,7 @@ end
@objcproperties MPSNDArrayDescriptor begin
@autoproperty dataType::MPSDataType setter = setDataType
@autoproperty numberOfDimensions::UInt64 setter = setNumberOfDimensions
@static if Metal.is_macos(v"15.0.0")
@autoproperty preferPackedRows::Bool setter = setPreferPackedRows
end
@autoproperty preferPackedRows::Bool setter = setPreferPackedRows availability = v"15.0.0"
end

@objcwrapper immutable = true MPSNDArrayAllocator <: NSObject
Expand Down Expand Up @@ -2541,56 +2539,43 @@ end

@objcwrapper immutable = true MPSNDArrayGatherGradient <: MPSNDArrayBinaryPrimaryGradientKernel

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayIdentity <: MPSNDArrayUnaryKernel
end
@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayIdentity <: MPSNDArrayUnaryKernel

@cenum MPSNDArrayQuantizationScheme::UInt64 begin
MPSNDArrayQuantizationTypeNone = 0x0000000000000000
MPSNDArrayQuantizationTypeAffine = 0x0000000000000001
MPSNDArrayQuantizationTypeLUT = 0x0000000000000002
end

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayQuantizationDescriptor <: NSObject
@objcproperties MPSNDArrayQuantizationDescriptor begin
@autoproperty quantizationDataType::MPSDataType
@autoproperty quantizationScheme::MPSNDArrayQuantizationScheme
end
end
@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayQuantizationDescriptor <: NSObject

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayAffineQuantizationDescriptor <: MPSNDArrayQuantizationDescriptor
@objcproperties MPSNDArrayAffineQuantizationDescriptor begin
@autoproperty hasZeroPoint::Bool setter = setHasZeroPoint
@autoproperty hasMinValue::Bool setter = setHasMinValue
@autoproperty implicitZeroPoint::Bool setter = setImplicitZeroPoint
end
@objcproperties MPSNDArrayQuantizationDescriptor begin
@autoproperty quantizationDataType::MPSDataType
@autoproperty quantizationScheme::MPSNDArrayQuantizationScheme
end

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayLUTQuantizationDescriptor <: MPSNDArrayQuantizationDescriptor
end
@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayAffineQuantizationDescriptor <: MPSNDArrayQuantizationDescriptor

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayQuantizedMatrixMultiplication <: MPSNDArrayMatrixMultiplication
@objcproperties MPSNDArrayAffineQuantizationDescriptor begin
@autoproperty hasZeroPoint::Bool setter = setHasZeroPoint
@autoproperty hasMinValue::Bool setter = setHasMinValue
@autoproperty implicitZeroPoint::Bool setter = setImplicitZeroPoint
end

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayLUTDequantize <: MPSNDArrayMultiaryKernel
end
@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayLUTQuantizationDescriptor <: MPSNDArrayQuantizationDescriptor

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayVectorLUTDequantize <: MPSNDArrayMultiaryKernel
@objcproperties MPSNDArrayVectorLUTDequantize begin
@autoproperty vectorAxis::UInt64 setter = setVectorAxis
end
end
@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayQuantizedMatrixMultiplication <: MPSNDArrayMatrixMultiplication

@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayLUTDequantize <: MPSNDArrayMultiaryKernel

@static if Metal.is_macos(v"15.0.0")
@objcwrapper immutable = true MPSNDArrayAffineInt4Dequantize <: MPSNDArrayMultiaryKernel
@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayVectorLUTDequantize <: MPSNDArrayMultiaryKernel

@objcproperties MPSNDArrayVectorLUTDequantize begin
@autoproperty vectorAxis::UInt64 setter = setVectorAxis
end

@objcwrapper immutable = true availability = v"15.0.0" MPSNDArrayAffineInt4Dequantize <: MPSNDArrayMultiaryKernel

struct _MPSPackedFloat3
data::NTuple{12, UInt8}
end
Expand Down
Loading

0 comments on commit 4d18faa

Please sign in to comment.