SWDEV-569319 Replace ScopedAcquire with stdcpp wrappers (#2146)
* SWDEV-569319 Replace ScopedAcquire with stdcpp wrappers * Remove KernelMutex and KernelSharedMutex abstractions with std::mutex and std::shared_mutex * Replaced unique_locks with lock_guards * More changes * Replace new and deletes with smart pointers * Replaced some more with shared ptrs * Replacements with smart pointers - pt 2 * missed change
此提交包含在:
34 file changed
+319
-452
No files matched your search
@@ -461,7 +461,7 @@ public:
|
||||
};
|
||||
|
||||
typedef std::string ProgramSymbol;
|
||||
typedef std::unordered_map<ProgramSymbol, SymbolImpl*> ProgramSymbolMap;
|
||||
typedef std::unordered_map<ProgramSymbol, std::shared_ptr<SymbolImpl>> ProgramSymbolMap;
|
||||
|
||||
typedef std::pair<std::string, hsa_agent_t> AgentSymbol;
|
||||
struct ASC {
|
||||
@@ -476,7 +476,7 @@ struct ASH {
|
||||
return h ^ (i << 1);
|
||||
}
|
||||
};
|
||||
typedef std::unordered_map<AgentSymbol, SymbolImpl*, ASH, ASC> AgentSymbolMap;
|
||||
typedef std::unordered_map<AgentSymbol, std::shared_ptr<SymbolImpl>, ASH, ASC> AgentSymbolMap;
|
||||
|
||||
class ExecutableImpl final: public Executable {
|
||||
friend class AmdHsaCodeLoader;
|
||||
@@ -634,15 +634,15 @@ private:
|
||||
|
||||
ProgramSymbolMap program_symbols_;
|
||||
AgentSymbolMap agent_symbols_;
|
||||
std::vector<ExecutableObject*> objects;
|
||||
Segment *program_allocation_segment;
|
||||
std::vector<LoadedCodeObjectImpl*> loaded_code_objects;
|
||||
std::vector<std::shared_ptr<ExecutableObject>> objects;
|
||||
std::shared_ptr<Segment> program_allocation_segment;
|
||||
std::vector<std::shared_ptr<LoadedCodeObjectImpl>> loaded_code_objects;
|
||||
};
|
||||
|
||||
class AmdHsaCodeLoader : public Loader {
|
||||
private:
|
||||
Context* context;
|
||||
std::vector<Executable*> executables;
|
||||
std::vector<std::shared_ptr<Executable>> executables;
|
||||
amd::hsa::common::ReaderWriterLock rw_lock_;
|
||||
|
||||
public:
|
||||
|
||||
Reference in new issue
封鎖使用者