# Allow \`Target\` to customize \`device\_type\`

**URL:** <https://discuss.tvm.apache.org/t/allow-target-to-customize-device-type/13368>\
**Category:** Development\
**Created:** [August 19, 2022, 8:11pm UTC](https://discuss.tvm.apache.org/t/allow-target-to-customize-device-type/13368 "2022-08-19T20:11:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kparzysz](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/kparzysz/32/252_2.png) [@kparzysz](https://discuss.tvm.apache.org/u/kparzysz)\
**Post date:** [August 19, 2022, 8:11pm UTC](https://discuss.tvm.apache.org/t/allow-target-to-customize-device-type/13368/1 "2022-08-19T20:11:35Z")

</div>

Currently, the `TargetKind` structure has `device_type` stored in it, and it is the device type used by any `Target` connected to this target kind. Target kind has a number of attributes that targets can modify to suite their needs. Since there can be multiple targets with very different properties instantiated from the same kind, it seems to make sense to allow `Target` to customize the device type as well.

This would help Hexagon for example, but could be useful for any target that wants to use the “llvm” kind without behaving strictly like a CPU (which is the current device type for the “llvm” kind).

Any thoughts?

---

<div class="post-metadata">

**Author:** ![kparzysz](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/kparzysz/32/252_2.png) [@kparzysz](https://discuss.tvm.apache.org/u/kparzysz)\
**Post date:** [August 22, 2022, 8:22pm UTC](https://discuss.tvm.apache.org/t/allow-target-to-customize-device-type/13368/2 "2022-08-22T20:22:59Z")

</div>

I have created [PR12509](https://github.com/apache/tvm/pull/12509) for this.
