Skip to content

Commit

Permalink
Remove deprecated pymbolic function
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjward committed Nov 29, 2024
1 parent 8bfb94d commit 25e4e86
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pyop2/types/dat.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,14 @@ def _op_kernel(self, op, globalp, dtype):
_self = p.Variable("self")
_ret = p.Variable("ret")
i = p.Variable("i")
lhs = _ret.index(i)
lhs = _ret[i]
if globalp:
rhs = _other.index(0)
rhs = _other[0]
rshape = (1, )
else:
rhs = _other.index(i)
rhs = _other[i]
rshape = (self.cdim, )
insn = lp.Assignment(lhs, op(_self.index(i), rhs), within_inames=frozenset(["i"]))
insn = lp.Assignment(lhs, op(_self[i], rhs), within_inames=frozenset(["i"]))
data = [lp.GlobalArg("self", dtype=self.dtype, shape=(self.cdim,)),
lp.GlobalArg("other", dtype=dtype, shape=rshape),
lp.GlobalArg("ret", dtype=self.dtype, shape=(self.cdim,))]
Expand Down Expand Up @@ -405,15 +405,15 @@ def _iop_kernel(self, op, globalp, other_is_self, dtype):
_other = p.Variable("other")
_self = p.Variable("self")
i = p.Variable("i")
lhs = _self.index(i)
lhs = _self[i]
rshape = (self.cdim, )
if globalp:
rhs = _other.index(0)
rhs = _other[0]
rshape = (1, )
elif other_is_self:
rhs = _self.index(i)
rhs = _self[i]
else:
rhs = _other.index(i)
rhs = _other[i]
insn = lp.Assignment(lhs, op(lhs, rhs), within_inames=frozenset(["i"]))
data = [lp.GlobalArg("self", dtype=self.dtype, shape=(self.cdim,))]
if not other_is_self:
Expand Down Expand Up @@ -518,7 +518,7 @@ def _neg_kernel(self):
lvalue = p.Variable("other")
rvalue = p.Variable("self")
i = p.Variable("i")
insn = lp.Assignment(lvalue.index(i), -rvalue.index(i), within_inames=frozenset(["i"]))
insn = lp.Assignment(lvalue[i], -rvalue[i], within_inames=frozenset(["i"]))
data = [lp.GlobalArg("other", dtype=self.dtype, shape=(self.cdim,)),
lp.GlobalArg("self", dtype=self.dtype, shape=(self.cdim,))]
knl = lp.make_function([domain], [insn], data, name=name, target=conf.target, lang_version=(2018, 2))
Expand Down

0 comments on commit 25e4e86

Please sign in to comment.