aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-11-06 21:32:26 +0100
committerAdrian Kummerlaender2019-11-06 21:32:26 +0100
commit7253ffa4b7755e211ffde2bed25652477ea33e5d (patch)
tree3063f235104eeddb86f51183f7cee8cb163dd6f4
parent814e6253475c7955eb6a46d814e5a86974e58613 (diff)
downloadboltzgen-7253ffa4b7755e211ffde2bed25652477ea33e5d.tar
boltzgen-7253ffa4b7755e211ffde2bed25652477ea33e5d.tar.gz
boltzgen-7253ffa4b7755e211ffde2bed25652477ea33e5d.tar.bz2
boltzgen-7253ffa4b7755e211ffde2bed25652477ea33e5d.tar.xz
boltzgen-7253ffa4b7755e211ffde2bed25652477ea33e5d.zip
Check whether template for requested streaming pattern exists
-rw-r--r--boltzgen/kernel/generator.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/boltzgen/kernel/generator.py b/boltzgen/kernel/generator.py
index ee5bf8b..6a02e2d 100644
--- a/boltzgen/kernel/generator.py
+++ b/boltzgen/kernel/generator.py
@@ -15,6 +15,11 @@ class Generator:
self.descriptor = self.model.descriptor
self.target = target
self.float_type = eval("memory.precision.%s" % target).get_float_type(precision)
+ self.streaming = streaming
+
+ pattern_path = Path(__file__).parent/("template/pattern/%s.%s.mako" % (self.streaming, self.target))
+ if not pattern_path.exists():
+ raise Exception("Target '%s' doesn't provide streaming pattern '%s'" % (self.target, self.streaming))
try:
self.index_impl = eval("memory.index.%s" % index)
@@ -26,8 +31,6 @@ class Generator:
except AttributeError:
raise Exception("There is no layout '%s'" % layout) from None
- self.streaming = streaming
-
def instantiate(self, template, geometry, extras = []):
template_path = Path(__file__).parent/("template/%s.%s.mako" % (template, self.target))
if not template_path.exists():