Skip to content

Commit 39c8509

Browse files
committed
mps: Add additional structs
1 parent 013a9f2 commit 39c8509

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

macos/mps/mps_structs.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,17 @@ type ImageCoordinate struct{}
3232
// https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayoffsets?language=objc
3333
type NDArrayOffsets struct{}
3434

35-
// https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereadwriteparams?language=objc
36-
type ImageReadWriteParams struct{}
35+
// https://developer.apple.com/documentation/metalperformanceshaders/mpscustomkernelargumentcount?language=objc
36+
type CustomKernelArgumentCount struct {
37+
broadcastTextureCount uint64
38+
destinationTextureCount uint64
39+
sourceTextureCount uint64
40+
}
41+
42+
// https://developer.apple.com/documentation/metalperformanceshaders/mpsintegerdivisionparams?language=objc
43+
type IntegerDivisionParams struct {
44+
addend uint16
45+
divisor uint16
46+
recip uint16
47+
shift uint16
48+
}

macos/mps/mps_test.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
package mps
22

3-
import "testing"
3+
import (
4+
"fmt"
5+
"testing"
6+
7+
"github.com/progrium/macdriver/macos/metal"
8+
)
49

510
func TestMPSValid(t *testing.T) {}
11+
12+
func TestX(t *testing.T) {
13+
d := metal.CreateSystemDefaultDevice()
14+
cq := d.NewCommandQueue()
15+
cb := cq.CommandBuffer()
16+
17+
mm := NewMatrixMultiplication()
18+
m1 := NewMatrix()
19+
m2 := NewMatrix()
20+
m3 := NewMatrix()
21+
22+
mm.EncodeToCommandBufferLeftMatrixRightMatrixResultMatrix(cb, m1, m2, m3)
23+
24+
//ce.SetComputePipelineState(
25+
fmt.Println(cb.Status())
26+
cb.Commit()
27+
fmt.Println(cb.Status())
28+
fmt.Println(cb.Status())
29+
fmt.Println(cb.Status())
30+
fmt.Println(cb.Status())
31+
}

0 commit comments

Comments
 (0)