| 83 | return 1 |
| 84 | |
| 85 | def executable(library): |
| 86 | if type(library) != str: |
| 87 | print 'ERROR: expected library name to be a string' |
| 88 | quit() |
| 89 | |
| 90 | if sys.platform != 'win32' and sys.platform != 'linux2': |
| 91 | print 'ERROR: unknown operating system' |
| 92 | quit() |
| 93 | if library == 'clblas': |
| 94 | if sys.platform == 'win32': |
| 95 | exe = 'clBLAS-client.exe' |
| 96 | elif sys.platform == 'linux2': |
| 97 | exe = './clBLAS-client' |
| 98 | if library == 'acmlblas': |
| 99 | if sys.platform == 'win32': |
| 100 | exe = 'ACMLBlas_client.exe' |
| 101 | elif sys.platform == 'linux2': |
| 102 | exe = './ACMLBlas_client' |
| 103 | if library!='null' and library!='clblas' and library!='acmlblas': |
| 104 | print 'ERROR: unknown library -- cannot determine executable name ' + library |
| 105 | quit() |
| 106 | |
| 107 | if not os.path.isfile(exe): |
| 108 | error_message = 'ERROR: could not find client named ' + exe |
| 109 | print error_message |
| 110 | quit() |
| 111 | |
| 112 | return exe |
| 113 | |
| 114 | def max_mem_available_in_bytes(exe, device): |
| 115 | arguments = [exe, '-i', device] |