Fix Agent_global variables failing hipTestDeviceSymbol

Issue: Header uses std::vector<Agent_global> agent_globals which is created by hip_module.cpp
  - Move iterator fails to copy Agent_global from library source into header version
  - Due to different versions of std::string name in struct Agent_global
Fix: Change Agent_global to use char* name instead of std::string name
Cette révision appartient à :
Aaron Enye Shi
2019-03-06 18:33:43 +00:00
Parent 23e9968752
révision 00d24d254d
2 fichiers modifiés avec 7 ajouts et 4 suppressions
+2 -2
Voir le fichier
@@ -2506,7 +2506,7 @@ hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, con
hipError_t hipFuncGetAttributes(hipFuncAttributes* attr, const void* func);
struct Agent_global {
std::string name;
char* name;
hipDeviceptr_t address;
uint32_t byte_cnt;
};
@@ -2524,7 +2524,7 @@ template<typename ForwardIterator>
std::pair<hipDeviceptr_t, std::size_t> read_global_description(
ForwardIterator f, ForwardIterator l, const char* name) {
const auto it = std::find_if(f, l, [=](const Agent_global& x) {
return x.name == name;
return strcmp(x.name, name) == 0;
});
return it == l ?