mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
gate the mockdsp behind MOCKDSP=1 [pr] (#10486)
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -544,6 +544,8 @@ jobs:
|
|||||||
tags: qemu-hexagon:latest
|
tags: qemu-hexagon:latest
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=min
|
cache-to: type=gha,mode=min
|
||||||
|
- name: Set MOCKDSP env
|
||||||
|
run: printf "MOCKDSP=1" >> $GITHUB_ENV
|
||||||
- name: Run test_tiny on DSP
|
- name: Run test_tiny on DSP
|
||||||
run: DEBUG=2 DSP=1 python test/test_tiny.py
|
run: DEBUG=2 DSP=1 python test/test_tiny.py
|
||||||
- name: Test transcendentals
|
- name: Test transcendentals
|
||||||
|
|||||||
@@ -130,7 +130,9 @@ class ClangCompiler(Compiler):
|
|||||||
class DSPDevice(Compiled):
|
class DSPDevice(Compiled):
|
||||||
def __init__(self, device:str=""):
|
def __init__(self, device:str=""):
|
||||||
compiler_args = ["--target=hexagon", "-mcpu=hexagonv65", "-fuse-ld=lld", "-nostdlib", "-mhvx=v65", "-mhvx-length=128b"]
|
compiler_args = ["--target=hexagon", "-mcpu=hexagonv65", "-fuse-ld=lld", "-nostdlib", "-mhvx=v65", "-mhvx-length=128b"]
|
||||||
try:
|
if getenv("MOCKDSP"):
|
||||||
|
super().__init__(device, MallocAllocator, MockDSPRenderer(), ClangCompiler(None, ["-static"] + compiler_args, 'llvm-objdump'), MockDSPProgram)
|
||||||
|
else:
|
||||||
self.ion_fd = os.open('/dev/ion', os.O_RDONLY)
|
self.ion_fd = os.open('/dev/ion', os.O_RDONLY)
|
||||||
# Generate link script to pass into clang. Aligning all used sections to 4k fixes invoke problem.
|
# Generate link script to pass into clang. Aligning all used sections to 4k fixes invoke problem.
|
||||||
sections = ['text', 'rela.plt', 'rela.dyn', 'plt', 'data', 'bss', 'hash', 'dynamic',
|
sections = ['text', 'rela.plt', 'rela.dyn', 'plt', 'data', 'bss', 'hash', 'dynamic',
|
||||||
@@ -150,8 +152,6 @@ class DSPDevice(Compiled):
|
|||||||
|
|
||||||
self.init_dsp()
|
self.init_dsp()
|
||||||
RPCListener(self).start()
|
RPCListener(self).start()
|
||||||
except FileNotFoundError:
|
|
||||||
super().__init__(device, MallocAllocator, MockDSPRenderer(), ClangCompiler(None, ["-static"] + compiler_args, 'llvm-objdump'), MockDSPProgram)
|
|
||||||
|
|
||||||
def open_lib(self, lib):
|
def open_lib(self, lib):
|
||||||
self.binded_lib, self.binded_lib_off = lib, 0
|
self.binded_lib, self.binded_lib_off = lib, 0
|
||||||
|
|||||||
Reference in New Issue
Block a user