mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-08-29 11:16:07 +00:00
am: raise when using more sdma engines (#15569)
This commit is contained in:
@@ -524,6 +524,8 @@ class AM_SDMA(AM_IP):
|
||||
self.adev.regGRBM_SOFT_RESET.write(0x0)
|
||||
|
||||
def setup_ring(self, ring_addr:int, ring_size:int, rptr_addr:int, wptr_addr:int, idx:int) -> int:
|
||||
if self.adev.ip_ver[am.SDMA0_HWIP] >= (5,0,0) and idx > 0: raise RuntimeError(f"am {self.adev.devfmt}: sdma queue {idx} is not available")
|
||||
|
||||
pipe, queue = idx // 4, idx % 4
|
||||
reg, inst = ("regSDMA_GFX", pipe+queue*4) if self.adev.ip_ver[am.SDMA0_HWIP][:2] == (4,4) else (f"regSDMA{pipe}_QUEUE{queue}", 0)
|
||||
doorbell = am.AMDGPU_NAVI10_DOORBELL_sDMA_ENGINE0 + (pipe+queue*4) * 0xA
|
||||
|
||||
Reference in New Issue
Block a user