Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tackle many warnings #3898

Merged
merged 12 commits into from
Dec 5, 2024
Prev Previous commit
Next Next commit
Remove deprecated pymbolic function
connorjward committed Nov 29, 2024
commit 25e4e86b05a08ea3c5293546dfd5389bed155a98
18 changes: 9 additions & 9 deletions pyop2/types/dat.py
Original file line number Diff line number Diff line change
@@ -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,))]
@@ -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:
@@ -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))
Loading