Test Scripts Enhancement - readme correction & better error handling (#132)

* readme correction & better error handling

* review comments

[ROCm/rocdecode commit: 06cde7965b]
Tento commit je obsažen v:
Lakshmi Kumar
2023-12-12 07:34:31 -08:00
odevzdal GitHub
rodič 5a9f519761
revize a3e509db61
2 změnil soubory, kde provedl 11 přidání a 2 odebrání
+1 -1
Zobrazit soubor
@@ -22,7 +22,7 @@ usage: run_rocDecodeSamples.py [--rocDecode_directory ROCDECODE_DIRECTORY]
optional arguments:
-h, --help show this help message and exit
--rocDecode_directory ROCDECODE_DIRECTORY
The rocDecode samples Directory - required
The rocDecode Directory - required
--gpu_device_id GPU_DEVICE_ID
The GPU device ID that will be used to run the test on it - optional (default:0 [range:0 - N-1] N = total number of available GPUs on a machine)
--files_directory FILES_DIRECTORY
+10 -1
Zobrazit soubor
@@ -57,7 +57,7 @@ def iter_files(path):
# Import arguments
parser = argparse.ArgumentParser()
parser.add_argument('--rocDecode_directory', type=str, default='',
help='The rocDecode samples Directory - required')
help='The rocDecode Directory - required')
parser.add_argument('--gpu_device_id', type=int, default=0,
help='The GPU device ID that will be used to run the test on it - optional (default:0 [range:0 - N-1] N = total number of available GPUs on a machine)')
parser.add_argument('--files_directory', type=str, default='',
@@ -94,6 +94,15 @@ else:
print("\nERROR: rocDecode Executable Not Found\n")
exit()
if os.path.exists(filesDir) and not os.path.isfile(filesDir):
# Checking if the directory is empty or not
if not os.listdir(filesDir):
print("\nERROR: Empty directory - no videos to decode")
exit()
else:
print("\nERROR: The input directory path is either for a file or directory does not exist!")
exit()
# Get cwd
cwd = os.getcwd()
if os.path.exists(resultsPath+'/rocDecode_output.log'):