Skip to content

Commit 305690f

Browse files
committed
fix multi gpu setup
1 parent 7d1a015 commit 305690f

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

contrib/Orochi/Orochi/Orochi.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,9 @@ oroDevice oroGetRawDevice( oroDevice dev )
938938

939939
oroDevice oroSetRawDevice( oroApi api, oroDevice dev )
940940
{
941-
ioroDevice d( dev );
941+
ioroDevice d{};
942942
d.setApi( api );
943+
d.setDevice( dev );
943944
return *(oroDevice*)&d;
944945
}
945946

hiprt/impl/Compiler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ HIPRT_STATIC_ASSERT( !UseBakedCode || BakedCodeIsGenerated );
6969

7070
namespace hiprt
7171
{
72-
Compiler::Compiler()
72+
73+
void Compiler::init()
7374
{
7475
if ( UseBitcode || UseBakedCompiledKernel || hiprtcCreateProgram == nullptr || hiprtcCompileProgram == nullptr ||
7576
hiprtcDestroyProgram == nullptr )

hiprt/impl/Compiler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ class Context;
3535
class Compiler
3636
{
3737
public:
38-
Compiler();
3938
~Compiler();
4039

40+
void init();
41+
4142
Kernel getKernel(
4243
Context& context,
4344
const std::filesystem::path& moduleName,

hiprt/impl/Context.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Context::Context( const hiprtContextCreationInput& input )
3939
oroApi api = ( input.deviceType == hiprtDeviceAMD ) ? ORO_API_HIP : ORO_API_CUDA;
4040
oroCtxCreateFromRaw( &m_ctxt, api, input.ctxt );
4141
m_device = oroSetRawDevice( api, input.device );
42+
checkOro( oroCtxSetCurrent( m_ctxt ) );
43+
m_compiler.init();
4244
}
4345

4446
Context::~Context()

0 commit comments

Comments
 (0)