How to print the device info for an expr node in TVM

Hi , i have been experimenting with exprNode class of TVM , and trying to optimize the buffer allocation and reuse logic for a speical usecase. (in BYOC codegen).
I am trying to figure out where the VarNode data is actually residing , or where the output of a callNode will be residing in terms of Memory on which target (CPU or GPU).
I need this information to effectively manage the custom buffer allocation and reusability.
After brief code review , i figured there is a field virtual_device_ for each expr_node in tvm which contains :

  • device_type_id
  • target
  • virtual_device
  • memory_scope
    and i primarily want to access this data structure and print the target and memory_scope field.
    But after many attempts i havent been able to print these fields. I get (?) print whenever i print the “virtual_device_” member of VarNode class. the code may look something like this:
std::vector<Output> VisitExpr_(const VarNode* node) final {
                        std::cout<<"var: "<<node<<" , target : "<<node->virtual_device()<<std::endl;
                        ext_func_args_.push_back(GetRef<Var>(node));

which ouputs this:

var: 0x1c56a30 , target : VirtualDevice(?)

so essentially i need to figure out if this VarNode is residing on GPU or CPU, and also in case of CallNode , where the output will reside (CPU or GPU).
Any help is highly appreciated. If anyone knows some other method to fullfill above mentioned tasks, please help .