polish win bug

This commit is contained in:
Dun Liang 2022-05-20 14:34:54 +08:00
parent 643ca5bbb4
commit 91fe1fac85
3 changed files with 22 additions and 1 deletions

View File

@ -20,7 +20,7 @@ def install():
global has_acl, cc_flags
acl_compiler_home = os.path.dirname(__file__)
cc_files = sorted(glob.glob(acl_compiler_home+"/**/*.cc", recursive=True))
cc_flags += f" -DHAS_CUDA -DIS_ACL -I/usr/local/Ascend/runtime/include -I/usr/local/Ascend/driver/include -L/usr/local/Ascend/compiler/lib64 -L/usr/local/Ascend/runtime/lib64 -I{acl_compiler_home} -ltikc_runtime -lascendcl "
cc_flags += f" -DHAS_CUDA -DIS_ACL -I/usr/local/Ascend/latest/x86_64-linux/include/ -I/usr/local/Ascend/latest/x86_64-linux/include/acl -L/usr/local/Ascend/latest/x86_64-linux/lib64 -I/usr/local/Ascend/runtime/include -I/usr/local/Ascend/driver/include -L/usr/local/Ascend/compiler/lib64 -L/usr/local/Ascend/runtime/lib64 -I{acl_compiler_home} -ltikc_runtime -lascendcl "
ctypes.CDLL("libascendcl.so", dlopen_flags)
jittor_utils.LOG.i("ACL detected")

View File

@ -148,6 +148,12 @@ struct NanoVector {
for (auto a : v) push_back_check_overflow(a);
}
#ifdef __linux__
inline NanoVector(const vector<int64_t>& v) {
for (auto a : v) push_back_check_overflow((int64)a);
}
#endif
template<typename TMakeV>
inline static NanoVector make(const TMakeV* v, int n) {
NanoVector nv;

View File

@ -105,6 +105,21 @@ DEF_IS(int64, T) from_py_object(PyObject* obj) {
return PyLong_AsLongLong(obj);
}
#ifdef __linux__
// int64_t
DEF_IS(int64_t, bool) is_type(PyObject* obj) {
return PyLong_CheckExact(obj);
}
DEF_IS(int64_t, PyObject*) to_py_object(const T& a) {
return PyLong_FromLongLong(a);
}
DEF_IS(int64_t, T) from_py_object(PyObject* obj) {
return PyLong_AsLongLong(obj);
}
#endif
// float64
DEF_IS(float64, bool) is_type(PyObject* obj) {
return PyFloat_CheckExact(obj) || PyLong_CheckExact(obj);