Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mlir][DataLayoutInterface] no impl filterEntryForIdentifier(TargetDeviceSpecListRef entries,...) #121732

Open
makslevental opened this issue Jan 6, 2025 · 2 comments
Assignees
Labels

Comments

@makslevental
Copy link
Contributor

This decl has no impl here (or anywhere else).

I'm not clear on the semantics so I'm not sure what an impl should look like? Possibly

TargetDeviceSpecInterface
mlir::detail::filterEntryForIdentifier(TargetDeviceSpecListRef entries,
                                       StringAttr id) {
  const auto *it = llvm::find_if(entries, [id](TargetDeviceSpecInterface entry) {
    if (auto attr = dyn_cast<StringAttr>(entry.getSpecForIdentifier(id).getKey()))
      return attr == id;
    return false;
  });
  return it == entries.end() ? TargetDeviceSpecInterface() : *it;
}

but I'm not sure (I don't work with this interface often).

@llvmbot
Copy link
Member

llvmbot commented Jan 6, 2025

@llvm/issue-subscribers-mlir

Author: Maksim Levental (makslevental)

[This decl](https://github.com/llvm/llvm-project/blob/5c1752e368585e55c0335a7d7651fe43d42af282/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h#L108-L111) has no impl [here](https://github.com/llvm/llvm-project/blob/9192367ad1af30c59d5b7adc0a099bd7e524e5dd/mlir/lib/Interfaces/DataLayoutInterfaces.cpp#L314-L323) (or anywhere else).

I'm not clear on the semantics so I'm not sure what an impl should look like? Possibly

TargetDeviceSpecInterface
mlir::detail::filterEntryForIdentifier(TargetDeviceSpecListRef entries,
                                       StringAttr id) {
  const auto *it = llvm::find_if(entries, [id](TargetDeviceSpecInterface entry) {
    if (auto attr = dyn_cast&lt;StringAttr&gt;(entry.getSpecForIdentifier(id).getKey()))
      return attr == id;
    return false;
  });
  return it == entries.end() ? TargetDeviceSpecInterface() : *it;
}

but I'm not sure (I don't work with this interface often).

@gysit
Copy link
Contributor

gysit commented Jan 6, 2025

I am not super familiar with that code either.

TargetDeviceSpecInterface seems to use the signature of filterEntryForIdentifier that returns a DataLayoutEntryInterface. I am not sure if this intended or if an implementation similar to the one you suggested is needed.

@ftynse may know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants