Expose target architecture via Device.arch (#2485)#3108
Draft
hunhoffe wants to merge 1 commit into
Draft
Conversation
Wraps AIETargetModel::getTargetArch in the C API (aieTargetModelGetTargetArch), binds it on PyAieTargetModel as get_target_arch(), and adds an arch property on iron.Device that returns the AIEArch enum. Replaces the isinstance/AIEDevice cascade in utils/jit.py with a single device.arch lookup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the wrapper proposed in #2485: surfaces
AIETargetModel::getTargetArchas anarchproperty oniron.Devicereturning theAIEArchenum (AIE1/AIE2/AIE2p).aieTargetModelGetTargetArchinaie-c/TargetModel.h/lib/CAPI/TargetModel.cppPyAieTargetModel.get_target_arch()inpython/AIEMLIRModule.cppDevice.archproperty inpython/iron/device/device.pypython/utils/jit.pyreplaces theisinstance(NPU1/NPU2/...) / AIEDevice.npu*cascade with a singledevice.archlookup (and drops the now-unusedAIEDeviceimport)C++ call sites already use RTTI on
AIE1TargetModel/AIE2TargetModelper Jeff's suggestion in the issue, so no compiler-side changes were needed.closes #2485