Skip to content

Commit 81afc0e

Browse files
authored
Import Updates
1 parent 876b6aa commit 81afc0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/pywarpx/particle_containers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ def get_particle_boundary_buffer(self, species_name, boundary, comp_name, level)
575575
level : int
576576
Which AMR level to retrieve scraped particle data from.
577577
'''
578+
xp, cupy_status = load_cupy()
579+
578580
part_container = self.particle_buffer.get_particle_container(
579581
species_name, self._get_boundary_number(boundary)
580582
)
@@ -584,14 +586,14 @@ def get_particle_boundary_buffer(self, species_name, boundary, comp_name, level)
584586
comp_idx = part_container.num_int_comps() - 1
585587
for ii, pti in enumerate(libwarpx.libwarpx_so.BoundaryBufferParIter(part_container, level)):
586588
soa = pti.soa()
587-
data_array.append(cnp.array(soa.GetIntData(comp_idx), copy=False))
589+
data_array.append(xp.array(soa.GetIntData(comp_idx), copy=False))
588590
else:
589591
mypc = libwarpx.warpx.multi_particle_container()
590592
sim_part_container_wrapper = mypc.get_particle_container_from_name(species_name)
591593
comp_idx = sim_part_container_wrapper.get_comp_index(comp_name)
592594
for ii, pti in enumerate(libwarpx.libwarpx_so.BoundaryBufferParIter(part_container, level)):
593595
soa = pti.soa()
594-
data_array.append(cnp.array(soa.GetRealData(comp_idx), copy=False))
596+
data_array.append(xp.array(soa.GetRealData(comp_idx), copy=False))
595597

596598
return data_array
597599

0 commit comments

Comments
 (0)