Skip to content
Snippets Groups Projects
Commit b19240e0 authored by Jean-Baptiste Keck's avatar Jean-Baptiste Keck
Browse files

fixed diffusion opencl cpu test

parent 86ee256e
No related branches found
No related tags found
1 merge request!3Resolve "Sine and cosine transforms to solve homogeneous Neumann and Dirichlet problems"
Pipeline #17204 passed
...@@ -68,13 +68,13 @@ python -c 'import hysop; print hysop' ...@@ -68,13 +68,13 @@ python -c 'import hysop; print hysop'
#python "$HYSOP_DIR/operator/tests/test_spectral_derivative.py" #python "$HYSOP_DIR/operator/tests/test_spectral_derivative.py"
#python "$HYSOP_DIR/operator/tests/test_spectral_curl.py" #python "$HYSOP_DIR/operator/tests/test_spectral_curl.py"
python "$HYSOP_DIR/operator/tests/test_diffusion.py" python "$HYSOP_DIR/operator/tests/test_diffusion.py"
#python "$HYSOP_DIR/operator/tests/test_poisson.py" python "$HYSOP_DIR/operator/tests/test_poisson.py"
#python "$HYSOP_DIR/operator/tests/test_solenoidal_projection.py" python "$HYSOP_DIR/operator/tests/test_solenoidal_projection.py"
#python "$HYSOP_DIR/operator/tests/test_poisson_curl.py" python "$HYSOP_DIR/operator/tests/test_poisson_curl.py"
# If scales (fortran advection library) is installed # If scales (fortran advection library) is installed
#python -c "from hysop.f2hysop import scales2py as scales" && python "$HYSOP_DIR/operator/tests/test_scales_advection.py" python -c "from hysop.f2hysop import scales2py as scales" && python "$HYSOP_DIR/operator/tests/test_scales_advection.py"
#python -c "from hysop.f2hysop import scales2py as scales" && python "$HYSOP_DIR/operator/tests/test_bilevel_advection.py" python -c "from hysop.f2hysop import scales2py as scales" && python "$HYSOP_DIR/operator/tests/test_bilevel_advection.py"
#export HYSOP_VERBOSE=1 #export HYSOP_VERBOSE=1
#EXAMPLE_DIR="$HYSOP_DIR/../examples" #EXAMPLE_DIR="$HYSOP_DIR/../examples"
......
...@@ -132,7 +132,7 @@ class TestDiffusionOperator(object): ...@@ -132,7 +132,7 @@ class TestDiffusionOperator(object):
sys.stdout.flush() sys.stdout.flush()
diff = Diffusion(cl_env=cl_env, **base_kwds) diff = Diffusion(cl_env=cl_env, **base_kwds)
yield diff.to_graph() yield diff.to_graph()
msg='\n *OpenCl FFTW: ' msg=' *OpenCl FFTW: '
print msg print msg
cpu_envs = tuple(iter_clenv(device_type='cpu')) cpu_envs = tuple(iter_clenv(device_type='cpu'))
if cpu_envs: if cpu_envs:
...@@ -140,7 +140,8 @@ class TestDiffusionOperator(object): ...@@ -140,7 +140,8 @@ class TestDiffusionOperator(object):
msg=' |platform {}, device {}'.format(cl_env.platform.name.strip(), msg=' |platform {}, device {}'.format(cl_env.platform.name.strip(),
cl_env.device.name.strip()) cl_env.device.name.strip())
print msg, print msg,
yield Diffusion(cl_env=cl_env, enforce_implementation=False, **base_kwds) diff = Diffusion(cl_env=cl_env, enforce_implementation=False, **base_kwds)
yield diff.to_graph()
else: else:
msg='Unknown implementation to test {}.'.format(impl) msg='Unknown implementation to test {}.'.format(impl)
raise NotImplementedError(msg) raise NotImplementedError(msg)
...@@ -260,7 +261,7 @@ class TestDiffusionOperator(object): ...@@ -260,7 +261,7 @@ class TestDiffusionOperator(object):
sys.stdout.write('\bx\n\n') sys.stdout.write('\bx\n\n')
sys.stdout.flush() sys.stdout.flush()
raise raise
print print
def test_diffusion_1D_inplace(self): def test_diffusion_1D_inplace(self):
......
...@@ -209,16 +209,16 @@ class TestSolenoidalProjectionOperator(object): ...@@ -209,16 +209,16 @@ class TestSolenoidalProjectionOperator(object):
print ' >Input analytic velocity:' print ' >Input analytic velocity:'
for (Ui,ui) in zip(U, analytic_solutions['Us']): for (Ui,ui) in zip(U, analytic_solutions['Us']):
print ' *{} = {}'.format(Ui.pretty_name, format_expr(ui)) print ' *{} = {}'.format(Ui.pretty_name, format_expr(ui))
print ' *div(U) = {}'.format(format_expr(analytic_solutions['divUs'][0])) print ' *div(U) = {}'.format(format_expr(analytic_solutions['divUs'][0]))
print ' >Expected velocity vector potential (solenoidal projection) is:' print ' >Expected velocity vector potential (solenoidal projection) is:'
for (Ui,ui) in zip(U0, analytic_solutions['U0s']): for (Ui,ui) in zip(U0, analytic_solutions['U0s']):
print ' *{} = {}'.format(Ui.pretty_name, format_expr(ui)) print ' *{} = {}'.format(Ui.pretty_name, format_expr(ui))
print ' *div(U0) = {}'.format(format_expr(analytic_solutions['divU0s'][0])) print ' *div(U0) = {}'.format(format_expr(analytic_solutions['divU0s'][0]))
print ' >Expected velocity scalar potential is:' print ' >Expected velocity scalar potential is:'
for (Ui,ui) in zip(U1, analytic_solutions['U1s']): for (Ui,ui) in zip(U1, analytic_solutions['U1s']):
print ' *{} = {}'.format(Ui.pretty_name, format_expr(ui)) print ' *{} = {}'.format(Ui.pretty_name, format_expr(ui))
print ' *div(U1) = {}'.format(format_expr(analytic_solutions['divU1s'][0])) print ' *div(U1) = {}'.format(format_expr(analytic_solutions['divU1s'][0]))
print ' >Testing all available implementations:' print ' >Testing all available implementations:'
implementations = SolenoidalProjection.implementations() implementations = SolenoidalProjection.implementations()
......
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