SWDEV-352290 - remove the static list for user obj
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Change-Id: I8d7542ad5aacdda4e817c6aaed78c9cac4562efd
This commit is contained in:
committed by
Christophe Paquot
parent
97741fe5d4
commit
ce5103ac97
@@ -2075,7 +2075,7 @@ hipError_t hipGraphRetainUserObject(hipGraph_t graph, hipUserObject_t object, un
|
||||
|
||||
hipError_t hipGraphReleaseUserObject(hipGraph_t graph, hipUserObject_t object, unsigned int count) {
|
||||
HIP_INIT_API(hipGraphReleaseUserObject, graph, object, count);
|
||||
if (graph == nullptr || object == nullptr || !ihipGraph::isUserObjGraphValid(object)) {
|
||||
if (graph == nullptr || object == nullptr || !graph->isUserObjGraphValid(object)) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
//! Obj is being destroyed
|
||||
|
||||
@@ -55,7 +55,6 @@ std::unordered_set<hipGraphExec*> hipGraphExec::graphExecSet_;
|
||||
amd::Monitor hipGraphExec::graphExecSetLock_{"Guards global exec graph set"};
|
||||
std::unordered_set<hipUserObject*> hipUserObject::ObjectSet_;
|
||||
amd::Monitor hipUserObject::UserObjectLock_{"Guards global user object"};
|
||||
std::unordered_set<hipUserObject*> ihipGraph::graphUserObj_;
|
||||
|
||||
hipError_t hipGraphMemcpyNode1D::ValidateParams(void* dst, const void* src, size_t count,
|
||||
hipMemcpyKind kind) {
|
||||
|
||||
@@ -286,7 +286,7 @@ struct ihipGraph {
|
||||
const ihipGraph* pOriginalGraph_ = nullptr;
|
||||
static std::unordered_set<ihipGraph*> graphSet_;
|
||||
static amd::Monitor graphSetLock_;
|
||||
static std::unordered_set<hipUserObject*> graphUserObj_;
|
||||
std::unordered_set<hipUserObject*> graphUserObj_;
|
||||
|
||||
public:
|
||||
ihipGraph() {
|
||||
@@ -331,8 +331,7 @@ struct ihipGraph {
|
||||
graphUserObj_.insert(pUserObj);
|
||||
}
|
||||
// Check user obj resource from graph is valid
|
||||
static bool isUserObjGraphValid(hipUserObject* pUserObj) {
|
||||
amd::ScopedLock lock(graphSetLock_);
|
||||
bool isUserObjGraphValid(hipUserObject* pUserObj) {
|
||||
if (graphUserObj_.find(pUserObj) == graphUserObj_.end()) {
|
||||
return false;
|
||||
}
|
||||
@@ -340,7 +339,6 @@ struct ihipGraph {
|
||||
}
|
||||
// Delete user obj resource from graph
|
||||
void RemoveUserObjGraph(hipUserObject* pUserObj) {
|
||||
amd::ScopedLock lock(graphSetLock_);
|
||||
graphUserObj_.erase(pUserObj);
|
||||
}
|
||||
// saves the original graph ptr if cloned
|
||||
@@ -355,7 +353,6 @@ struct ihipGraph {
|
||||
void GetUserObjs( std::unordered_set<hipUserObject*>& graphExeUserObjs) {
|
||||
for(auto userObj : graphUserObj_)
|
||||
{
|
||||
amd::ScopedLock lock(graphSetLock_);
|
||||
userObj->retain();
|
||||
graphExeUserObjs.insert(userObj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user