Skip to content

Commit

Permalink
Remove old @objcproperties declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Jan 28, 2025
1 parent b459511 commit 2563fba
Show file tree
Hide file tree
Showing 24 changed files with 1 addition and 419 deletions.
8 changes: 0 additions & 8 deletions lib/mps/command_buf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@

# @objcwrapper MPSCommandBuffer <: MTLCommandBuffer

# @objcproperties MPSCommandBuffer begin
# # Identifying the Command Buffer
# @autoproperty commandBuffer::id{MTLCommandBuffer}
# # @autoproperty heapProvider::id{MPSHeapProvider}
# # @autoproperty predicate::id{MPSPredicate}
# @autoproperty rootCommandBuffer::id{MTLCommandBuffer}
# end

function MPSCommandBuffer(commandBuffer::MTLCommandBuffer)
handle = @objc [MPSCommandBuffer commandBufferWithCommandBuffer:commandBuffer::id{MTLCommandBuffer}]::id{MPSCommandBuffer}
MPSCommandBuffer(handle)
Expand Down
7 changes: 0 additions & 7 deletions lib/mps/copy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ export MPSMatrixCopy, encode!

# @objcwrapper immutable=false MPSMatrixCopy <: MPSKernel

# @objcproperties MPSMatrixCopy begin
# @autoproperty copyRows::NSUInteger
# @autoproperty copyColumns::NSUInteger
# @autoproperty sourcesAreTransposed::Bool
# @autoproperty destinationsAreTransposed::Bool
# end

function MPSMatrixCopy(dev, copyRows, copyColumns, sourcesAreTransposed, destinationsAreTransposed)
kernel = @objc [MPSMatrixCopy alloc]::id{MPSMatrixCopy}
obj = MPSMatrixCopy(kernel)
Expand Down
15 changes: 0 additions & 15 deletions lib/mps/images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

# @objcwrapper immutable=false MPSUnaryImageKernel <: MPSKernel

# @objcproperties MPSUnaryImageKernel begin
# @autoproperty offset::MPSOffset
# @autoproperty clipRect::MTLRegion
# @autoproperty edgeMode::MPSImageEdgeMode setter=setEdgeMode
# end

