Skip to content

Conversation

@alexreinking
Copy link
Member

@alexreinking alexreinking commented Sep 12, 2025

If you create two ImageParams with the same name, you can only call .trace_loads() on the first one. The second one will silently do nothing. That's because of this section of code in Tracing.cpp:

        } else if (op->call_type == Call::Image) {
            trace_it = trace_all_loads;
            // If there is a Function in the env named "name_im", assume that
            // this image is an ImageParam, so sniff that Function to see
            // if we want to trace loads on it. (This allows us to trace
            // loads on inputs without having to enable them globally.)
            auto it = env.find(op->name + "_im");

...only that name gets rendered as something like input_im$1 when input is duplicated. It would need to be called input$1_im for this logic to work.

This PR fixes that issue by allowing ImageParams to be marked for tracing directly. Params initially appear in the trace before any func, so the order was changed in one of the tests.

@alexreinking alexreinking marked this pull request as ready for review September 12, 2025 01:02
@alexreinking alexreinking merged commit f974be5 into main Sep 12, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants