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

Visual C++ TH\vector\AVX2.c(60): error C2440: 'function': cannot convert from 'int' to '__m256' #4531

Closed
N-Dekker opened this issue Jan 8, 2018 · 2 comments

Comments

@N-Dekker
Copy link

N-Dekker commented Jan 8, 2018

Visual C++ 2015 (64-bits) produces the following messages (both for Debug and Release) at the master branch (current commit: c9bc6c2):

AVX2.c
...\src\TH\vector\AVX2.c(60): warning C4013: 'log256_ps' undefined; assuming extern returning int
...\src\TH\vector\AVX2.c(60): error C2440: 'function': cannot convert from 'int' to '__m256'
...\src\TH\vector\AVX2.c(60): warning C4024: '_mm256_mul_ps': different types for formal and actual parameter 2
...\src\TH\vector\AVX2.c(64): warning C4013: 'sincos256_ps' undefined; assuming extern returning int
...\src\TH\vector\AVX2.c(80): warning C4305: 'function': truncation from 'double' to 'float'

Does anyone of of you have a clue what goes wrong?

See

const __m256 radius = _mm256_sqrt_ps(_mm256_mul_ps(*minus_two, log256_ps(u1)));

@N-Dekker
Copy link
Author

N-Dekker commented Jan 9, 2018

The problem is that the function definitions from https://github.com/pytorch/pytorch/blob/c9bc6c2bc3af1308cff72c95eda55a1b7eff293c/aten/src/TH/vector/avx_mathfun.h are not available ("undefined") to my Visual C++ build. Because for my build, USE_AVX2 is not defined. Which seems to be because FIND_PACKAGE(SSE) did not find AVX2 on my machine (C_AVX2_FOUND does not evaluate to true). See:

FIND_PACKAGE(SSE) # checks SSE, AVX and AVX2

Any suggested fix is still welcome!

@ezyang
Copy link
Contributor

ezyang commented Jul 16, 2020

I'm going to guess that this has been fixed.

@ezyang ezyang closed this as completed Jul 16, 2020
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

No branches or pull requests

2 participants