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

undefined reference to `getCacheSizeMlas(int, bool)' #11

Open
JuniperHugh opened this issue Aug 5, 2024 · 2 comments
Open

undefined reference to `getCacheSizeMlas(int, bool)' #11

JuniperHugh opened this issue Aug 5, 2024 · 2 comments

Comments

@JuniperHugh
Copy link

root@TRITON_ARMHC:/home/custom_ort/mlas/build# make -j 30
[ 96%] Built target mlas
[ 98%] Building CXX object examples/CMakeFiles/mlas_exams.dir/main.cpp.o
[100%] Linking CXX executable mlas_exams
/usr/bin/ld: ../libmlas.a(sgemm.cpp.o): in function getKStride()': sgemm.cpp:(.text+0x18): undefined reference to getCacheSizeMlas(int, bool)'
/usr/bin/ld: ../libmlas.a(sgemm.cpp.o): in function MlasGemmBatch(CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, unsigned long, unsigned long, unsigned long, MLAS_SGEMM_DATA_PARAMS const*, unsigned long, IMlasThreadPool*)': sgemm.cpp:(.text+0x2a18): undefined reference to getCacheSizeMlas(int, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/CMakeFiles/mlas_exams.dir/build.make:98: examples/mlas_exams] Error 1
make[1]: *** [CMakeFiles/Makefile2:126: examples/CMakeFiles/mlas_exams.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Can you provide the implementation of getCacheSizeMlas(int, bool) that cannot be found in the main branch?

@zhangYiIntel
Copy link
Collaborator

Hi @JuniperHugh This getCacheSizeMlas is a forward declaration in this MLAS fork, the actual implementation is defined at OpenVINO at https://github.com/openvinotoolkit/openvino/blob/master/src/plugins/intel_cpu/src/mlas/thread_pool.cpp.
We does this hack because the cahce_size vary from chip to chip, and we rely on OpenVINO's implementation.

A quick workaround maybe define a getCacheSizeMlas in your application, then link it to MLAS library.

@JuniperHugh
Copy link
Author

@zhangYiIntel Got it, thank you for your reply

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