Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/struphy/feec/psydac_derham.py
Original file line number Diff line number Diff line change
Expand Up @@ -2326,7 +2326,8 @@ def __init__(
if xp.get_backend() == "cupy" and np.any((degree < 1) | (degree > 8)):
raise ValueError("CUDA spline degrees must be between 1 and 8.")
pn = xp.asarray(degree)
knots = tuple(xp.ascontiguousarray(t, dtype=float) for t in derham.V0fem.knots)
# the knots are host arrays; cupy.ascontiguousarray does not take NumPy arrays, xp.asarray copies them
knots = tuple(xp.asarray(np.ascontiguousarray(t, dtype=float)) for t in derham.V0fem.knots)
starts = (self.starts,) if isinstance(self._vector_stencil, StencilVector) else self.starts
kinds = derham.spline_attributes[self.space_key].spline_types_pyccel
self._args_eval = tuple(
Expand Down
3 changes: 2 additions & 1 deletion src/struphy/pic/sorting.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import math
from typing import TYPE_CHECKING

import cunumpy as xp
Expand Down Expand Up @@ -226,7 +227,7 @@ def _set_boxes(self):
n_particles = self._markers_shape[0]
n_mkr = int(n_particles / n_box_in) + 1
n_cols = round(
n_mkr * (1 + 1 / xp.sqrt(n_mkr) + self._box_bufsize),
n_mkr * (1 + 1 / math.sqrt(n_mkr) + self._box_bufsize),
)

# cartesian boxes (extra last row stores holes/outside particles)
Expand Down
Loading