-
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
Changes from 35 commits
caf5a61
8fe85b5
c7fbe8f
8efe159
4d6ea12
62e51be
76cb36c
3bce1c8
be729d6
7d4a2e8
89ab8e4
933ff33
2118356
c8951bd
e4a8557
ba78c0f
8ed047a
980eb85
a87827f
3777373
8c7f188
211a321
281699f
d255c20
3ea6595
e6999a4
f896da1
b72d4d1
a05a3d9
1b94d52
97c39e5
ca226c4
42ec69f
db90eaa
259b222
48da138
0293729
3fb5afc
d3999bc
2777b04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ SET(AVX2_CODE " | |
|
||
int main() | ||
{ | ||
__m256i a; | ||
__m256i a = {0}; | ||
a = _mm256_abs_epi16(a); | ||
return 0; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#if defined(__AVX__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
#ifndef _MSC_VER | ||
#include <x86intrin.h> | ||
#else | ||
|
@@ -271,4 +270,3 @@ void THFloatVector_adds_AVX(float *y, const float *x, const float c, const ptrdi | |
} | ||
} | ||
|
||
#endif // defined(__AVX__) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,22 +2,23 @@ | |
#define TH_AVX_H | ||
|
||
#include <stddef.h> | ||
#include "THGeneral.h" | ||
|
||
|
||
void THDoubleVector_copy_AVX(double *y, const double *x, const ptrdiff_t n); | ||
void THDoubleVector_fill_AVX(double *x, const double c, const ptrdiff_t n); | ||
void THDoubleVector_cdiv_AVX(double *z, const double *x, const double *y, const ptrdiff_t n); | ||
void THDoubleVector_divs_AVX(double *y, const double *x, const double c, const ptrdiff_t n); | ||
void THDoubleVector_cmul_AVX(double *z, const double *x, const double *y, const ptrdiff_t n); | ||
void THDoubleVector_muls_AVX(double *y, const double *x, const double c, const ptrdiff_t n); | ||
void THDoubleVector_cadd_AVX(double *z, const double *x, const double *y, const double c, const ptrdiff_t n); | ||
void THDoubleVector_adds_AVX(double *y, const double *x, const double c, const ptrdiff_t n); | ||
void THFloatVector_copy_AVX(float *y, const float *x, const ptrdiff_t n); | ||
void THFloatVector_fill_AVX(float *x, const float c, const ptrdiff_t n); | ||
void THFloatVector_cdiv_AVX(float *z, const float *x, const float *y, const ptrdiff_t n); | ||
void THFloatVector_divs_AVX(float *y, const float *x, const float c, const ptrdiff_t n); | ||
void THFloatVector_cmul_AVX(float *z, const float *x, const float *y, const ptrdiff_t n); | ||
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); | ||
|
||
TH_API void THDoubleVector_fill_AVX(double *x, const double c, const ptrdiff_t n); | ||
TH_API void THDoubleVector_cdiv_AVX(double *z, const double *x, const double *y, const ptrdiff_t n); | ||
TH_API void THDoubleVector_divs_AVX(double *y, const double *x, const double c, const ptrdiff_t n); | ||
TH_API void THDoubleVector_cmul_AVX(double *z, const double *x, const double *y, const ptrdiff_t n); | ||
TH_API void THDoubleVector_muls_AVX(double *y, const double *x, const double c, const ptrdiff_t n); | ||
TH_API void THDoubleVector_cadd_AVX(double *z, const double *x, const double *y, const double c, const ptrdiff_t n); | ||
TH_API void THDoubleVector_adds_AVX(double *y, const double *x, const double c, const ptrdiff_t n); | ||
TH_API void THFloatVector_copy_AVX(float *y, const float *x, const ptrdiff_t n); | ||
TH_API void THFloatVector_fill_AVX(float *x, const float c, const ptrdiff_t n); | ||
TH_API void THFloatVector_cdiv_AVX(float *z, const float *x, const float *y, const ptrdiff_t n); | ||
TH_API void THFloatVector_divs_AVX(float *y, const float *x, const float c, const ptrdiff_t n); | ||
TH_API void THFloatVector_cmul_AVX(float *z, const float *x, const float *y, const ptrdiff_t n); | ||
TH_API void THFloatVector_muls_AVX(float *y, const float *x, const float c, const ptrdiff_t n); | ||
TH_API void THFloatVector_cadd_AVX(float *z, const float *x, const float *y, const float c, const ptrdiff_t n); | ||
TH_API void THFloatVector_adds_AVX(float *y, const float *x, const float c, const ptrdiff_t n); | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#if defined(__AVX2__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as AVX.c |
||
#ifndef _MSC_VER | ||
#include <x86intrin.h> | ||
#else | ||
|
@@ -43,5 +42,3 @@ void THFloatVector_cadd_AVX2(float *z, const float *x, const float *y, const flo | |
z[i] = x[i] + y[i] * c; | ||
} | ||
} | ||
|
||
#endif // defined(__AVX2__) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,9 @@ | |
#define TH_AVX2_H | ||
|
||
#include <stddef.h> | ||
#include "THGeneral.h" | ||
|
||
|
||
void THDoubleVector_cadd_AVX2(double *z, const double *x, const double *y, const double c, const ptrdiff_t n); | ||
void THFloatVector_cadd_AVX2(float *z, const float *x, const float *y, const float c, const ptrdiff_t n); | ||
TH_API void THDoubleVector_cadd_AVX2(double *z, const double *x, const double *y, const double c, const ptrdiff_t n); | ||
TH_API void THFloatVector_cadd_AVX2(float *z, const float *x, const float *y, const float c, const ptrdiff_t n); | ||
|
||
#endif |
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_
anint*
on non WIN32 platforms, now it useslong*
, butsizeof(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.
@elikosan