mirror of https://github.com/Jittor/Jittor
polish win bug
This commit is contained in:
parent
643ca5bbb4
commit
91fe1fac85
|
@ -20,7 +20,7 @@ def install():
|
||||||
global has_acl, cc_flags
|
global has_acl, cc_flags
|
||||||
acl_compiler_home = os.path.dirname(__file__)
|
acl_compiler_home = os.path.dirname(__file__)
|
||||||
cc_files = sorted(glob.glob(acl_compiler_home+"/**/*.cc", recursive=True))
|
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)
|
ctypes.CDLL("libascendcl.so", dlopen_flags)
|
||||||
jittor_utils.LOG.i("ACL detected")
|
jittor_utils.LOG.i("ACL detected")
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,12 @@ struct NanoVector {
|
||||||
for (auto a : v) push_back_check_overflow(a);
|
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>
|
template<typename TMakeV>
|
||||||
inline static NanoVector make(const TMakeV* v, int n) {
|
inline static NanoVector make(const TMakeV* v, int n) {
|
||||||
NanoVector nv;
|
NanoVector nv;
|
||||||
|
|
|
@ -105,6 +105,21 @@ DEF_IS(int64, T) from_py_object(PyObject* obj) {
|
||||||
return PyLong_AsLongLong(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
|
// float64
|
||||||
DEF_IS(float64, bool) is_type(PyObject* obj) {
|
DEF_IS(float64, bool) is_type(PyObject* obj) {
|
||||||
return PyFloat_CheckExact(obj) || PyLong_CheckExact(obj);
|
return PyFloat_CheckExact(obj) || PyLong_CheckExact(obj);
|
||||||
|
|
Loading…
Reference in New Issue