-
Notifications
You must be signed in to change notification settings - Fork 176
[BLAS] Add BLAS ARM performance libraries backend. #629
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fb44dd7
Add BLAS ARM performance libraries backend.
adegomme 5b8f932
armpl blas - fix english in doc and remove spurious comment
adegomme b629cd9
change compiler name in README to match project policy
adegomme fd3fae3
armpl - adapt CMakeLists to match PR #627 proposed changes
adegomme ae62b28
remove mistake in README
adegomme b5f876a
clang-format some more files
adegomme 80dff18
fixe tables alignment in README
adegomme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| #=============================================================================== | ||
| # Copyright 2022 SiPearl | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions | ||
| # and limitations under the License. | ||
| # | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| #=============================================================================== | ||
|
|
||
| include_guard() | ||
| set(ARMPL_SEQ armpl_intp64) | ||
| set(ARMPL_OMP armpl_int64_mp) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| if(ENABLE_ARMPL_OMP) | ||
| message(STATUS "Use OpenMP version of ArmPL") | ||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp") | ||
| find_library(ARMPL_LIBRARY NAMES ${ARMPL_OMP} HINTS ${ARMPL_ROOT} $ENV{ARMPLROOT} PATH_SUFFIXES lib lib64) | ||
| else() | ||
| message(STATUS "Use Sequential version of ArmPL") | ||
| find_library(ARMPL_LIBRARY NAMES ${ARMPL_SEQ} HINTS ${ARMPL_ROOT} $ENV{ARMPLROOT} PATH_SUFFIXES lib lib64) | ||
| endif() | ||
| find_package_handle_standard_args(ARMPL REQUIRED_VARS ARMPL_LIBRARY) | ||
|
|
||
| get_filename_component(ARMPL_LIB_DIR ${ARMPL_LIBRARY} DIRECTORY) | ||
| find_path(ARMPL_INCLUDE armpl.h HINTS ${ARMPL_ROOT} $ENV{ARMPLROOT} PATH_SUFFIXES include) | ||
| #cmake replaces fullpath to libarmpl by -larmpl (because SONAME is absent) and -Wl,-rpath is not enough for some compilers as hint | ||
| #so we need to add -L to compiler, otherwise we need to set LIBRARY_PATH manually when building | ||
| if(UNIX) | ||
| list(APPEND ARMPL_LINK "-Wl,-rpath,${ARMPL_LIB_DIR} -L${ARMPL_LIB_DIR}") | ||
| endif() | ||
| list(APPEND ARMPL_LINK ${ARMPL_LIBRARY}) | ||
| list(APPEND ARMPL_LINK ${ARMPL_LIBRARY}) | ||
| message(${ARMPL_LINK}) | ||
| find_package_handle_standard_args(ARMPL REQUIRED_VARS ARMPL_INCLUDE ARMPL_LINK) | ||
|
|
||
| # Check ARMPL version (only versions higher or equal to 22.0.1 are supported) | ||
| set(ARMPL_MAJOR 22) | ||
| set(ARMPL_MINOR 0) | ||
| set(ARMPL_BUILD 1) | ||
| file(WRITE ${CMAKE_BINARY_DIR}/armplversion.cpp | ||
| "#include <stdio.h>\n" | ||
| "\n" | ||
| "#include \"armpl.h\"\n" | ||
| "\n" | ||
| "int main(void) {\n" | ||
| " int major, minor, build;\n" | ||
| " char *tag;\n" | ||
| " armplversion(&major, &minor, &build, (const char **)&tag);\n" | ||
| " if (major > MAJOR) {\n" | ||
| " return 0;\n" | ||
| " }\n" | ||
| " else if (major == MAJOR && minor > MINOR) {\n" | ||
| " return 0;\n" | ||
| " }\n" | ||
| " else if (major == MAJOR && minor == MINOR && build >= BUILD) {\n" | ||
| " return 0;\n" | ||
| " }\n" | ||
| " printf(\"You are using version %d.%d.%d\\n\", major, minor, build);\n" | ||
| " return 1;\n" | ||
| "}\n") | ||
| execute_process(COMMAND ${CMAKE_CXX_COMPILER} armplversion.cpp -O0 -I${ARMPL_INCLUDE} -Wl,-rpath,${ARMPL_LIB_DIR} -larmpl -DMAJOR=${ARMPL_MAJOR} -DMINOR=${ARMPL_MINOR} -DBUILD=${ARMPL_BUILD} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
| execute_process(COMMAND ./a.out WORKING_DIRECTORY ${CMAKE_BINARY_DIR} RESULT_VARIABLE ARMPL_CHECK_VERSION) | ||
| execute_process(COMMAND rm ./a.out WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
| execute_process(COMMAND rm armplversion.cpp WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
| if(ARMPL_CHECK_VERSION) | ||
| message(FATAL_ERROR "ARMPL backend does not support ARMPL version prior to version ${ARMPL_MAJOR}.${ARMPL_MINOR}.${ARMPL_BUILD}") | ||
| endif() | ||
|
|
||
| add_library(ONEMKL::ARMPL::ARMPL UNKNOWN IMPORTED) | ||
| set_target_properties(ONEMKL::ARMPL::ARMPL PROPERTIES IMPORTED_LOCATION ${ARMPL_LIBRARY}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /******************************************************************************* | ||
| * Copyright 2025 SiPearl | ||
| * Copyright 2020-2021 Intel Corporation | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions | ||
| * and limitations under the License. | ||
| * | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| *******************************************************************************/ | ||
|
|
||
| #ifndef _DETAIL_ARMPL_BLAS_CT_HPP__ | ||
| #define _DETAIL_ARMPL_BLAS_CT_HPP__ | ||
|
|
||
| #if __has_include(<sycl/sycl.hpp>) | ||
| #include <sycl/sycl.hpp> | ||
| #else | ||
| #include <CL/sycl.hpp> | ||
| #endif | ||
| #include <complex> | ||
| #include <cstdint> | ||
|
|
||
| #include "oneapi/math/types.hpp" | ||
| #include "oneapi/math/detail/backend_selector.hpp" | ||
|
|
||
| #include "oneapi/math/blas/detail/blas_ct_backends.hpp" | ||
| #include "oneapi/math/blas/detail/armpl/onemath_blas_armpl.hpp" | ||
|
|
||
| namespace oneapi { | ||
| namespace math { | ||
| namespace blas { | ||
| namespace column_major { | ||
|
|
||
| #define MAJOR column_major | ||
| #include "blas_ct.hxx" | ||
| #undef MAJOR | ||
|
|
||
| } //namespace column_major | ||
| namespace row_major { | ||
|
|
||
| #define MAJOR row_major | ||
| #include "blas_ct.hxx" | ||
| #undef MAJOR | ||
|
|
||
| } //namespace row_major | ||
| } //namespace blas | ||
| } //namespace math | ||
| } //namespace oneapi | ||
|
|
||
| #endif //_DETAIL_ARMPL_BLAS_CT_HPP_ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.