Added try-except to database script parser to skip invalid files

pull/232/head
Cedric Nugteren 2017-12-20 19:14:04 +01:00
parent e2f8068459
commit c680666250
2 changed files with 13 additions and 8 deletions

View File

@ -4,6 +4,7 @@ Development (next version)
- Made it possible to override the tuning parameters in the clients straight from JSON tuning files
- Added OpenCL pre-processor to unroll loops and perform array-to-register promotions for compilers
which don't do this themselves (ARM Mali) - greatly improves performance on these platforms
- Various minor fixes and enhancements
- Added tuned parameters for various devices (see README)
Version 1.2.0

View File

@ -106,16 +106,20 @@ def main(argv):
# Loops over all JSON files in the supplied folder
for file_json in glob.glob(json_files):
# Loads the newly imported data
sys.stdout.write("[database] Processing '" + file_json + "' ") # No newline printed
imported_data = io.load_tuning_results(file_json)
# Adds the new data to the database
old_size = db.length(database)
database = db.add_section(database, imported_data)
new_size = db.length(database)
print("with " + str(new_size - old_size) + " new items") # Newline printed here
try:
# Loads the newly imported data
imported_data = io.load_tuning_results(file_json)
# Adds the new data to the database
old_size = db.length(database)
database = db.add_section(database, imported_data)
new_size = db.length(database)
print("with " + str(new_size - old_size) + " new items") # Newline printed here
except ValueError:
print("--- WARNING: invalid file, skipping")
# Checks for tuning results with mis-matched entries
remove_mismatched_arguments(database)