Skip to content

Commit b7ec84f

Browse files
authored
Merge branch 'JuliaGPU:main' into main
2 parents a047a11 + 1b811cb commit b7ec84f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4226
-720
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ KernelAbstractions = "0.9.1"
4242
LLVM = "7.2, 8, 9"
4343
LLVMDowngrader_jll = "0.6"
4444
LinearAlgebra = "1"
45-
ObjectiveC = "3.2"
45+
ObjectiveC = "3.3"
4646
PrecompileTools = "1"
4747
Preferences = "1"
4848
Printf = "1"

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@ importing the package:
6767
julia> using Metal
6868
6969
julia> Metal.versioninfo()
70-
macOS 15.0.0, Darwin 24.0.0
70+
macOS 15.3.0, Darwin 24.3.0
7171
7272
Toolchain:
73-
- Julia: 1.11.0
73+
- Julia: 1.11.3
7474
- LLVM: 16.0.6
7575
7676
Julia packages:
77-
- Metal.jl: 1.4.0
78-
- GPUArrays: 10.3.1
79-
- GPUCompiler: 0.27.8
80-
- KernelAbstractions: 0.9.27
81-
- ObjectiveC: 3.1.0
82-
- LLVM: 9.1.2
83-
- LLVMDowngrader_jll: 0.3.0+1
77+
- Metal.jl: 1.5.1
78+
- GPUArrays: 11.2.1
79+
- GPUCompiler: 1.1.0
80+
- KernelAbstractions: 0.9.33
81+
- ObjectiveC: 3.3.0
82+
- LLVM: 9.2.0
83+
- LLVMDowngrader_jll: 0.6.0+0
8484
8585
1 device:
8686
- Apple M2 Max (64.000 KiB allocated)

docs/src/faq/contributing.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ skip the first two steps.
3838
2. Create high-level Julia structures and functionality
3939
3. Create tests for added functionality
4040

41-
`struct`s and `enums` for Objective-C interfaces are automatically generated (see res/wrap/),
41+
Objective-C object definitions, `struct`s, and `enums` for Objective-C interfaces are automatically generated (see res/wrap/),
4242
so you should not have to define them. If using a struct for the first time in a higher-level
43-
interface, remember to add tests! You may need to define more functions around the structs.
43+
interface, remember to add tests! Objective-C object methods and constructors are not yet automtically
44+
generatied, so any contributions there are welcome.
4445

4546
## Mapping to Metal Intrinsics
4647

lib/mps/command_buf.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@
44
# - intermediate commits during encoding of MPS work using `commitAndContinue`
55
#
66

7-
# XXX: Not actually inheritance but MPSCommandBuffer conforms to MTLCommandBuffer protocol
8-
@objcwrapper MPSCommandBuffer <: MTLCommandBuffer
9-
10-
@objcproperties MPSCommandBuffer begin
11-
# Identifying the Command Buffer
12-
@autoproperty commandBuffer::id{MTLCommandBuffer}
13-
# @autoproperty heapProvider::id{MPSHeapProvider}
14-
# @autoproperty predicate::id{MPSPredicate}
15-
@autoproperty rootCommandBuffer::id{MTLCommandBuffer}
16-
end
7+
# @objcwrapper MPSCommandBuffer <: MTLCommandBuffer
178

189
function MPSCommandBuffer(commandBuffer::MTLCommandBuffer)
1910
handle = @objc [MPSCommandBuffer commandBufferWithCommandBuffer:commandBuffer::id{MTLCommandBuffer}]::id{MPSCommandBuffer}

lib/mps/copy.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export MPSMatrixCopyDescriptor
44

5-
@objcwrapper MPSMatrixCopyDescriptor <: NSObject
5+
# @objcwrapper MPSMatrixCopyDescriptor <: NSObject
66

