Skip to content
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

Windows - VS2015 Compile error - 'conversion from 'double' to 'float' requires a narrowing conversion' #1329

Merged
merged 1 commit into from
Jun 24, 2018

Conversation

rajh619
Copy link
Contributor

@rajh619 rajh619 commented Jun 24, 2018

Compiling of TVM fails in Windows 10 - VS 2015 environment .
Reason : conversion error from float to double . This seems to be a compiler bug and we have to explicitly add "f" suffix to float values during uniform intialization .
ref: https://stackoverflow.com/a/47913325/3814804

Build Error Log :


5>C:\TVM\v0_3_a1\tvm\nnvm\include\nnvm/top/nn.h(350): warning C4305: 'argument': truncation from 'double' to 'const float' (compiling source file C:\TVM\v0_3_a1\tvm\nnvm\src\top\vision\yolo2\reorg.cc)
5>C:\TVM\v0_3_a1\tvm\nnvm\include\nnvm/top/nn.h(352): error C2398: Element '1': conversion from 'double' to 'float' requires a narrowing conversion (compiling source file C:\TVM\v0_3_a1\tvm\nnvm\src\top\vision\yolo2\reorg.cc)
5>C:\TVM\v0_3_a1\tvm\nnvm\include\nnvm/top/nn.h(352): error C2398: Element '2': conversion from 'double' to 'float' requires a narrowing conversion (compiling source file C:\TVM\v0_3_a1\tvm\nnvm\src\top\vision\yolo2\reorg.cc)
5>C:\TVM\v0_3_a1\tvm\nnvm\include\nnvm/top/nn.h(352): error C2398: Element '3': conversion from 'double' to 'float' requires a narrowing conversion (compiling source file C:\TVM\v0_3_a1\tvm\nnvm\src\top\vision\yolo2\reorg.cc)
5>C:\TVM\v0_3_a1\tvm\nnvm\include\nnvm/top/nn.h(352): error C2398: Element '4': conversion from 'double' to 'float' requires a narrowing conversion (compiling source file C:\TVM\v0_3_a1\tvm\nnvm\src\top\vision\yolo2\reorg.cc)
5>C:\TVM\v0_3_a1\tvm\nnvm\include\nnvm/top/nn.h(352): warning C4305: 'initializing': truncation from 'double' to 'float' (compiling source file C:\TVM\v0_3_a1\tvm\nnvm\src\top\vision\yolo2\reorg.cc)
7>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
7>  Building Custom Rule C:/TVM/v0_3_a1/tvm/CMakeLists.txt
7>  CMake does not need to re-run because C:/TVM/v0_3_a1/tvm/build/CMakeFiles/generate.stamp is up-to-date.
8>------ Skipped Build: Project: INSTALL, Configuration: Release x64 ------
8>Project not selected to build for this solution configuration 
========== Build: 5 succeeded, 1 failed, 0 up-to-date, 2 skipped ==========

Note: i have added the suffix'f' only on L352 as it was breaking the Build.
Awaiting for feedback .
Thanks

…equires a narrowing conversion'

Compiling of TVM fails in Windows 10 - VS 2015 environment .
Reason : conversion error from float to double .  This seems to be a compiler bug and we have to explicitly add "f" suffix to float values during uniform intialization .
ref: https://stackoverflow.com/a/47913325/3814804
@tqchen tqchen merged commit f3dbee8 into apache:master Jun 24, 2018
tqchen pushed a commit to tqchen/tvm that referenced this pull request Jul 6, 2018
mnuyens pushed a commit to mnuyens/tvm that referenced this pull request Jul 10, 2018
sergei-mironov pushed a commit to sergei-mironov/tvm that referenced this pull request Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants