diff --git a/stride/physics/iso_acoustic/devito.py b/stride/physics/iso_acoustic/devito.py index 89064ff6..68f30aea 100644 --- a/stride/physics/iso_acoustic/devito.py +++ b/stride/physics/iso_acoustic/devito.py @@ -271,7 +271,7 @@ async def before_forward(self, wavelets, vp, rho=None, alpha=None, **kwargs): diff_source = kwargs.pop('diff_source', False) save_compression = kwargs.get('save_compression', 'bitcomp' if self.space.dim > 2 else None) - save_compression = save_compression if 'nvidia' in platform and devito.pro_available else None + save_compression = save_compression if platform and 'nvidia' in platform and devito.pro_available else None # If there's no previous operator, generate one if self.state_operator.devito_operator is None: @@ -304,7 +304,7 @@ async def before_forward(self, wavelets, vp, rho=None, alpha=None, **kwargs): # Define the saving of the wavefield if save_wavefield is True: - layers = devito.HostDevice if 'nvidia' in platform else devito.NoLayers + layers = devito.HostDevice if platform and 'nvidia' in platform else devito.NoLayers p_saved = self.dev_grid.undersampled_time_function('p_saved', bounds=kwargs.pop('save_bounds', None), factor=self.undersampling_factor, @@ -336,7 +336,7 @@ async def before_forward(self, wavelets, vp, rho=None, alpha=None, **kwargs): else: # If the wavefield is lazily streamed, re-create every time - if 'nvidia' in platform and devito.pro_available: + if platform and 'nvidia' in platform and devito.pro_available: self.dev_grid.undersampled_time_function('p_saved', bounds=kwargs.pop('save_bounds', None), factor=self.undersampling_factor,