77
function MPSMatrixCopyDescriptor(sourceMatrix, destinationMatrix, offsets = MPSMatrixCopyOffsets(Cuint(0), Cuint(0), Cuint(0), Cuint(0)))
88
desc = @objc [MPSMatrixCopyDescriptor descriptorWithSourceMatrix:sourceMatrix::id{MPSMatrix}
@@ -16,14 +16,7 @@ end
1616

1717
export MPSMatrixCopy, encode!
1818

19-
@objcwrapper immutable=false MPSMatrixCopy <: MPSKernel
20-
21-
@objcproperties MPSMatrixCopy begin
22-
@autoproperty copyRows::NSUInteger
23-
@autoproperty copyColumns::NSUInteger
24-
@autoproperty sourcesAreTransposed::Bool
25-
@autoproperty destinationsAreTransposed::Bool
26-
end
19+
# @objcwrapper immutable=false MPSMatrixCopy <: MPSKernel
2720

2821
function MPSMatrixCopy(dev, copyRows, copyColumns, sourcesAreTransposed, destinationsAreTransposed)
2922
kernel = @objc [MPSMatrixCopy alloc]::id{MPSMatrixCopy}

lib/mps/decomposition.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export MPSMatrixDecompositionLU, encode!
44

5-
@objcwrapper immutable=false MPSMatrixDecompositionLU <: MPSMatrixUnaryKernel
5+
# @objcwrapper immutable=false MPSMatrixDecompositionLU <: MPSMatrixUnaryKernel
66

77
function MPSMatrixDecompositionLU(dev, rows, columns)
88
kernel = @objc [MPSMatrixDecompositionLU alloc]::id{MPSMatrixDecompositionLU}
@@ -27,7 +27,7 @@ end
2727

2828
export MPSMatrixDecompositionCholesky, encode!
2929

30-
@objcwrapper immutable=false MPSMatrixDecompositionCholesky <: MPSMatrixUnaryKernel
30+
# @objcwrapper immutable=false MPSMatrixDecompositionCholesky <: MPSMatrixUnaryKernel
3131

3232
function MPSMatrixDecompositionCholesky(dev, lower, order)
3333
kernel = @objc [MPSMatrixDecompositionCholesky alloc]::id{MPSMatrixDecompositionCholesky}

lib/mps/images.jl

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
## kernels
22

3-
@objcwrapper immutable=false MPSUnaryImageKernel <: MPSKernel
4-
5-
@objcproperties MPSUnaryImageKernel begin
6-
@autoproperty offset::MPSOffset
7-
@autoproperty clipRect::MTLRegion
8-
@autoproperty edgeMode::MPSImageEdgeMode setter=setEdgeMode
9-
end
3+
# @objcwrapper immutable=false MPSUnaryImageKernel <: MPSKernel
104

115
function encode!(cmdbuf::MTLCommandBuffer, kernel::K, sourceTexture::MTLTexture, destinationTexture::MTLTexture) where {K<:MPSUnaryImageKernel}
126
@objc [kernel::id{K} encodeToCommandBuffer:cmdbuf::id{MTLCommandBuffer}
@@ -21,22 +15,13 @@ end
2115
# fallbackCopyAllocator:copyAllocator::MPSCopyAllocator]::Bool
2216
# end
2317

24-
@objcwrapper immutable=false MPSBinaryImageKernel <: MPSKernel
25-
26-
@objcproperties MPSBinaryImageKernel begin
27-
@autoproperty primaryOffset::MPSOffset
28-
@autoproperty secondaryOffset::MPSOffset
29-
@autoproperty primaryEdgeMode::MPSImageEdgeMode
30-
@autoproperty secondaryEdgeMode::MPSImageEdgeMode
31-
@autoproperty clipRect::MTLRegion
32-
end
33-
18+
# @objcwrapper immutable=false MPSBinaryImageKernel <: MPSKernel
3419

3520
## gaussian blur
3621

3722
export MPSImageGaussianBlur, encode!
3823

39-
@objcwrapper immutable=false MPSImageGaussianBlur <: MPSUnaryImageKernel
24+
# @objcwrapper immutable=false MPSImageGaussianBlur <: MPSUnaryImageKernel
4025

4126
function MPSImageGaussianBlur(dev, sigma)
4227
kernel = @objc [MPSImageGaussianBlur alloc]::id{MPSImageGaussianBlur}
@@ -52,7 +37,7 @@ end
5237

5338
export MPSImageBox
5439

55-
@objcwrapper immutable=false MPSImageBox <: MPSUnaryImageKernel
40+
# @objcwrapper immutable=false MPSImageBox <: MPSUnaryImageKernel
5641

5742
function MPSImageBox(dev, kernelWidth, kernelHeight)
5843
kernel = @objc [MPSImageBox alloc]::id{MPSImageBox}

lib/mps/kernel.jl

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,13 @@
22
# kernels
33
#
44

5-
@objcwrapper MPSKernel <: NSObject
6-
7-
@objcproperties MPSKernel begin
8-
@autoproperty options::MPSKernelOptions setter=setOptions
9-
@autoproperty device::id{MTLDevice}
10-
@autoproperty label::id{NSString} setter=setLabel
11-
end
5+
# @objcwrapper MPSKernel <: NSObject
126

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

18-
@objcwrapper immutable=false MPSMatrixUnaryKernel <: MPSKernel
19-
20-
@objcproperties MPSMatrixUnaryKernel begin
21-
@autoproperty sourceMatrixOrigin::id{MTLOrigin} setter=setSourceMatrixOrigin
22-
@autoproperty resultMatrixOrigin::id{MTLOrigin} setter=setResultMatrixOrigin
23-
@autoproperty batchStart::NSUInteger setter=setBatchStart
24-
@autoproperty batchSize::NSUInteger setter=setBatchSize
25-
end
12+
# @objcwrapper immutable=false MPSMatrixUnaryKernel <: MPSKernel
2613

27-
28-
@objcwrapper immutable=false MPSMatrixBinaryKernel <: MPSKernel
29-
30-
@objcproperties MPSMatrixBinaryKernel begin
31-
@autoproperty primarySourceMatrixOrigin::id{MTLOrigin} setter=setPrimarySourceMatrixOrigin
32-
@autoproperty secondarySourceMatrixOrigin::id{MTLOrigin} setter=setSecondarySourceMatrixOrigin
33-
@autoproperty resultMatrixOrigin::id{MTLOrigin} setter=setResultMatrixOrigin
34-
@autoproperty batchStart::NSUInteger setter=setBatchStart
35-
@autoproperty batchSize::NSUInteger setter=setBatchSize
36-
end
14+
# @objcwrapper immutable=false MPSMatrixBinaryKernel <: MPSKernel

0 commit comments

Comments
 (0)