Internal change

PiperOrigin-RevId: 345073707
Change-Id: I17f602947402bfbdd590f2d948223ac337e48b58
This commit is contained in:
A. Unique TensorFlower 2020-12-01 12:17:07 -08:00 committed by TensorFlower Gardener
parent f432994964
commit e4f404e12f

View File

@ -69,13 +69,7 @@ absl::Status LoadOpenCL() {
error_code));
}
#else
void* libopencl = dlopen("libOpenCL.so", RTLD_NOW | RTLD_LOCAL);
if (libopencl) {
LoadOpenCLFunctions(libopencl, false);
return absl::OkStatus();
}
// record error
std::string error(dlerror());
void* libopencl = nullptr;
#ifdef __ANDROID__
// Pixel phone or auto?
libopencl = dlopen("libOpenCL-pixel.so", RTLD_NOW | RTLD_LOCAL);
@ -91,6 +85,13 @@ absl::Status LoadOpenCL() {
return absl::OkStatus();
}
#endif
libopencl = dlopen("libOpenCL.so", RTLD_NOW | RTLD_LOCAL);
if (libopencl) {
LoadOpenCLFunctions(libopencl, false);
return absl::OkStatus();
}
// record error
std::string error(dlerror());
return absl::UnknownError(
absl::StrCat("Can not open OpenCL library on this device - ", error));
#endif