Mousius commented on a change in pull request #9500:
URL: https://github.com/apache/tvm/pull/9500#discussion_r749338146



##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -587,8 +633,12 @@ class AOTExecutorCodegen : public MixedModeVisitor {
     dict_attrs.Set("global_symbol", run_func_name);
     dict_attrs.Set("runner_function", Bool(true));
 
+    tir::Stmt device_activations = GenerateAllDeviceHook("Activate");
+    tir::Stmt device_deactivations = GenerateAllDeviceHook("Deactivate");
+    tir::Stmt final_body = tir::SeqStmt({device_activations, body, 
device_deactivations});

Review comment:
       My personal opinion is we should create and name variables for their 
purpose rather than constantly mutating them so you can track what they're 
being used for. Shouldn't the C++ compiler figure out that `body` is no longer 
live and do this micro-optimisation for us?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to