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

Add implementation of WhereAmI() to support NO_AFFINITY=0 on ARM64 #4648

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

martin-frbg
Copy link
Collaborator

fixes #4623

@martin-frbg martin-frbg added this to the 0.3.28 milestone Apr 15, 2024
@martin-frbg martin-frbg merged commit c57f932 into OpenMathLib:develop Apr 17, 2024
59 of 69 checks passed
@NickelWenzel
Copy link
Contributor

NickelWenzel commented Oct 9, 2024

@martin-frbg this change might have broken windows arm64 builds, see the failed azure pipelines in this PR which prevents from bumping the version to 0.3.28 in the vcpkg port.

At least that is what i see in the attached log.

Change Dir: 'D:/b/openblas/arm64-windows-dbg'

Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -v -v -j33 install
[1/1740] C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\arm64\cl.exe    -ID:\b\openblas\src\v0.3.28-8b4f07f037.clean -ID:\b\openblas\arm64-windows-dbg /nologo /DWIN32 /D_WINDOWS /utf-8 /MP   -DGEMM_GEMV_FORWARD -DNO_LAPACK -DNO_LAPACKE -DNO_WARMUP -DMAX_CPU_NUMBER=0 -DMAX_PARALLEL_NUMBER=1 -DNO_AFFINITY -DVERSION="\"0.3.28\"" -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16 /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 /showIncludes /Fointerface\CMakeFiles\interface.dir\CMakeFiles\cnrm2.c.obj /Fdinterface\CMakeFiles\interface.dir\ /FS -c D:\b\openblas\arm64-windows-dbg\interface\CMakeFiles\cnrm2.c
FAILED: interface/CMakeFiles/interface.dir/CMakeFiles/cnrm2.c.obj 
C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\arm64\cl.exe    -ID:\b\openblas\src\v0.3.28-8b4f07f037.clean -ID:\b\openblas\arm64-windows-dbg /nologo /DWIN32 /D_WINDOWS /utf-8 /MP   -DGEMM_GEMV_FORWARD -DNO_LAPACK -DNO_LAPACKE -DNO_WARMUP -DMAX_CPU_NUMBER=0 -DMAX_PARALLEL_NUMBER=1 -DNO_AFFINITY -DVERSION="\"0.3.28\"" -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16 /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 /showIncludes /Fointerface\CMakeFiles\interface.dir\CMakeFiles\cnrm2.c.obj /Fdinterface\CMakeFiles\interface.dir\ /FS -c D:\b\openblas\arm64-windows-dbg\interface\CMakeFiles\cnrm2.c
D:\b\openblas\src\v0.3.28-8b4f07f037.clean\common_arm64.h(60): error C2065: '__asm__': undeclared identifier
D:\b\openblas\src\v0.3.28-8b4f07f037.clean\common_arm64.h(60): error C2143: syntax error: missing ';' before 'volatile'
[2/1740] C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\arm64\cl.exe    -ID:\b\openblas\src\v0.3.28-8b4f07f037.clean -ID:\b\openblas\arm64-windows-dbg /nologo /DWIN32 /D_WINDOWS /utf-8 /MP   -DGEMM_GEMV_FORWARD -DNO_LAPACK -DNO_LAPACKE -DNO_WARMUP -DMAX_CPU_NUMBER=0 -DMAX_PARALLEL_NUMBER=1 -DNO_AFFINITY -DVERSION="\"0.3.28\"" -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16 /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 /showIncludes /Fointerface\CMakeFiles\interface.dir\CMakeFiles\sasum.c.obj /Fdinterface\CMakeFiles\interface.dir\ /FS -c D:\b\openblas\arm64-windows-dbg\interface\CMakeFiles\sasum.c
FAILED: interface/CMakeFiles/interface.dir/CMakeFiles/sasum.c.obj 

install-arm64-windows-dbg-out.log
install-arm64-uwp-dbg-out.log

@JAicewizard FYI

@martin-frbg
Copy link
Collaborator Author

Ah, that addition probably needs to be conditional on #ifndef MSVC as Visual Studio does not handle the inline assembly (nor its GNU/AT&T-style syntax). Unfortunately I do not have WoA hardware so I have no idea if there are further obstacles to expect

@NickelWenzel
Copy link
Contributor

The canonical way looking at the other common_xxx.h headers seems to be to surround WhereAmI by #ifndef NO_AFFINITY.

I opened a PR for this. Feel free to have a look and as this is my first contribution (to open source ever) don't hesitate if I didn't set sth up correctly.

@JAicewizard
Copy link
Contributor

Oh yeah I still had that PR open, I had no idea how to debug the faillure. Thanks for noticing the issue and being able to diagnose it!

@martin-frbg
Copy link
Collaborator Author

martin-frbg commented Oct 9, 2024

That's slightly different - when "NO_AFFINITY" is not set, the WhereAmI() function is simply not needed. In your case, it is that particular compiler that does not like the way WhereAmI() is implemented (e.g. LLVM would probably compile it without complaining) - but cpu affinity handling is not implemented in the Windows version of the blas_server code anyway, so in practice either ifndef should work.

@martin-frbg
Copy link
Collaborator Author

C_MSVC actually - sorry. Now hopefully fixed in PR #4927

@martin-frbg
Copy link
Collaborator Author

@NickelWenzel sorry, had not realized that you opened the PR against OpenBLAS rather than the vpkpg port. Let's go with your version of the fix then.

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.

Build fails on Ubuntu 20.04 aarch64 with undefined reference to 'WhereAmI'
3 participants