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

silence warnings #20

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/PyNucleus_base/blas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def uninitialized_like(like, **kwargs):
cpdef carray uninitializedINDEX(tuple shape):
cdef:
carray a = carray(shape, 4, 'i')
size_t s, i
Py_ssize_t s, i
IF FILL_UNINITIALIZED:
s = 1
for i in range(len(shape)):
Expand All @@ -54,7 +54,7 @@ cpdef carray uninitializedINDEX(tuple shape):
cpdef carray uninitializedREAL(tuple shape):
cdef:
carray a = carray(shape, 8, 'd')
size_t s, i
Py_ssize_t s, i
IF FILL_UNINITIALIZED:
s = 1
for i in range(len(shape)):
Expand Down
3 changes: 2 additions & 1 deletion base/PyNucleus_base/tupleDict.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ cdef class bitArray(indexSet):
cdef class bitArrayIterator(indexSetIterator):
cdef:
bitArray bA
INDEX_t k, n
INDEX_t k
size_t n
5 changes: 3 additions & 2 deletions base/PyNucleus_base/tupleDict.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ cdef class arrayIndexSetIterator(indexSetIterator):


cdef class bitArray(indexSet):
def __init__(self, INDEX_t hintMaxLength=1, INDEX_t maxElement=0):
def __init__(self, size_t hintMaxLength=1, INDEX_t maxElement=0):
self.length = max(hintMaxLength, maxElement/(sizeof(MEM_t)*8)+1)
self.a = <MEM_t *>malloc(self.length*sizeof(MEM_t))
for j in range(self.length):
Expand Down Expand Up @@ -562,7 +562,8 @@ cdef class bitArrayIterator(indexSetIterator):
cdef BOOL_t step(self):
cdef:
bitArray bA = self.iS
INDEX_t k0, n0, k, n
INDEX_t k0, k
size_t n0, n
MEM_t v

if self.n == sizeof(MEM_t)*8-1:
Expand Down
1 change: 1 addition & 0 deletions nl/PyNucleus_nl/nonlocalAssembly.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include "config.pxi"

from libc.math cimport sin, cos, M_PI as pi
from libcpp.map cimport map
from cpython.long cimport PyLong_FromSsize_t
from PyNucleus_base.myTypes import INDEX, REAL, COMPLEX, ENCODE, BOOL
from PyNucleus_base import uninitialized
from PyNucleus_base.intTuple cimport intTuple
Expand Down
2 changes: 1 addition & 1 deletion nl/PyNucleus_nl/nonlocalAssembly_{SCALAR}.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ cdef class {SCALAR_label}nonlocalBuilder:
self.contrib = uninitialized(((2*self.dm.dofs_per_element)*(2*self.dm.dofs_per_element+1)//2), dtype={SCALAR})
else:
self.contrib = uninitialized(((2*self.dm.dofs_per_element)**2), dtype={SCALAR})
assert self.contrib.shape[0] <= mask.size(), "Mask type size = {} is not large enough for {} entries. Please set a larger size and recompile.".format(mask.size(), self.contrib.shape[0])
assert self.contrib.shape[0] <= PyLong_FromSsize_t(mask.size()), "Mask type size = {} is not large enough for {} entries. Please set a larger size and recompile.".format(mask.size(), self.contrib.shape[0])

self.local_matrix.setMesh1(self.dm.mesh)
if self.dm2 is None:
Expand Down