Consolidate interfaces adding workgroup and private buffer attributions in GPU
dialect.
Note all private buffer attributions must follow workgroup buffer attributions.
Differential D79508
[mlir][gpu] Refactor functions for workgroup and private buffer attributions. whchung on May 6 2020, 10:48 AM. Authored by
Details Consolidate interfaces adding workgroup and private buffer attributions in GPU Note all private buffer attributions must follow workgroup buffer attributions.
Diff Detail
Event TimelineComment Actions Thanks for adding this!
Comment Actions Thanks for the cleanup.
Comment Actions @herhut I just revised the patch to address your review comments. Getting rid of the counter for private allocations is less than ideal in my applications but I've found ways to get around them. Could you give this patch another look? Thanks. Comment Actions I think you misunderstood my comment. I liked having the getters and interface for private attributions. My point was that you do not need to store a count as an attribute for the private attributions but instead could always compute the number of private attributes via getNumOperands() - getType().getNumInputs() - getNumWorkgroupAttributions(). Sorry for not being clear. Using that approach should also cover your use cases? Comment Actions @herhut Yes, that's exactly how I compute the number of private attributes right now in my application. BTW it seems nowadays pre-merge checks would always fail on Windows due to logic in SPIR-V dialect. [2020-05-19T14:57:38.942Z] tools\mlir\include\mlir/Dialect/SPIRV/SPIRVSerialization.inc(4334): fatal error C1061: compiler limit: blocks nested too deeply Comment Actions
This should be fixed by patch https://github.com/llvm/llvm-project/commit/d5b1643c74eeae327d85c75fe79fd98edb1014f9 Comment Actions Why not add a getNumPrivateAttributions to the GPUFunc for this? Then the interface is exactly as before. With that change, I think this is good to land.
Comment Actions Reinstate getNumPrivateAttributions() in GPUFunc. Use it in verifier logic, and addPrivateAttribution() logic.
|
These getters that give access to a range should remain in the header to enable inlining (and maybe avoid materializing the ArrayRef).