mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
eefc084302
version: sunnypilot v2025.003.000 (dev) date: 2025-12-18T05:48:43 master commit: 16c052af0835f049a67b80251d8cc1114fc08bb4
12 lines
430 B
Python
12 lines
430 B
Python
import ctypes
|
|
import tinygrad.runtime.autogen.hip as hip
|
|
from tinygrad.runtime.ops_hip import check
|
|
from tinygrad.helpers import init_c_var
|
|
|
|
if __name__ == "__main__":
|
|
check(hip.hipSetDevice(0))
|
|
evt = init_c_var(hip.hipEvent_t(), lambda x: check(hip.hipEventCreate(ctypes.byref(x))))
|
|
check(hip.hipSetDevice(1))
|
|
check(hip.hipStreamWaitEvent(None, evt, 0))
|
|
check(hip.hipSetDevice(0))
|
|
check(hip.hipEventRecord(evt, None)) |