Skip to content

Commit

Permalink
do not fail on extruded meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Mar 17, 2020
1 parent 6b665db commit b72d95f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 14 additions & 5 deletions pyop2/gpu/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,21 @@ def _kernel_args_(self):

class Arg(Arg):
"""
Arg for GPU
Arg for GPU.
"""


class ExtrudedSet(ExtrudedSet):
"""
ExtrudedSet for GPU.
"""
@cached_property
def _kernel_args_(self):
m_gpu = cuda.mem_alloc(int(self.layers_array.nbytes))
cuda.memcpy_htod(m_gpu, self.layers_array)
return (m_gpu,)


class Dat(petsc_Dat):
"""
Dat for GPU.
Expand Down Expand Up @@ -373,11 +384,9 @@ def argtypes(self):
@cached_property
def argshapes(self):
argshapes = ((), ())
# argtypes += self._iterset._argtypes_
if self._iterset._argtypes_:
raise NotImplementedError("Do not know what to do when"
" self._iterset._argtypes is not empty, is this the case"
" when we have extruded mesh")
# TODO: verify that this bogus value doesn't affect anyone.
argshapes += ((), )

for arg in self._args:
argshapes += (arg.data.shape, )
Expand Down
4 changes: 3 additions & 1 deletion pyop2/gpu/snpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

def snpt_transform(kernel, block_size):
"""
SNPT := Single 'n' Per Thread transformation.
SNPT := Single 'n' Per Thread.
Implements outer-loop parallelization strategy.
PyOP2 uses 'n' as the outer loop iname. In Firedrake 'n' might denote
either a cell or a DOF.
Expand Down

0 comments on commit b72d95f

Please sign in to comment.