gpu.c: extract_context: handle empty schedule domain
commita3e35ad58645d637eb7124420d71b15ecf732895
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 28 Mar 2015 10:12:00 +0000 (28 11:12 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 28 Mar 2015 10:17:52 +0000 (28 11:17 +0100)
tree9a288fed26a14189e3b57acf4c830e3ff3ea9117
parentee982fd430d064f943722aeeb23a6abeb69f60f9
gpu.c: extract_context: handle empty schedule domain

In the current transitionary state, kernels may get created that
may not get used in the end.  In particular, if the entire program
fragment is empty, then a kernel object will be created even though
it will not end up being used.  During the creation of this kernel,
extract_context will get called on a schedule with no domain elements,
resulting in a (harmless) error message since extract_context does
not take this possibility into account.
In the long run, only kernels that will actually be used will
be created.  In the mean time, make extract_context handle
empty schedule domains.

Reported-by: Michael Kruse <MichaelKruse@meinersbur.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
gpu.c