This patch includes some changes which deletes the code accessing
g_atl_machine global. Some accesses related to memory_pools are
still remaining.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp | ||
---|---|---|
27–28 | int DeviceID is somewhat error prone, I wonder if it's worth changing to something like struct DeviceIDType { // operations private: uint8_t data; }; where there is a check at the entry point that it is positive and within the number of available GPUs, and then we pass that pre-validated type instance around | |
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
45 | Are these header-only? They're more likely to cause problems if there is a LLVM library that needs to be linked in to use them | |
257–258 | Not totally sure about this factoring. What do you think of populating one vector for GPU agents and a second one for CPU agents, instead of tagging each element with a dynamic type? | |
393 | This seems to answer the above comment. Is the llvm::Optional<std::vector<DeviceTypeAgentPair>> type replaceable by passing a stateful lambda to FindAgents(), with a reference to each vector? |
openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp | ||
---|---|---|
27–28 | I don't understand. How would it be different from just using int deviceId and verifying it before passing to the methods? | |
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
45 | I haven't checked that. I just compiled and ran libomptarget tests (all of which are fine). But, there is some code which is present in corresponding .cpps in lib/Support/. | |
393 | Will work on it. |
openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp | ||
---|---|---|
27–28 | Would move some programming mistake detection from assert time to compile time | |
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
528 | These appear to be unused | |
573 | I'm not sure this needs AllAgents - shouldn't one of the subsets (iirc it would be HSAAgents) suffice? |
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
---|---|---|
573 | Normally kernarg is found in CPUAgents, so I included both in case HSAAgents also have kernarg pool. |
LG. My preference would be as commented above, but the vector containing the contents of the other two works too.
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
---|---|---|
573 | I think we should go with passing the list we currently see the kernarg segment in, partly to alert us if a future system changes that association, and partly because it's fractionally faster code that way. I think that also drops the AllAgents vector so there's less redundant state lying around. |
int DeviceID is somewhat error prone, I wonder if it's worth changing to something like
where there is a check at the entry point that it is positive and within the number of available GPUs, and then we pass that pre-validated type instance around