Commit 9c86aec 1 parent f19e248 commit 9c86aec Copy full SHA for 9c86aec
File tree 2 files changed +9
-2
lines changed
tensorflow/lite/experimental/litert
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ cc_test(
459
459
# "@com_google_absl//absl/log:absl_log",
460
460
# "@com_google_absl//absl/strings:string_view",
461
461
# "@com_google_absl//absl/types:span",
462
- # "//third_party/odml/infra/ml_drift_delegate:ml_drift_cl_accelerator", # buildcleaner: keep
462
+ # "//third_party/odml/infra/ml_drift_delegate/litert :ml_drift_cl_accelerator", # buildcleaner: keep
463
463
# "//tensorflow/lite:framework",
464
464
# "//tensorflow/lite/c:c_api_opaque",
465
465
# "//tensorflow/lite/c:common",
Original file line number Diff line number Diff line change 14
14
15
15
#include " tensorflow/lite/experimental/litert/core/environment.h"
16
16
17
+ #include < dlfcn.h>
18
+
17
19
#include < memory>
18
20
#include < string>
19
21
#include < utility>
@@ -43,7 +45,12 @@ litert::Expected<LiteRtEnvironmentT::Ptr> LiteRtEnvironmentT::CreateWithOptions(
43
45
}
44
46
45
47
// Find `LiteRtRegisterAcceleratorGpuOpenCl` to register the GPU delegate.
46
- void * lib_opencl = nullptr ;
48
+ static void * lib_opencl =
49
+ tflite::SharedLibrary::LoadLibrary (" libLiteRtGpuAccelerator.so" );
50
+ if (!lib_opencl) {
51
+ // If the library is not found, find the symbol in the current library.
52
+ lib_opencl = RTLD_DEFAULT;
53
+ }
47
54
auto opencl_registrar_func = reinterpret_cast <void (*)(LiteRtEnvironment)>(
48
55
tflite::SharedLibrary::GetLibrarySymbol (
49
56
lib_opencl, " LiteRtRegisterAcceleratorGpuOpenCl" ));
You can’t perform that action at this time.
0 commit comments