From eab8d3cda11862b30b42aacbbb2de04db29e2a5e Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Sun, 19 Jun 2016 14:55:17 +0200 Subject: Minor fix to the database script --- scripts/database/database.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts/database') diff --git a/scripts/database/database.py b/scripts/database/database.py index 4ca184c5..49bc1801 100644 --- a/scripts/database/database.py +++ b/scripts/database/database.py @@ -143,7 +143,8 @@ def CalculateDefaults(df): groups = dfdefault.groupby(DEVICETYPE_ATTRIBUTES+KERNEL_ATTRIBUTES+["kernel"]) for name, dfgroup in groups: if len(dfgroup) != 1: - print("[WARNING] Entries for a single kernel with multiple argument values") + description = dfgroup["kernel"].min() + " " + dfgroup["device_vendor"].min() + print("[WARNING] Entries for a single kernel with multiple argument values: " + description) # Defaults in general groups = df.groupby(KERNEL_ATTRIBUTES+ARGUMENT_ATTRIBUTES+["kernel"]) @@ -218,7 +219,7 @@ def PrintData(df, outputdir): # Iterates over the kernel families: creates a new file per family for family, dffamily in df.groupby(["kernel_family"]): dffamily = dffamily.dropna(axis=1, how='all') - f = open(os.path.join(outputdir, family+'.h'), 'w+') + f = open(os.path.join(outputdir, family+'.hpp'), 'w+') f.write(GetHeader(family)) # Loops over the different entries for this family and prints their headers @@ -301,6 +302,11 @@ if len(glob.glob(glob_json)) >= 1: print("## Storing the database to disk...") SaveDatabase(database, file_db) +# Optional: update the database here. Default is disabled, code below is just an example +if False: + database = UpdateDatabase(database, ((database["kernel"] == "CopyMatrixFast") & (database["precision"] == "3232")), "arg_alpha", "2+0.5i") + SaveDatabase(database, file_db) + # Retrieves the best performing results print("## Calculating the best results per device/kernel...") bests = GetBestResults(database) -- cgit v1.2.3