From 4deca8907d90271d27eff320405edc1db3299b5c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr> Date: Wed, 27 Sep 2017 21:28:44 +0200 Subject: [PATCH] fixed operators when fftw is not present --- examples/scalar_advection/scalar_advection.py | 7 ++++--- hysop/fields/cartesian_discrete_field.py | 11 +++++------ hysop/operator/directional/advection_dir.py | 4 ++-- hysop/operator/transpose.py | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/scalar_advection/scalar_advection.py b/examples/scalar_advection/scalar_advection.py index 1adad6e41..f5f710bda 100644 --- a/examples/scalar_advection/scalar_advection.py +++ b/examples/scalar_advection/scalar_advection.py @@ -4,7 +4,7 @@ from hysop import IO, IOParams, Field, Box, \ from hysop.deps import np from hysop.constants import AutotunerFlags, Implementation -from hysop.operators import DirectionalAdvection +from hysop.operator.directional.advection_dir import DirectionalAdvection from hysop.methods import StrangOrder, Remesh, TimeIntegrator, \ OpenClKernelConfig, OpenClKernelAutotunerConfig @@ -34,8 +34,9 @@ def run(npts=64+1, cfl=0.5): dim = 3 d3d=(npts,)*dim box = Box(length=(2*pi,)*dim) - - impl = Implementation.PYTHON#OPENCL_CODEGEN + + # impl = Implementation.PYTHON + impl = Implementation.OPENCL_CODEGEN if impl is Implementation.OPENCL_CODEGEN: autotuner_config = OpenClKernelAutotunerConfig( diff --git a/hysop/fields/cartesian_discrete_field.py b/hysop/fields/cartesian_discrete_field.py index 22dc78ead..76f0e213b 100644 --- a/hysop/fields/cartesian_discrete_field.py +++ b/hysop/fields/cartesian_discrete_field.py @@ -689,13 +689,12 @@ class CartesianDiscreteField(CartesianDiscreteFieldView, DiscreteField): super(CartesianDiscreteField, self).__init__(field=field, topology=topology, topology_state=init_state, dfield=self, **kwds) - msg='\nAllocation of field {} ({}) on backend {}' - msg+='\n (compute_res={}, ghosts={}, nb_comp={}, dtype={})' - msg=msg.format(self.name, self.tag, self.backend.kind, - self.compute_resolution, self.ghosts, self.nb_components, self.dtype) - vprint(msg) - if allocate_data: + msg='\nAllocation of field {} ({}) on backend {}' + msg+='\n (compute_res={}, ghosts={}, nb_comp={}, dtype={})' + msg=msg.format(self.name, self.tag, self.backend.kind, + self.compute_resolution, self.ghosts, self.nb_components, self.dtype) + vprint(msg) data = tuple(self.backend.empty(shape=self.shape, dtype=self.dtype) for _ in xrange(self.nb_components)) self._handle_data(data) diff --git a/hysop/operator/directional/advection_dir.py b/hysop/operator/directional/advection_dir.py index b50c98e59..b1ad1b25b 100644 --- a/hysop/operator/directional/advection_dir.py +++ b/hysop/operator/directional/advection_dir.py @@ -25,8 +25,8 @@ class DirectionalAdvection(DirectionalOperatorFrontend): @classmethod def implementations(cls): - from hysop.backend.host.host_operators import PythonDirectionalAdvection - from hysop.backend.device.device_operators import OpenClDirectionalAdvection + from hysop.backend.host.python.operator.directional.advection_dir import PythonDirectionalAdvection + from hysop.backend.device.opencl.operator.directional.advection_dir import OpenClDirectionalAdvection _implementations = { Implementation.PYTHON: PythonDirectionalAdvection, Implementation.OPENCL_CODEGEN: OpenClDirectionalAdvection diff --git a/hysop/operator/transpose.py b/hysop/operator/transpose.py index da69a2f48..f4e3af6ab 100644 --- a/hysop/operator/transpose.py +++ b/hysop/operator/transpose.py @@ -39,8 +39,8 @@ class Transpose(ComputationalGraphNodeGenerator): @classmethod def implementations(cls): - from hysop.backend.host.host_operators import PythonTranspose - from hysop.backend.device.device_operators import OpenClTranspose + from hysop.backend.host.python.operator.transpose import PythonTranspose + from hysop.backend.device.opencl.operator.transpose import OpenClTranspose _implementations = { Implementation.PYTHON: PythonTranspose, Implementation.OPENCL_CODEGEN: OpenClTranspose -- GitLab