Skip to content
Snippets Groups Projects
Commit ce708719 authored by Timothy A. Smith's avatar Timothy A. Smith
Browse files

move with_root_kernel to kernel_fixtures, possibly breaks skipped tests

parent 8aa2cf58
No related branches found
No related tags found
1 merge request!8Test refactoring
...@@ -58,18 +58,6 @@ def get_gpu_transformed_weno(): ...@@ -58,18 +58,6 @@ def get_gpu_transformed_weno():
def with_root_kernel(prg, root_name):
# FIXME This is a little less beautiful than it could be
new_prg = prg.copy(name=root_name)
for name in prg:
clbl = new_prg[name]
if isinstance(clbl, lp.LoopKernel) and clbl.is_called_from_host:
new_prg = new_prg.with_kernel(clbl.copy(is_called_from_host=False))
new_prg = new_prg.with_kernel(prg[root_name].copy(is_called_from_host=True))
return new_prg
def get_weno_program(): def get_weno_program():
if _WENO_PRG: if _WENO_PRG:
return _WENO_PRG[0] return _WENO_PRG[0]
......
...@@ -5,10 +5,22 @@ import loopy as lp # noqa ...@@ -5,10 +5,22 @@ import loopy as lp # noqa
import fixtures import fixtures
def with_root_kernel(prg, root_name):
# FIXME This is a little less beautiful than it could be
new_prg = prg.copy(name=root_name)
for name in prg:
clbl = new_prg[name]
if isinstance(clbl, lp.LoopKernel) and clbl.is_called_from_host:
new_prg = new_prg.with_kernel(clbl.copy(is_called_from_host=False))
new_prg = new_prg.with_kernel(prg[root_name].copy(is_called_from_host=True))
return new_prg
def mult_mat_vec(queue, prg, alpha, a, b): def mult_mat_vec(queue, prg, alpha, a, b):
c_dev = cl.array.empty(queue, 10, dtype=np.float32) c_dev = cl.array.empty(queue, 10, dtype=np.float32)
prg = fixtures.with_root_kernel(prg, "mult_mat_vec") prg = with_root_kernel(prg, "mult_mat_vec")
prg(queue, a=a, b=b, c=c_dev, alpha=alpha) prg(queue, a=a, b=b, c=c_dev, alpha=alpha)
return c_dev.get() return c_dev.get()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment