Create a Null backend.

This will be useful to run validation unittests without using the GPU.
This commit is contained in:
Corentin Wallez
2017-05-24 16:04:55 +02:00
committed by Corentin Wallez
parent 68df8b0a3a
commit 79a62bf6e3
6 changed files with 317 additions and 4 deletions

View File

@@ -340,7 +340,7 @@ def debug(text):
print(text)
def main():
targets = ['nxt', 'nxtcpp', 'mock_nxt', 'opengl', 'metal', 'wire', 'blink']
targets = ['nxt', 'nxtcpp', 'mock_nxt', 'opengl', 'metal', 'null', 'wire', 'blink']
parser = argparse.ArgumentParser(
description = 'Generates code for various target for NXT.',
@@ -424,6 +424,12 @@ def main():
}
renders.append(FileRender('BackendProcTable.cpp', 'metal/ProcTable.mm', base_backend_params + [metal_params]))
if 'null' in targets:
null_params = {
'namespace': 'null',
}
renders.append(FileRender('BackendProcTable.cpp', 'null/ProcTable.mm', base_backend_params + [null_params]))
if 'wire' in targets:
renders.append(FileRender('wire/WireCmd.h', 'wire/WireCmd_autogen.h', base_backend_params))
renders.append(FileRender('wire/WireCmd.cpp', 'wire/WireCmd.cpp', base_backend_params))