Dataclasses for method creation
In lbmpy large dicts are created to manage all parameters for the lb method and the pystencils kernel parameters. This MR introduces dataclasses to manage all these parameters. Furthermore, a better integration with pystencils is achieved since pystencils introduced dataclasses lately.
Fixes #1 (closed)
Edited by Jan Hönig
Merge request reports
Activity
Filter activity
116 117 117 118 eqs = cqc.output_equations_from_pdfs(pdf_symbols, output_mapping).all_assignments 118 119 119 if target == 'cpu': 120 if target == Target.CPU: 120 121 import pystencils.cpu as cpu 121 122 kernel = cpu.make_python_function(cpu.create_kernel( 122 123 eqs, ghost_layers=ghost_layers, iteration_slice=iteration_slice)) 123 elif target == 'gpu': 124 elif target == Target.GPU: 124 125 import pystencils.gpucuda as gpu 125 126 kernel = gpu.make_python_function(gpu.create_cuda_kernel( 126 127 eqs, ghost_layers=ghost_layers, iteration_slice=iteration_slice)) 127 128 else: 128 raise ValueError("Unknown target '%s'. Possible targets are 'cpu' and 'gpu'" % (target,)) 129 raise ValueError("Unknown target '%s'. Possible targets are `Target.CPU` and `Target.GPU`" % (target,)) raise ValueError(f"Unknown target '{target}'. Possible targets are {Target._member_names_}")
I see only CPU/GPU are supported. Sorry
Edited by Stephan Seitz