| 278 | } |
| 279 | |
| 280 | bool |
| 281 | Config::applyOptions( |
| 282 | const po::variables_map& vm, |
| 283 | bool stopOnError) |
| 284 | { |
| 285 | bool rc; |
| 286 | ArgMultiplier v; |
| 287 | |
| 288 | rc = true; |
| 289 | |
| 290 | if (vm.count("function")) { |
| 291 | if (!setFunction(vm["function"].as<std::string>())) { |
| 292 | std::cerr << "Invalid function name: " << |
| 293 | vm["function"].as<std::string>() << std::endl; |
| 294 | return false; |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | if (vm.count("cpp")) { |
| 299 | setCpp(vm["cpp"].as<std::string>()); |
| 300 | } |
| 301 | if (vm.count("cl")) { |
| 302 | setCl(vm["cl"].as<std::string>()); |
| 303 | } |
| 304 | if (vm.count("data")) { |
| 305 | if (!setDataPattern(vm["data"].as<std::string>())) { |
| 306 | std::cerr << "Invalid data pattern name" << std::endl; |
| 307 | rc = false; |
| 308 | if (stopOnError) { |
| 309 | return false; |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | if (vm.count("skip-accuracy")) { |
| 314 | setSkipAccuracy(); |
| 315 | } |
| 316 | |
| 317 | if (vm.count("platform")) { |
| 318 | if (!setPlatform(vm["platform"].as<std::string>())) { |
| 319 | std::cerr << "Invalid platform name" << std::endl; |
| 320 | rc = false; |
| 321 | if (stopOnError) { |
| 322 | return false; |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | if (vm.count("device")) { |
| 327 | if (!setDevice(vm["device"].as<std::string>())) { |
| 328 | std::cerr << "Invalid device name" << std::endl; |
| 329 | rc = false; |
| 330 | if (stopOnError) { |
| 331 | return false; |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | if (vm.count("build-options")) { |
| 336 | setBuildOptions(vm["build-options"].as<std::string>()); |
| 337 | } |
nothing calls this directly
no test coverage detected