qcom: add disassembler with DEBUG >= 5

This commit is contained in:
Comma Device 2024-09-20 07:04:28 +00:00
parent 036c2f5b26
commit 76aa6416d7
1 changed files with 2 additions and 1 deletions

View File

@ -6,7 +6,7 @@ from tinygrad.device import BufferOptions, HCQBuffer, HWComputeQueue, HCQProgram
from tinygrad.runtime.autogen import kgsl, adreno, libc
from tinygrad.runtime.ops_gpu import CLCompiler, CLDevice
from tinygrad.renderer.cstyle import QCOMRenderer
from tinygrad.helpers import getenv, from_mv, mv_address, to_mv, round_up, data64_le, prod
from tinygrad.helpers import getenv, from_mv, mv_address, to_mv, round_up, data64_le, prod, DEBUG, fromimport
if getenv("IOCTL"): import extra.qcom_gpu_driver.opencl_ioctl # noqa: F401 # pylint: disable=unused-import
def _qreg_exec(reg, __val=0, **kwargs):
@ -219,6 +219,7 @@ class QCOMArgsState(HCQArgsState):
class QCOMProgram(HCQProgram):
def __init__(self, device: QCOMDevice, name: str, lib: bytes):
self.device, self.name, self.lib = device, name, lib
if DEBUG >= 5: fromimport('extra.disassemblers.adreno', 'disasm')(lib)
self._parse_lib()
self.lib_gpu = self.device.allocator.alloc(self.image_size, options=BufferOptions(cpu_access=True, nolru=True))