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:
sdashmiz
2022-08-18 17:35:58 -04:00
committed by Christophe Paquot
parent 97741fe5d4
commit ce5103ac97
3 changed files with 3 additions and 7 deletions
+1 -1
View File
@@ -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
-1
View File
@@ -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) {
+2 -5
View File
@@ -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);
}