| 186 | # endif |
| 187 | |
| 188 | static bool loadCudaSupportLib() |
| 189 | { |
| 190 | void* handle; |
| 191 | const std::string name = getCudaSupportLibName(); |
| 192 | dlerror(); |
| 193 | handle = dlopen(name.c_str(), RTLD_LAZY); |
| 194 | if (!handle) |
| 195 | { |
| 196 | LOGE("Cannot dlopen %s: %s", name.c_str(), dlerror()); |
| 197 | return false; |
| 198 | } |
| 199 | |
| 200 | deviceInfoFactory = (DeviceInfoFactoryType)dlsym(handle, "deviceInfoFactory"); |
| 201 | if (!deviceInfoFactory) |
| 202 | { |
| 203 | LOGE("Cannot dlsym deviceInfoFactory: %s", dlerror()); |
| 204 | dlclose(handle); |
| 205 | return false; |
| 206 | } |
| 207 | |
| 208 | gpuFactory = (GpuFactoryType)dlsym(handle, "gpuFactory"); |
| 209 | if (!gpuFactory) |
| 210 | { |
| 211 | LOGE("Cannot dlsym gpuFactory: %s", dlerror()); |
| 212 | dlclose(handle); |
| 213 | return false; |
| 214 | } |
| 215 | |
| 216 | return true; |
| 217 | } |
| 218 | |
| 219 | # else |
| 220 | # error "Dynamic CUDA support is not implemented for this platform!" |
no test coverage detected