-
Notifications
You must be signed in to change notification settings - Fork 2.4k
make it compile on Windows + use ilp64 MKL #981
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
Conversation
elikosan
commented
Mar 22, 2017
- fix vector/avx Windows compile (missing _dllexport + AVX not defined on Windows)
- fix BLAS functions to operate on 64 bits __int64 (equiv. to long on linux) when compiling 64bit platform
- fix FindSSE.cmake so it does not crash on Windows (unitialized variable)
update my fork from master
# Conflicts: # lib/TH/generic/THBlas.c
update from master
lib/TH/vector/AVX.h
Outdated
@@ -2,22 +2,23 @@ | |||
#define TH_AVX_H | |||
|
|||
#include <stddef.h> | |||
#include "THGeneral.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AVX.h is included after THGeneral.h in file ./lib/TH/THVector.c. So there is no need to include THGeneral.h here.
lib/TH/vector/AVX.h
Outdated
void THFloatVector_muls_AVX(float *y, const float *x, const float c, const ptrdiff_t n); | ||
void THFloatVector_cadd_AVX(float *z, const float *x, const float *y, const float c, const ptrdiff_t n); | ||
void THFloatVector_adds_AVX(float *y, const float *x, const float c, const ptrdiff_t n); | ||
TH_API void THDoubleVector_copy_AVX(double *y, const double *x, const ptrdiff_t n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These apis are not supposed to be exported, but are used for specific implementations for different instructions internally. Please refer to lib/TH/generic/THVectorDispatch.c
lib/TH/vector/AVX.c
Outdated
@@ -1,4 +1,3 @@ | |||
#if defined(__AVX__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though it is harmless to remove the macro check for msvc, I think it can be kept because I am not sure the behavior of other platforms. Besides, this macro is the source I found that caused the compilation broken. #991
lib/TH/vector/AVX2.c
Outdated
@@ -1,4 +1,3 @@ | |||
#if defined(__AVX2__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as AVX.c
lib/TH/vector/AVX2.h
Outdated
@@ -2,8 +2,9 @@ | |||
#define TH_AVX2_H | |||
|
|||
#include <stddef.h> | |||
#include "THGeneral.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as AVX.h
I agree with BTNC reviews. Pull request #991 fixes the issues that i was having, thus i reverted the changes to avx.h,avx.c,avx2.h,avx2.c. |
thanks Eric! |
#ifdef WIN32 | ||
typedef __int64 BLINT; | ||
#else | ||
typedef long BLINT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this typedef is correct? It used to give sdot_
an int*
on non WIN32 platforms, now it uses long*
, but sizeof(long) != sizeof(int)
on most x86_64 systems. The same problem seems to be present in other parts of this PR too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.