Skip to content
Snippets Groups Projects

Dataclasses for method creation

Merged Markus Holzer requested to merge FixPystencilUpdate into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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
  • yes we made a change in pystencils to seperate target and backend. The only targets pystencils supports so far are CPU and GPU. For these targets different backends like CUDA, OpenCL are available

  • That's not true, Opencl is a backend AND a target. Its a backend, because we need to generate OpenCL code. It is a target, because we need pyopencl if we want to jit it back to python!

  • Please register or sign in to reply
  • Stephan Seitz resolved all threads

    resolved all threads

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    • 5ff4bfa9 - Implemted stencil class correctly

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading