Main entry point for the device query sample.
()
| 361 | |
| 362 | |
| 363 | def main(): |
| 364 | """ |
| 365 | Main entry point for the device query sample. |
| 366 | """ |
| 367 | import argparse |
| 368 | |
| 369 | parser = argparse.ArgumentParser( |
| 370 | description="Query CUDA Device Properties using CUDA Core API", |
| 371 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 372 | ) |
| 373 | parser.add_argument( |
| 374 | "--no-p2p", action="store_true", help="Skip peer-to-peer access information" |
| 375 | ) |
| 376 | |
| 377 | args = parser.parse_args() |
| 378 | |
| 379 | success = query_devices(show_p2p=not args.no_p2p) |
| 380 | |
| 381 | if success: |
| 382 | print("\nDone") |
| 383 | return 0 |
| 384 | else: |
| 385 | return 1 |
| 386 | |
| 387 | |
| 388 | if __name__ == "__main__": |
no test coverage detected