mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
* move gpuctypes in tree * fix mypy * regex exclude * autogen sh * mypy exclude * does that fix it * fix mypy * add hip confirm * verify all autogens * build clang2py * opencl headers * gpu on 22.04
12 lines
422 B
Python
12 lines
422 B
Python
import ctypes
|
|
import tinygrad.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)) |