@@ -49,7 +49,7 @@ func StateBatchResourceSize(batch *foundation.Array) uint {
4949func HintTemporaryMemoryHighWaterMark (cmdBuf metal.CommandBufferWrapper , bytes uint ) {
5050 C .HintTemporaryMemoryHighWaterMark (
5151 // *typing.ProtocolType
52- cmdBuf ,
52+ unsafe . Pointer ( & cmdBuf ) ,
5353 // *typing.PrimitiveType
5454 C .uint (bytes ),
5555 )
@@ -73,7 +73,7 @@ func ImageBatchResourceSize(batch *foundation.Array) uint {
7373func SetHeapCacheDuration (cmdBuf metal.CommandBufferWrapper , seconds float64 ) {
7474 C .SetHeapCacheDuration (
7575 // *typing.ProtocolType
76- cmdBuf ,
76+ unsafe . Pointer ( & cmdBuf ) ,
7777 // *typing.PrimitiveType
7878 C .double (seconds ),
7979 )
@@ -101,7 +101,7 @@ func StateBatchSynchronize(batch *foundation.Array, cmdBuf metal.CommandBufferWr
101101 // *typing.PointerType
102102 (* C .MPSStateBatch )(unsafe .Pointer (& batch )),
103103 // *typing.ProtocolType
104- cmdBuf ,
104+ unsafe . Pointer ( & cmdBuf ) ,
105105 )
106106}
107107
@@ -180,10 +180,10 @@ func GetCustomKernelBroadcastSourceIndex(c CustomKernelArgumentCount, sourceInde
180180func GetImageType (image Image ) ImageType {
181181 rv := C .GetImageType (
182182 // *typing.ClassType
183- image ,
183+ unsafe . Pointer ( & image ) ,
184184 )
185185 // *typing.AliasType
186- return ImageType ( rv )
186+ return * ( * ImageType )( unsafe . Pointer ( & rv ) )
187187}
188188
189189// Returns the integer division parameters for a specified divisor. [Full Topic]
@@ -222,7 +222,7 @@ func ImageBatchSynchronize(batch *foundation.Array, cmdBuf metal.CommandBufferWr
222222 // *typing.PointerType
223223 (* C .MPSImageBatch )(unsafe .Pointer (& batch )),
224224 // *typing.ProtocolType
225- cmdBuf ,
225+ unsafe . Pointer ( & cmdBuf ) ,
226226 )
227227}
228228
@@ -232,7 +232,7 @@ func ImageBatchSynchronize(batch *foundation.Array, cmdBuf metal.CommandBufferWr
232232func SupportsMTLDevice (device metal.DeviceWrapper ) bool {
233233 rv := C .SupportsMTLDevice (
234234 // *typing.ProtocolType
235- device ,
235+ unsafe . Pointer ( & device ) ,
236236 )
237237 // *typing.PrimitiveType
238238 return bool (rv )
0 commit comments