Skip to content

Commit 25c2328

Browse files
Merge pull request #123 from AtsushiYoshimura0302/feature/ORO-0-init-with-exisiting-context
initialization from existing context
2 parents 0bd2133 + 7d75948 commit 25c2328

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Orochi/Orochi.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,21 @@ oroError OROAPI oroCtxGetCurrent(oroCtx* pctx)
12191219
if ( e != hipSuccess )
12201220
return hip2oro(e);
12211221
}
1222+
1223+
// externally initialized context
1224+
if( s_oroCtxs.count( ctxt->m_ptr ) == 0 && ctxt->m_ptr )
1225+
{
1226+
ioroCtx_t* c = new ioroCtx_t;
1227+
c->m_ptr = ctxt->m_ptr;
1228+
c->setApi( s_api );
1229+
s_oroCtxs[ctxt->m_ptr] = c;
1230+
}
1231+
1232+
if (s_oroCtxs.count(ctxt->m_ptr) == 0)
1233+
{
1234+
return oroErrorNotReady;
1235+
}
1236+
12221237
( *pctx ) = s_oroCtxs[ctxt->m_ptr];
12231238
delete ctxt;
12241239
return oroSuccess;

0 commit comments

Comments
 (0)