Skip to content
Snippets Groups Projects
Commit b893cd23 authored by Kaushik Kulkarni's avatar Kaushik Kulkarni
Browse files

removes interfaces that have no-users

parent 0dc10bdb
No related branches found
No related tags found
No related merge requests found
......@@ -25,40 +25,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
from typing import Any
def _is_meshmode_dofarray(x: Any) -> bool:
try:
from meshmode.dof_array import DOFArray
except ImportError:
return False
else:
return isinstance(x, DOFArray)
def _is_pyopencl_array(x: Any) -> bool:
try:
import pyopencl.array as cla
except ImportError:
return False
else:
return isinstance(x, cla.Array)
def _flatten_cl_array(ary):
import pyopencl.array as cl
assert isinstance(ary, cl.Array)
if ary.size == 0:
# Work around https://github.com/inducer/pyopencl/pull/402
return ary._new_with_changes(
data=None, offset=0, shape=(0,), strides=(ary.dtype.itemsize,))
if ary.flags.f_contiguous:
return ary.reshape(-1, order="F")
elif ary.flags.c_contiguous:
return ary.reshape(-1, order="C")
else:
raise ValueError("cannot flatten array "
f"with strides {ary.strides} of {ary.dtype}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment