File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,9 @@ class Target : public ObjectRef {
218218 */
219219 static Target WithHost (const Target& target, const Target& host);
220220
221+ /* ! \return The target with the host stripped out */
222+ Target WithoutHost () const ;
223+
221224 /* !
222225 * \brief Returns true if \p this target represents an external codegen. If so,
223226 * \p this->kind->name can be used as the "Compiler" attribute on partitioned functions,
Original file line number Diff line number Diff line change @@ -662,6 +662,16 @@ Map<String, ObjectRef> TargetNode::Export() const {
662662
663663Optional<Target> TargetNode::GetHost () const { return this ->host .as <Target>(); }
664664
665+ Target Target::WithoutHost () const {
666+ if ((*this )->GetHost ()) {
667+ auto output = make_object<TargetNode>(*get ());
668+ output->host = NullOpt;
669+ return Target (output);
670+ } else {
671+ return *this ;
672+ }
673+ }
674+
665675int TargetNode::GetTargetDeviceType () const {
666676 if (Optional<Integer> device_type = GetAttr<Integer>(" target_device_type" )) {
667677 return Downcast<Integer>(device_type)->value ;
You can’t perform that action at this time.
0 commit comments