Skip to content

Commit 728fa4a

Browse files
remove mf_to_cupy and mf_to_dpnp
Signed-off-by: Roelof Groenewald <[email protected]>
1 parent 13f68c9 commit 728fa4a

File tree

1 file changed

+0
-83
lines changed

1 file changed

+0
-83
lines changed

src/amrex/extensions/MultiFab.py

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -63,86 +63,6 @@ def mf_to_numpy(self, copy=False, order="F"):
6363
return views
6464

6565

66-
def mf_to_cupy(self, copy=False, order="F"):
67-
"""
68-
Provide a CuPy view into a MultiFab.
69-
70-
This includes ngrow guard cells of each box.
71-
72-
Note on the order of indices:
73-
By default, this is as in AMReX in Fortran contiguous order, indexing as
74-
x,y,z. This has performance implications for use in external libraries such
75-
as cupy.
76-
The order="C" option will index as z,y,x and perform better with cupy.
77-
https://github.com/AMReX-Codes/pyamrex/issues/55#issuecomment-1579610074
78-
79-
Parameters
80-
----------
81-
self : amrex.MultiFab
82-
A MultiFab class in pyAMReX
83-
copy : bool, optional
84-
Copy the data if true, otherwise create a view (default).
85-
order : string, optional
86-
F order (default) or C. C is faster with external libraries.
87-
88-
Returns
89-
-------
90-
list of cupy.array
91-
A list of CuPy n-dimensional arrays, for each local block in the
92-
MultiFab.
93-
94-
Raises
95-
------
96-
ImportError
97-
Raises an exception if cupy is not installed
98-
"""
99-
views = []
100-
for mfi in self:
101-
views.append(self.array(mfi).to_cupy(copy, order))
102-
103-
return views
104-
105-
106-
def mf_to_dpnp(self, copy=False, order="F"):
107-
"""
108-
Provide a dpnp view into a MultiFab.
109-
110-
This includes ngrow guard cells of each box.
111-
112-
Note on the order of indices:
113-
By default, this is as in AMReX in Fortran contiguous order, indexing as
114-
x,y,z. This has performance implications for use in external libraries such
115-
as cupy.
116-
The order="C" option will index as z,y,x and perform may better.
117-
https://github.com/AMReX-Codes/pyamrex/issues/55#issuecomment-1579610074
118-
119-
Parameters
120-
----------
121-
self : amrex.MultiFab
122-
A MultiFab class in pyAMReX
123-
copy : bool, optional
124-
Copy the data if true, otherwise create a view (default).
125-
order : string, optional
126-
F order (default) or C. C is faster with external libraries.
127-
128-
Returns
129-
-------
130-
list of dpnp.array
131-
A list of dpnp n-dimensional arrays, for each local block in the
132-
MultiFab.
133-
134-
Raises
135-
------
136-
ImportError
137-
Raises an exception if dpnp is not installed
138-
"""
139-
views = []
140-
for mfi in self:
141-
views.append(self.array(mfi).to_dpnp(copy, order))
142-
143-
return views
144-
145-
14666
def mf_to_xp(self, copy=False, order="F"):
14767
"""
14868
Provide a NumPy, CuPy or dpnp view into a MultiFab,
@@ -701,8 +621,6 @@ def register_MultiFab_extension(amr):
701621
amr.MultiFab.__iter__ = lambda mfab: amr.MFIter(mfab)
702622

703623
amr.MultiFab.to_numpy = mf_to_numpy
704-
amr.MultiFab.to_cupy = mf_to_cupy
705-
amr.MultiFab.to_dpnp = mf_to_dpnp
706624
amr.MultiFab.to_xp = mf_to_xp
707625

708626
amr.MultiFab.copy = lambda self: copy_multifab(amr, self)
@@ -718,7 +636,6 @@ def register_MultiFab_extension(amr):
718636
amr.iMultiFab.__iter__ = lambda imfab: amr.MFIter(imfab)
719637

720638
amr.iMultiFab.to_numpy = mf_to_numpy
721-
amr.iMultiFab.to_cupy = mf_to_cupy
722639
amr.iMultiFab.to_xp = mf_to_xp
723640

724641
amr.iMultiFab.copy = lambda self: copy_multifab(amr, self)

0 commit comments

Comments
 (0)