summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-03-25 10:00:40 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2016-03-25 10:00:40 +0100
commit3876096c30ad4eed5769dbc88dbfe75b7571718a (patch)
treef902f2ee43df982152ada5d8d8d0573653cef58a /scripts
parent49822c8ead3313e88a08f31162870e88f8ad2bb5 (diff)
Added prototypes for SNRM2/DNRM2 routines
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generator/generator.py5
-rw-r--r--scripts/generator/routine.py14
2 files changed, 10 insertions, 9 deletions
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py
index 8ff5e130..2c22a6fd 100644
--- a/scripts/generator/generator.py
+++ b/scripts/generator/generator.py
@@ -61,6 +61,7 @@ routines = [
Routine(True, "1", "dot", T, [S,D], ["n"], [], ["x","y"], ["dot"], [], True, "Dot product of two vectors"),
Routine(True, "1", "dotu", T, [C,Z], ["n"], [], ["x","y"], ["dot"], [], True, "Dot product of two complex vectors"),
Routine(True, "1", "dotc", T, [C,Z], ["n"], [], ["x","y"], ["dot"], [], True, "Dot product of two complex vectors, one conjugated"),
+ Routine(False, "1", "nrm2", T, [S,D], ["n"], [], ["x"], ["nrm2"], [], True, "Euclidian norm of a vector"),
],
[ # Level 2: matrix-vector
Routine(True, "2a", "gemv", T, [S,D,C,Z], ["m","n"], ["layout","a_transpose"], ["a","x"], ["y"], ["alpha","beta"], False, "General matrix-vector multiplication"),
@@ -247,8 +248,8 @@ files = [
path_clblast+"/src/clblast_c.cc",
path_clblast+"/test/wrapper_clblas.h",
]
-header_lines = [84, 64, 88, 24, 22]
-footer_lines = [6, 3, 5, 2, 6]
+header_lines = [84, 64, 93, 22, 22]
+footer_lines = [6, 3, 9, 2, 6]
# Checks whether the command-line arguments are valid; exists otherwise
for f in files:
diff --git a/scripts/generator/routine.py b/scripts/generator/routine.py
index 60b9fcc5..ecfe6798 100644
--- a/scripts/generator/routine.py
+++ b/scripts/generator/routine.py
@@ -40,7 +40,7 @@ def OptionToWrapper(x):
}[x]
# Buffers without 'ld' or 'inc' parameter
-NO_LD_INC = ["dot","ap"]
+NO_LD_INC = ["dot","nrm2","ap"]
# ==================================================================================================
@@ -252,7 +252,7 @@ class Routine():
# Retrieves a combination of all the argument names, with Claduc casts
def ArgumentsCladuc(self, flavour, indent):
- return (self.Options() + self.Sizes() + self.BufferCladuc("dot") +
+ return (self.Options() + self.Sizes() + self.BufferCladuc("dot") + self.BufferCladuc("nrm2") +
self.Scalar("alpha") +
list(chain(*[self.BufferCladuc(b) for b in self.BuffersFirst()])) +
self.Scalar("beta") +
@@ -261,7 +261,7 @@ class Routine():
# Retrieves a combination of all the argument names, with CLBlast casts
def ArgumentsCast(self, flavour, indent):
- return (self.OptionsCast(indent) + self.Sizes() + self.Buffer("dot") +
+ return (self.OptionsCast(indent) + self.Sizes() + self.Buffer("dot") + self.Buffer("nrm2") +
self.ScalarUse("alpha", flavour) +
list(chain(*[self.Buffer(b) for b in self.BuffersFirst()])) +
self.ScalarUse("beta", flavour) +
@@ -270,7 +270,7 @@ class Routine():
# As above, but for the clBLAS wrapper
def ArgumentsWrapper(self, flavour):
- return (self.Options() + self.Sizes() + self.BufferWrapper("dot") +
+ return (self.Options() + self.Sizes() + self.BufferWrapper("dot") + self.BufferWrapper("nrm2") +
self.ScalarUseWrapper("alpha", flavour) +
list(chain(*[self.BufferWrapper(b) for b in self.BuffersFirst()])) +
self.ScalarUseWrapper("beta", flavour) +
@@ -279,7 +279,7 @@ class Routine():
# Retrieves a combination of all the argument definitions
def ArgumentsDef(self, flavour):
- return (self.OptionsDef() + self.SizesDef() + self.BufferDef("dot") +
+ return (self.OptionsDef() + self.SizesDef() + self.BufferDef("dot") + self.BufferDef("nrm2") +
self.ScalarDef("alpha", flavour) +
list(chain(*[self.BufferDef(b) for b in self.BuffersFirst()])) +
self.ScalarDef("beta", flavour) +
@@ -288,7 +288,7 @@ class Routine():
# As above, but clBLAS wrapper plain datatypes
def ArgumentsDefWrapper(self, flavour):
- return (self.OptionsDefWrapper() + self.SizesDef() + self.BufferDef("dot") +
+ return (self.OptionsDefWrapper() + self.SizesDef() + self.BufferDef("dot") + self.BufferDef("nrm2") +
self.ScalarDefPlain("alpha", flavour) +
list(chain(*[self.BufferDef(b) for b in self.BuffersFirst()])) +
self.ScalarDefPlain("beta", flavour) +
@@ -297,7 +297,7 @@ class Routine():
# Retrieves a combination of all the argument types
def ArgumentsType(self, flavour):
- return (self.OptionsType() + self.SizesType() + self.BufferType("dot") +
+ return (self.OptionsType() + self.SizesType() + self.BufferType("dot") + self.BufferType("nrm2") +
self.ScalarType("alpha", flavour) +
list(chain(*[self.BufferType(b) for b in self.BuffersFirst()])) +
self.ScalarType("beta", flavour) +