summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-06-19 14:03:53 +0200
committerGitHub <noreply@github.com>2016-06-19 14:03:53 +0200
commit395a0ef34e2735eb9d08292238e92d41132dfaac (patch)
tree36cdce32423c2227de88e019c34415bef9499a6a /scripts
parent52ccaf5b25e14c9ce032315e5e96b1f27886d481 (diff)
parent61203453aaca4e47c05c598a673150522160ca87 (diff)
Merge pull request #69 from CNugteren/refactoring
Refactoring of the Routine class and file-renaming
Diffstat (limited to 'scripts')
-rw-r--r--scripts/database/database.py2
-rw-r--r--scripts/generator/generator.py34
2 files changed, 18 insertions, 18 deletions
diff --git a/scripts/database/database.py b/scripts/database/database.py
index 7f7f07e4..4ca184c5 100644
--- a/scripts/database/database.py
+++ b/scripts/database/database.py
@@ -310,7 +310,7 @@ defaults = CalculateDefaults(bests)
bests = ConcatenateData(bests, defaults)
# Outputs the data as a C++ database
-path_cpp_database = os.path.join(path_clblast, "include", "internal", "database")
+path_cpp_database = os.path.join(path_clblast, "src", "database", "kernels")
print("## Producing a C++ database in '"+path_cpp_database+"'...")
PrintData(bests, path_cpp_database)
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py
index 6726adda..cf01f79e 100644
--- a/scripts/generator/generator.py
+++ b/scripts/generator/generator.py
@@ -10,14 +10,14 @@
# This script automatically generates the bodies of the following files, creating the full CLBlast
# API interface and implementation (C, C++, and reference BLAS wrappers):
# clblast.h
-# clblast.cc
+# clblast.cpp
# clblast_c.h
-# clblast_c.cc
+# clblast_c.cpp
# wrapper_clblas.h
# wrapper_cblas.h
# It also generates the main functions for the correctness and performance tests as found in
-# test/correctness/routines/levelX/xYYYY.cc
-# test/performance/routines/levelX/xYYYY.cc
+# test/correctness/routines/levelX/xYYYY.cpp
+# test/performance/routines/levelX/xYYYY.cpp
# It also produces the API documentation found in doc/clblast.md
#
# ==================================================================================================
@@ -200,7 +200,7 @@ def clblast_h(routines):
result += routine.RoutineHeaderCPP(12, " = nullptr")+";\n"
return result
-# The C++ API implementation (.cc)
+# The C++ API implementation (.cpp)
def clblast_cc(routines):
result = ""
for routine in routines:
@@ -237,7 +237,7 @@ def clblast_c_h(routines):
result += routine.RoutineHeaderC(flavour, 31, " PUBLIC_API")+";\n"
return result
-# The C API implementation (.cc)
+# The C API implementation (.cpp)
def clblast_c_cc(routines):
result = ""
for routine in routines:
@@ -379,14 +379,14 @@ if len(sys.argv) != 2:
path_clblast = sys.argv[1]
files = [
path_clblast+"/include/clblast.h",
- path_clblast+"/src/clblast.cc",
+ path_clblast+"/src/clblast.cpp",
path_clblast+"/include/clblast_c.h",
- path_clblast+"/src/clblast_c.cc",
- path_clblast+"/test/wrapper_clblas.h",
- path_clblast+"/test/wrapper_cblas.h",
+ path_clblast+"/src/clblast_c.cpp",
+ path_clblast+"/test/wrapper_clblas.hpp",
+ path_clblast+"/test/wrapper_cblas.hpp",
]
header_lines = [84, 74, 93, 22, 29, 41]
-footer_lines = [17, 71, 19, 14, 6, 6]
+footer_lines = [17, 75, 19, 14, 6, 6]
# Checks whether the command-line arguments are valid; exists otherwise
for f in files:
@@ -433,11 +433,11 @@ for i in xrange(0,len(files)):
for level in [1,2,3,4]:
for routine in routines[level-1]:
if routine.has_tests:
- filename = path_clblast+"/test/correctness/routines/level"+levelnames[level-1]+"/x"+routine.name+".cc"
+ filename = path_clblast+"/test/correctness/routines/level"+levelnames[level-1]+"/x"+routine.name+".cpp"
with open(filename, "w") as f:
body = ""
- body += "#include \"correctness/testblas.h\"\n"
- body += "#include \"routines/level"+levelnames[level-1]+"/x"+routine.name+".h\"\n\n"
+ body += "#include \"test/correctness/testblas.hpp\"\n"
+ body += "#include \"test/routines/level"+levelnames[level-1]+"/x"+routine.name+".hpp\"\n\n"
body += "// Shortcuts to the clblast namespace\n"
body += "using float2 = clblast::float2;\n"
body += "using double2 = clblast::double2;\n\n"
@@ -459,11 +459,11 @@ for level in [1,2,3,4]:
for level in [1,2,3,4]:
for routine in routines[level-1]:
if routine.has_tests:
- filename = path_clblast+"/test/performance/routines/level"+levelnames[level-1]+"/x"+routine.name+".cc"
+ filename = path_clblast+"/test/performance/routines/level"+levelnames[level-1]+"/x"+routine.name+".cpp"
with open(filename, "w") as f:
body = ""
- body += "#include \"performance/client.h\"\n"
- body += "#include \"routines/level"+levelnames[level-1]+"/x"+routine.name+".h\"\n\n"
+ body += "#include \"test/performance/client.hpp\"\n"
+ body += "#include \"test/routines/level"+levelnames[level-1]+"/x"+routine.name+".hpp\"\n\n"
body += "// Shortcuts to the clblast namespace\n"
body += "using float2 = clblast::float2;\n"
body += "using double2 = clblast::double2;\n\n"