Keeping all the checks in one place for future simplification.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
---|---|---|
331 | This method was moved above addKernArgPool because I needed it to be visible for the latter. So diff here is bit of messed up. |
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
---|---|---|
332 | Looks pre-existing but we can't exit here, need to pass the error up. I'll apply the patch and take a look in a better diff tool |
Couple of minor points around loss of specific error information and we might want another DP instance but otherwise looks good. std::pair<hsa_status_t, bool> to hsa_status_t is an improvement imo, we don't need particularly fine grained understanding of what went wrong when the plan on failure is to log something and keep going.
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
---|---|---|
315 | return Err here, it might be more informative than HSA_STATUS_ERROR when printed to a log | |
318–326 | i'd probably parenthesize this, (AllocAllowed && Size > 0) | |
323 | as above | |
334 | better to preserve the specific error | |
361–363 | somewhat inconsistent hat we aren't printing here. Maybe we want something like DP("Skipping memory pool: %s\n"); |
Unforeseen consequence arises here. Since isValidMemoryPool now returns false for zero size pools, a zero size pool will make addKernArgPool return an error, and that makes findKernargPool return an error, which aborts construction of the plugin. I have a system locally with two non-zero kernarg pools and to zero size ones which runs into this.
Going to patch by letting FindKernargPool keep looking on an error reported by the lower levels since a zero size pool is broadly equivalent to one we can't use for another reason.
return Err here, it might be more informative than HSA_STATUS_ERROR when printed to a log