Skip to content

Commit 4d429f8

Browse files
remove unneeded functions
1 parent 326e164 commit 4d429f8

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

arraycontext/impl/cupy/__init__.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ def from_numpy(self,
9797
array: NumpyOrContainerOrScalar
9898
) -> ArrayOrContainerOrScalar:
9999
import cupy as cp
100-
101-
def _from_numpy(ary):
102-
return cp.array(ary)
103-
104100
return with_array_context(rec_map_array_container(cp.array, array),
105101
actx=self)
106102

@@ -116,10 +112,6 @@ def to_numpy(self,
116112
array: ArrayOrContainerOrScalar
117113
) -> NumpyOrContainerOrScalar:
118114
import cupy as cp
119-
120-
def _to_numpy(ary):
121-
return cp.asnumpy(ary)
122-
123115
return with_array_context(rec_map_array_container(cp.asnumpy, array),
124116
actx=None)
125117

@@ -134,28 +126,14 @@ def call_loopy(
134126

135127
def freeze(self, array):
136128
import cupy as cp
137-
138-
def _freeze(ary):
139-
return cp.asnumpy(ary)
140-
141-
return with_array_context(rec_map_array_container(_freeze, array), actx=None)
129+
return with_array_context(rec_map_array_container(cp.asnumpy, array), actx=None)
142130

143131
def thaw(self, array):
144132
import cupy as cp
145-
146-
def _thaw(ary):
147-
return cp.array(ary)
148-
149-
return with_array_context(rec_map_array_container(_thaw, array), actx=self)
133+
return with_array_context(rec_map_array_container(cp.array, array), actx=self)
150134

151135
# }}}
152136

153-
def transform_loopy_program(self, t_unit):
154-
raise NotImplementedError(
155-
"Calling loopy on CuPy arrays is not supported. Maybe rewrite"
156-
" the loopy kernel as numpy-flavored array operations using"
157-
" ArrayContext.np.")
158-
159137
def tag(self,
160138
tags: ToTagSetConvertible,
161139
array: ArrayOrContainerOrScalarT) -> ArrayOrContainerOrScalarT:

0 commit comments

Comments
 (0)