function encode!(cmdbuf::MTLCommandBuffer, kernel::K, sourceTexture::MTLTexture, destinationTexture::MTLTexture) where {K<:MPSUnaryImageKernel}
@objc [kernel::id{K} encodeToCommandBuffer:cmdbuf::id{MTLCommandBuffer}
sourceTexture:sourceTexture::id{MTLTexture}
Expand All @@ -23,15 +17,6 @@ end

# @objcwrapper immutable=false MPSBinaryImageKernel <: MPSKernel

# @objcproperties MPSBinaryImageKernel begin
# @autoproperty primaryOffset::MPSOffset
# @autoproperty secondaryOffset::MPSOffset
# @autoproperty primaryEdgeMode::MPSImageEdgeMode
# @autoproperty secondaryEdgeMode::MPSImageEdgeMode
# @autoproperty clipRect::MTLRegion
# end


## gaussian blur

export MPSImageGaussianBlur, encode!
Expand Down
21 changes: 0 additions & 21 deletions lib/mps/kernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,11 @@

# @objcwrapper MPSKernel <: NSObject

# @objcproperties MPSKernel begin
# @autoproperty options::MPSKernelOptions setter=setOptions
# @autoproperty device::id{MTLDevice}
# @autoproperty label::id{NSString} setter=setLabel
# end

@autoreleasepool function Base.copy(kernel::K) where {K <: MPSKernel}
obj = @objc [kernel::MPSKernel copy]::id{MPSKernel}
K(reinterpret(id{K}, obj))
end

# @objcwrapper immutable=false MPSMatrixUnaryKernel <: MPSKernel

# @objcproperties MPSMatrixUnaryKernel begin
# @autoproperty sourceMatrixOrigin::id{MTLOrigin} setter=setSourceMatrixOrigin
# @autoproperty resultMatrixOrigin::id{MTLOrigin} setter=setResultMatrixOrigin
# @autoproperty batchStart::NSUInteger setter=setBatchStart
# @autoproperty batchSize::NSUInteger setter=setBatchSize
# end

# @objcwrapper immutable=false MPSMatrixBinaryKernel <: MPSKernel

# @objcproperties MPSMatrixBinaryKernel begin
# @autoproperty primarySourceMatrixOrigin::id{MTLOrigin} setter=setPrimarySourceMatrixOrigin
# @autoproperty secondarySourceMatrixOrigin::id{MTLOrigin} setter=setSecondarySourceMatrixOrigin
# @autoproperty resultMatrixOrigin::id{MTLOrigin} setter=setResultMatrixOrigin
# @autoproperty batchStart::NSUInteger setter=setBatchStart
# @autoproperty batchSize::NSUInteger setter=setBatchSize
# end
41 changes: 0 additions & 41 deletions lib/mps/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ export MPSMatrixDescriptor

# @objcwrapper MPSMatrixDescriptor <: NSObject

# @objcproperties MPSMatrixDescriptor begin
# @autoproperty rows::NSUInteger setter=setRows
# @autoproperty columns::NSUInteger setter=setColumns
# @autoproperty matrices::NSUInteger
# @autoproperty dataType::MPSDataType setter=setDataType
# @autoproperty rowBytes::NSUInteger setter=setRowBytes
# @autoproperty matrixBytes::NSUInteger
# end

function MPSMatrixDescriptor(rows, columns, rowBytes, dataType)
desc = @objc [MPSMatrixDescriptor matrixDescriptorWithRows:rows::NSUInteger
columns:columns::NSUInteger
Expand All @@ -59,18 +50,6 @@ export MPSMatrix

# @objcwrapper immutable=false MPSMatrix <: NSObject

# @objcproperties MPSMatrix begin
# @autoproperty device::id{MTLDevice}
# @autoproperty rows::NSUInteger
# @autoproperty columns::NSUInteger
# @autoproperty matrices::NSUInteger
# @autoproperty dataType::MPSDataType
# @autoproperty rowBytes::NSUInteger
# @autoproperty matrixBytes::NSUInteger
# @autoproperty offset::NSUInteger
# @autoproperty data::id{MTLBuffer}
# end

function MPSMatrix(buf, descriptor::MPSMatrixDescriptor, offset::Integer=0)
mat = @objc [MPSMatrix alloc]::id{MPSMatrix}
obj = MPSMatrix(mat)
Expand Down Expand Up @@ -143,14 +122,6 @@ export MPSMatrixMultiplication, encode!, matmul!

# @objcwrapper immutable=false MPSMatrixMultiplication <: MPSKernel

# @objcproperties MPSMatrixMultiplication begin
# @autoproperty leftMatrixOrigin::MTLOrigin setter=setLeftMatrixOrigin
# @autoproperty rightMatrixOrigin::MTLOrigin setter=setRightMatrixOrigin
# @autoproperty resultMatrixOrigin::MTLOrigin setter=setResultMatrixOrigin
# @autoproperty batchSize::NSUInteger setter=setBatchSize
# @autoproperty batchStart::NSUInteger setter=setBatchStart
# end

function MPSMatrixMultiplication(dev, transposeLeft, transposeRight, resultRows,
resultColumns, interiorColumns, alpha, beta)
kernel = @objc [MPSMatrixMultiplication alloc]::id{MPSMatrixMultiplication}
Expand Down Expand Up @@ -218,13 +189,6 @@ export MPSMatrixFindTopK, encode!

# @objcwrapper immutable=false MPSMatrixFindTopK <: MPSMatrixUnaryKernel

# @objcproperties MPSMatrixFindTopK begin
# @autoproperty indexOffset::NSInteger setter=setIndexOffset
# @autoproperty numberOfTopKValues::NSInteger
# @autoproperty sourceColumns::NSInteger setter=setSourceColumns
# @autoproperty sourceRows::NSInteger setter=setSourceRows
# end

function MPSMatrixFindTopK(dev, numberOfTopKValues)
kernel = @objc [MPSMatrixFindTopK alloc]::id{MPSMatrixFindTopK}
obj = MPSMatrixFindTopK(kernel)
Expand Down Expand Up @@ -316,11 +280,6 @@ export MPSMatrixSoftMax, MPSMatrixLogSoftMax, encode!
# @objcwrapper immutable=false MPSMatrixSoftMax <: MPSMatrixUnaryKernel
# @objcwrapper immutable=false MPSMatrixLogSoftMax <: MPSMatrixSoftMax

# @objcproperties MPSMatrixSoftMax begin
# @autoproperty sourceRows::NSInteger setter=setSourceRows
# @autoproperty sourceColumns::NSInteger setter=setSourceColumns
# end

for f in (:MPSMatrixSoftMax, :MPSMatrixLogSoftMax)
@eval begin
function $(f)(dev)
Expand Down
16 changes: 0 additions & 16 deletions lib/mps/matrixrandom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ export MPSMatrixRandomDistributionDescriptor

# @objcwrapper immutable=false MPSMatrixRandomDistributionDescriptor <: NSObject

# @objcproperties MPSMatrixRandomDistributionDescriptor begin
# @autoproperty distributionType::MPSMatrixRandomDistribution
# @autoproperty maximum::Float32 setter=setMaximum
# @autoproperty mean::Float32 setter=setMean
# @autoproperty minimum::Float32 setter=setMinimum
# @autoproperty standardDeviation::Float32 setter=setStandardDeviation
# end


function MPSMatrixRandomDefaultDistributionDescriptor()
desc = @objc [MPSMatrixRandomDistributionDescriptor defaultDistributionDescriptor]::id{MPSMatrixRandomDistributionDescriptor}
obj = MPSMatrixRandomDistributionDescriptor(desc)
Expand Down Expand Up @@ -49,13 +40,6 @@ end

# @objcwrapper immutable=false MPSMatrixRandom <: MPSKernel

# @objcproperties MPSMatrixRandom begin
# @autoproperty batchSize::NSUInteger
# @autoproperty batchStart::NSUInteger
# @autoproperty destinationDataType::id{MPSDataType}
# @autoproperty distributionType::id{MPSMatrixRandomDistributionDescriptor}
# end

function encode!(cmdbuf::MTLCommandBuffer, kernel::K, destinationMatrix::MPSMatrix) where {K<:MPSMatrixRandom}
@objc [kernel::id{K} encodeToCommandBuffer:cmdbuf::id{MTLCommandBuffer}
destinationMatrix:destinationMatrix::id{MPSMatrix}]::Nothing
Expand Down
34 changes: 0 additions & 34 deletions lib/mps/ndarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ export MPSNDArrayDescriptor

# @objcwrapper immutable=false MPSNDArrayDescriptor <: NSObject

# @objcproperties MPSNDArrayDescriptor begin
# @autoproperty dataType::MPSDataType setter=setDataType
# @autoproperty numberOfDimensions::NSUInteger setter=setNumberOfDimensions

# # Both are officially available starting macOS 15, but they work in macOS 13/14
# @autoproperty preferPackedRows::Bool setter=setPreferPackedRows # macOS 15+
# @autoproperty getShape::id{NSArray} # macOS 15+
# end

function MPSNDArrayDescriptor(dataType::DataType, dimensionCount, dimensionSizes::Ptr)
desc = @objc [MPSNDArrayDescriptor descriptorWithDataType:dataType::MPSDataType
dimensionCount:dimensionCount::NSUInteger
Expand Down Expand Up @@ -49,22 +40,6 @@ export MPSNDArray

# @objcwrapper immutable=false MPSNDArray <: NSObject

# @objcproperties MPSNDArray begin
# @autoproperty dataType::MPSDataType
# @autoproperty dataTypeSize::Csize_t
# @autoproperty device::id{MTLDevice}
# @autoproperty label::id{NSString} setter = setLabel
# @autoproperty numberOfDimensions::NSUInteger
# @autoproperty parent::id{MPSNDArray}

# #Instance methods that act like properties
# @static if Metal.is_macos(v"15")
# @autoproperty descriptor::id{MPSNDArrayDescriptor}
# @autoproperty resourceSize::NSUInteger
# @autoproperty userBuffer::id{MTLBuffer}
# end
# end

@static if Metal.is_macos(v"15")
function userBuffer(ndarr::MPSNDArray)::Union{Nothing, MTLBuffer}
res = @objc [ndarr::id{MPSNDArray} userBuffer]::id{MTLBuffer}
Expand All @@ -86,10 +61,6 @@ end

# @objcwrapper immutable=false MPSTemporaryNDArray <: MPSNDArray

# @objcproperties MPSTemporaryNDArray begin
# @autoproperty readCount::NSUInteger setter=setReadCount
# end

function MPSTemporaryNDArray(cmdbuf::MTLCommandBuffer, descriptor::MPSNDArrayDescriptor)
@objc [MPSTemporaryNDArray temporaryNDArrayWithCommandBuffer:cmdbuf::id{MTLCommandBuffer}
descriptor:descriptor::id{MPSNDArrayDescriptor}]::id{MPSTemporaryNDArray}
Expand Down Expand Up @@ -322,11 +293,6 @@ end

# @objcwrapper immutable=false MPSNDArrayMatrixMultiplication <: MPSNDArrayMultiaryKernel

# @objcproperties MPSNDArrayMatrixMultiplication begin
# @autoproperty alpha::Float64 setter=setAlpha
# @autoproperty beta::Float64 setter=setBeta
# end

function MPSNDArrayMatrixMultiplication(device, sourceCount)
kernel = @objc [MPSNDArrayMatrixMultiplication alloc]::id{MPSNDArrayMatrixMultiplication}
obj = MPSNDArrayMatrixMultiplication(kernel)
Expand Down
17 changes: 0 additions & 17 deletions lib/mps/vector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ export MPSVectorDescriptor

# @objcwrapper MPSVectorDescriptor <: NSObject

# @objcproperties MPSVectorDescriptor begin
# @autoproperty length::NSUInteger setter=setLength
# @autoproperty vectors::NSUInteger
# @autoproperty dataType::MPSDataType setter=setDataType
# @autoproperty vectorBytes::NSUInteger
# end


function MPSVectorDescriptor(length::Integer, dataType::Union{DataType,MPSDataType})
desc = @objc [MPSVectorDescriptor vectorDescriptorWithLength:length::NSUInteger
Expand All @@ -34,16 +27,6 @@ export MPSVector

# @objcwrapper immutable=false MPSVector <: NSObject

# @objcproperties MPSVector begin
# @autoproperty device::id{MTLDevice}
# @autoproperty length::NSUInteger
# @autoproperty vectors::NSUInteger
# @autoproperty dataType::MPSDataType
# @autoproperty vectorBytes::NSUInteger
# @autoproperty offset::NSUInteger
# @autoproperty data::id{MTLBuffer}
# end

function MPSVector(buf, descriptor::MPSVectorDescriptor, offset::Integer=0)
vec = @objc [MPSVector alloc]::id{MPSVector}
obj = MPSVector(vec)
Expand Down
11 changes: 0 additions & 11 deletions lib/mtl/binary_archive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ export MTLBinaryArchiveDescriptor

# @objcwrapper immutable=false MTLBinaryArchiveDescriptor <: NSObject

# @objcproperties MTLBinaryArchiveDescriptor begin
# # Choosing an Archive File
# @autoproperty url::id{NSURL} setter=setUrl
# end

function MTLBinaryArchiveDescriptor()
handle = @objc [MTLBinaryArchiveDescriptor new]::id{MTLBinaryArchiveDescriptor}
obj = MTLBinaryArchiveDescriptor(handle)
Expand All @@ -27,12 +22,6 @@ export MTLBinaryArchive, add_functions!

# @objcwrapper immutable=false MTLBinaryArchive <: NSObject

# @objcproperties MTLBinaryArchive begin
# # Identifying the Archive
# @autoproperty label::id{NSString} setter=setLabel
# @autoproperty device::id{MTLDevice}
# end

function MTLBinaryArchive(dev::MTLDevice, desc::MTLBinaryArchiveDescriptor)
err = Ref{id{NSError}}(nil)
handle = @objc [dev::id{MTLDevice} newBinaryArchiveWithDescriptor:desc::id{MTLBinaryArchiveDescriptor}
Expand Down
8 changes: 0 additions & 8 deletions lib/mtl/buffer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ export MTLBuffer, contents

# @objcwrapper MTLBuffer <: MTLResource

# @objcproperties MTLBuffer begin
# @autoproperty length::NSUInteger # In bytes
# @autoproperty device::id{MTLDevice}
# @autoproperty contents::Ptr{Cvoid}
# @autoproperty remoteStorageBuffer::id{MTLBuffer}
# @autoproperty gpuAddress::UInt64 type=Ptr{Cvoid}
# end

Base.sizeof(buf::MTLBuffer) = Int(buf.length)

contents(buf::MTLBuffer) = @objc [buf::id{MTLBuffer} contents]::Ptr{Cvoid}
Expand Down
22 changes: 0 additions & 22 deletions lib/mtl/capture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ MTLCaptureScope

# @objcwrapper MTLCaptureScope <: NSObject

# @objcproperties MTLCaptureScope begin
# # Identifying the Capture Scope
# @autoproperty label::id{NSString} setter=setLabel
# @autoproperty device::id{MTLDevice}
# @autoproperty commandQueue::id{MTLCommandQueue}
# end

"""
beginScope(scope::MTLCaptureScope)
Expand Down Expand Up @@ -58,13 +51,6 @@ MTLCaptureDescriptor

# @objcwrapper immutable=false MTLCaptureDescriptor <: NSObject

# @objcproperties MTLCaptureDescriptor begin
# # Identifying the Capture Scope
# @autoproperty captureObject::id{NSObject} setter=setCaptureObject
# @autoproperty destination::MTLCaptureDestination setter=setDestination
# @autoproperty outputURL::id{NSURL} setter=setOutputURL
# end

function MTLCaptureDescriptor()
handle = @objc [MTLCaptureDescriptor new]::id{MTLCaptureDescriptor}
obj = MTLCaptureDescriptor(handle)
Expand Down Expand Up @@ -103,14 +89,6 @@ MTLCaptureManager

# @objcwrapper MTLCaptureManager <: NSObject

# @objcproperties MTLCaptureManager begin
# # Creating a Capture Scope
# @autoproperty defaultCaptureScope::id{MTLCaptureScope} setter=setDefaultCaptureScope

# # Monitoring Capture
# @autoproperty isCapturing::Bool
# end

"""
MTLCaptureManager()
Expand Down
Loading

0 comments on commit 2563fba

Please sign in to comment.