Skip to content

Allows codegen of generic kernal ast

Can create a kernel outside the context then generate, i.e.:

cfg = CreateKernelConfig(cpu_prepend_optimizations=[remove_empty_loops])
kernel = create_kernel(asms, config=cfg)
kernel.function_name = 'getVelocityDensity'

sfg_config = SfgConfiguration()
with SourceFileGenerator(sfg_config) as ctx:
    sfg = SfgComposer(ctx)
    VelocityDensityKernel = sfg.kernels.create_from_kernel(kernel)
    sfg.function("getVelocityDensity")(
        sfg.call(VelocityDensityKernel)
    )

Merge request reports