Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

fix fp16 with msvc #333

Merged
merged 3 commits into from Apr 27, 2018
Merged

fix fp16 with msvc #333

merged 3 commits into from Apr 27, 2018

Conversation

yajiedesign
Copy link
Contributor

@yajiedesign yajiedesign commented Apr 13, 2018

msvc not inculde x86intrin.h and _cvtsh_ss

@szha
Copy link
Member

szha commented Apr 26, 2018

@rahul003

mshadow/half.h Outdated
@@ -10,7 +10,11 @@
#include "./base.h"

#if MSHADOW_USE_F16C
#include <x86intrin.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users also report that this breaks android build

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wont amalgamation test in mxnet ci test for this ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you point me to the issue for this if it exists?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android build should be using USE_F16C=0 as this feature wouldn't be supported for that hardware. Similar to how they need to turn off USE_SSE

mshadow/half.h Outdated
@@ -10,7 +10,11 @@
#include "./base.h"

#if MSHADOW_USE_F16C
#include <x86intrin.h>
#if defined(_MSC_VER)
#include <intrin.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You had mentioned in your PR description that msvc doesn't have intrin.h. If so why would we want to include this? Especially given that below _cvtsh_ss is turned off for MSVC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote it wrong. It's only "intrin.h", no "x86intrin.h""

Copy link
Member

@szha szha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for the clang related change. BTW was the problem isolated to OSX clang? Or were all related versions affected?

@yajiedesign
Copy link
Contributor Author

yajiedesign commented Apr 27, 2018

@szha now is only OSX.Maybe it should be changed to defined(__clang__)?

Copy link
Contributor

@rahul003 rahul003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@szha
Copy link
Member

szha commented Apr 27, 2018

@yajiedesign yes, it's probably a clang problem. https://reviews.llvm.org/D16177

@anirudh2290
Copy link

@piiswrong can this be merged ?

@piiswrong piiswrong merged commit e051c2c into dmlc:master Apr 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants