cbalint13 commented on code in PR #16425:
URL: https://github.com/apache/tvm/pull/16425#discussion_r1457343144


##########
src/target/llvm/llvm_instance.cc:
##########
@@ -845,10 +847,11 @@ const Array<String> 
LLVMTargetInfo::GetAllLLVMCpuFeatures() const {
 #else
       MCInfo->getAllProcessorFeatures();
 #endif
-  Array<String> cpu_features;
+  // TVM doesn't have an FFI friendly Set, so use a Map instead for now
+  Map<String, String> cpu_features;

Review Comment:
   > Good point thanks, 
   
   However I think my request concerns the pedantic side and ignores the 
performance gains.
   
   >I'd forgotten to check this. Due to the restriction on the FFI, perhaps we 
can fix this on the python side? For example:
   > 
   > ```
   > feature_map = _ffi_api.llvm_get_cpu_features(target)
   > return set(feature_map.keys())
   > ```
   
   Super ! 
   I think this would be enough for python side.
   
   > 
   > We could also use std::set for the c++ API if desired, we'd just have to 
make the conversion to/from Map before/after crossing the FFI boundary.
   
   See, well I think ```Map``` is fine and it may be the fastest option 
concerning lookup speeds in hot-paths.
   
   Thanks @lhutton1 !
   



-- 
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: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to