@@ -652,23 +652,24 @@ JIT::JIT()
652652 _crunnerlib = std::string (mlirRoot) + " /lib/libmlir_c_runner_utils.so" ;
653653 _runnerlib = std::string (mlirRoot) + " /lib/libmlir_runner_utils.so" ;
654654
655- const char *gpuxlibstr = getenv (" DDPT_GPUX_SO" );
656- if (gpuxlibstr) {
657- _gpulib = std::string (gpuxlibstr);
658- } else {
659- const char *imexRoot = getenv (" IMEXROOT" );
660- imexRoot = imexRoot ? imexRoot : CMAKE_IMEX_ROOT;
661- _gpulib = std::string (imexRoot) + " /lib/liblevel-zero-runtime.so" ;
662- }
663-
664- // static const char * xxx =
665- // "/home/fschlimb/imex/lib/libimex_runner_utils.so";
666-
667655 const char *idtrlib = getenv (" DDPT_IDTR_SO" );
668656 idtrlib = idtrlib ? idtrlib : " libidtr.so" ;
669657
670- _sharedLibPaths = {_crunnerlib.c_str (), _runnerlib.c_str (), // xxx,
671- idtrlib, _gpulib.c_str ()};
658+ auto useGPU = getenv (" DDPT_USE_GPU" );
659+ if (useGPU) {
660+ const char *gpuxlibstr = getenv (" DDPT_GPUX_SO" );
661+ if (gpuxlibstr) {
662+ _gpulib = std::string (gpuxlibstr);
663+ } else {
664+ const char *imexRoot = getenv (" IMEXROOT" );
665+ imexRoot = imexRoot ? imexRoot : CMAKE_IMEX_ROOT;
666+ _gpulib = std::string (imexRoot) + " /lib/liblevel-zero-runtime.so" ;
667+ }
668+ _sharedLibPaths = {_crunnerlib.c_str (), _runnerlib.c_str (), idtrlib,
669+ _gpulib.c_str ()};
670+ } else {
671+ _sharedLibPaths = {_crunnerlib.c_str (), _runnerlib.c_str (), idtrlib};
672+ }
672673
673674 // detect target architecture
674675 auto tmBuilderOrError = llvm::orc::JITTargetMachineBuilder::detectHost ();
0 commit comments