Fix the types, add some profiling examples (#15)

Reviewed-on: Rubydragon/MetagraphOptimization.jl#15
Co-authored-by: Anton Reinhard <anton.reinhard@proton.me>
Co-committed-by: Anton Reinhard <anton.reinhard@proton.me>
This commit is contained in:
2023-11-13 12:55:02 +01:00
committed by Anton Reinhard
parent 5a30f57e1f
commit 2709eeb3dc
6 changed files with 497 additions and 457 deletions

View File

@@ -79,7 +79,7 @@ function gen_input_assignment_code(
# TODO: how to get the "default" cpu device?
device = entry_device(machine)
evalExpr = eval(gen_access_expr(device, symbol))
push!(assignInputs, Meta.parse("$(evalExpr) = ParticleValue($p, 1.0)"))
push!(assignInputs, Meta.parse("$(evalExpr)::ParticleValue{$type} = ParticleValue($p, 1.0)"))
end
end
@@ -102,6 +102,7 @@ function get_compute_function(graph::DAG, process::AbstractProcessDescription, m
expr = Meta.parse(
"function compute_$(functionId)(input::AbstractProcessInput) $initCaches; $assignInputs; $code; return $resSym; end",
)
func = eval(expr)
return func