Skip to content

Commit 2e69beb

Browse files
rosergtensorflower-gardener
authored andcommitted
Added MacOS path to OpenCL library.
PiperOrigin-RevId: 352599399 Change-Id: If324d63b031516cbb80e8d0b5cdf005821a82b62
1 parent 8db2d99 commit 2e69beb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tensorflow/lite/delegates/gpu/cl/opencl_wrapper.cc‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ absl::Status LoadOpenCL() {
8585
return absl::OkStatus();
8686
}
8787
#endif
88-
libopencl = dlopen("libOpenCL.so", RTLD_NOW | RTLD_LOCAL);
88+
#ifdef __APPLE__
89+
static const char* kClLibName =
90+
"/System/Library/Frameworks/OpenCL.framework/OpenCL";
91+
#else
92+
static const char* kClLibName = "libOpenCL.so";
93+
#endif
94+
libopencl = dlopen(kClLibName, RTLD_NOW | RTLD_LOCAL);
8995
if (libopencl) {
9096
LoadOpenCLFunctions(libopencl, false);
9197
return absl::OkStatus();

0 commit comments

Comments
 (0)