Minor fix to the database script

This commit is contained in:
Cedric Nugteren 2016-06-19 14:55:17 +02:00
parent 395a0ef34e
commit eab8d3cda1

View file

@ -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)