File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -938,8 +938,9 @@ oroDevice oroGetRawDevice( oroDevice dev )
938938
939939oroDevice 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
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ HIPRT_STATIC_ASSERT( !UseBakedCode || BakedCodeIsGenerated );
6969
7070namespace hiprt
7171{
72- Compiler::Compiler ()
72+
73+ void Compiler::init ()
7374{
7475 if ( UseBitcode || UseBakedCompiledKernel || hiprtcCreateProgram == nullptr || hiprtcCompileProgram == nullptr ||
7576 hiprtcDestroyProgram == nullptr )
Original file line number Diff line number Diff line change @@ -35,9 +35,10 @@ class Context;
3535class 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,
Original file line number Diff line number Diff 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
4446Context::~Context ()
You can’t perform that action at this time.
0 commit comments