-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Currently, calling the same function multiple times will generate the IR multiple times due to the tracing.
One idea to circumvent this problem is to update the @trace macro to introduce a MLIR function call as the result op instead of tracing through the function. The cache for this must be specific:
@trace func_call()func.func @func_call() {
}
func.func @main() {
...
func.call @func_call()
...
}struct Foo
x::Int
y::TracedRArray{Float32, 2}
end
f(z::Foo) # 1 version of z.x == 1
f(z::Foo) # 1 version of z.x == 2
f(z::Foo) # 1 version of z.y is size 100x100
f(z::Foo) # 1 version of z.y is size 10x10Check the values in Julia land, and the MLIR Types to cache the functions among a single trace.
mofeing
Metadata
Metadata
Assignees
Labels
No labels