Skip to content

Commit

Permalink
Adapt to minver in ObjectiveC.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Jan 4, 2025
1 parent cf21f9d commit 970f7e9
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions lib/mps/ndarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,18 @@ export MPSNDArray

@objcwrapper immutable=false MPSNDArray <: NSObject

@static if Metal.macos_version() >= v"15"
@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
@autoproperty descriptor::id{MPSNDArrayDescriptor}
@autoproperty resourceSize::NSUInteger
@autoproperty userBuffer::id{MTLBuffer}
end
else
@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}
end
@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
@autoproperty descriptor::id{MPSNDArrayDescriptor} minver="15"
@autoproperty resourceSize::NSUInteger minver="15"
@autoproperty userBuffer::id{MTLBuffer} minver="15"
end

function Base.size(ndarr::MPSNDArray)
Expand Down

0 comments on commit 970f7e9

Please sign in to comment.