I work on a Macbook with Apple silicon, but most of my colleagues work on windows. If I run numba I get a type error for int32. This can be resolved by changing them to int64, but then my colleagues get an Type error for that.
What can I do so we can both work on the same code base?
@njit(types.int32[:, :], # needs to be int64 in macos
types.int32[:], # needs to be int64 in macos
types.float64[:, :],
types.int64[:, :],
types.int32[:], # needs to be int64 in macos
)
def stuff_for_numba(D, Nxd, X3_np, ind0_np, maxInd1):
pass
Great that you were able to solve the issue.
Would it be possible to use a global variable int_type within the function signatures, too?
Another option could be to provide a list of signatures to cover both systems.
What do you think?
import sys
import numpy as np
from numba import njit, types, typeof
# Determine the architecture for type compatibility
if sys.maxsize > np.iinfo(np.int32).max: # 64-bit system
int_type = types.int64
else: # 32-bit system
int_type = types.int32
# or let numba infer the type
int_type = typeof(1)
But obviously the current solution works better.
Very strange that it was an issue in the first place, obviously those intel machines also have an 64bit architecture.