pytorch/test/cpp
Raghavan Raman ef07a04072 [NNC] New APIs to get loops corresponding to a Buf (#53778)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/53092

This PR adds the following APIs to NNC.
```
// In For:
static For* getParentLoop(const Stmt* st);
static std::vector<For*> getEnclosingLoopNest(const Stmt* st);

// In LoopNest:
std::vector<const Stmt*> getAllWritesToBuf(const Buf*) const;
std::vector<For*> getAllInnermostLoopsWritingToBuf(const Buf*) const;
std::vector<std::vector<For*>> getAllLoopNestsWritingToBuf(const Buf*) const;
```

These APIs are required for some usecases that involve multiple transformations like `splitWithTail` followed by `reorder` as shown in https://github.com/pytorch/pytorch/issues/53092

Pull Request resolved: https://github.com/pytorch/pytorch/pull/53778

Reviewed By: albanD

Differential Revision: D26987013

Pulled By: navahgar

fbshipit-source-id: 491459eddfff045132d2358631ad069bbcc520df
2021-03-12 18:50:15 -08:00
..
api Adding learning rate schedulers to C++ API (#52268) 2021-03-10 23:09:51 -08:00
common
dist_autograd Forbid trailing whitespace (#53406) 2021-03-05 17:22:55 -08:00
jit Adds a bool is_available() method to the backend contract (#53068) 2021-03-10 00:24:16 -08:00
lite_interpreter_runtime [PyTorch][CI] Enable building test_lite_interpreter_runtime unittest in CI (macos) (#52566) 2021-03-08 13:09:25 -08:00
rpc Use Store collect and verify names in all RPC agents (#53209) 2021-03-07 16:51:46 -08:00
tensorexpr [NNC] New APIs to get loops corresponding to a Buf (#53778) 2021-03-12 18:50:15 -08:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00