Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pr-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- config: ArmPL RNG
domain: rng
test_options: -E 'Device|DEVICE'
- config: ArmPL DFT
domain: dft
name: unit tests ${{ matrix.config }} CPU
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ if(ENABLE_MKLGPU_BACKEND
OR ENABLE_MKLCPU_BACKEND
OR ENABLE_CUFFT_BACKEND
OR ENABLE_ROCFFT_BACKEND
OR ENABLE_PORTFFT_BACKEND)
OR ENABLE_PORTFFT_BACKEND
OR ENABLE_ARMPL_BACKEND)
list(APPEND DOMAINS_LIST "dft")
endif()
if(ENABLE_MKLCPU_BACKEND
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ Supported compilers include:
<td align="center">Dynamic, Static</td>
</tr>
<tr>
<td rowspan=9 align="center">DFT</td>
<td rowspan=10 align="center">DFT</td>
<td rowspan=2 align="center">x86 CPU</td>
<td align="center">Intel(R) oneMKL</td>
<td align="center">Intel DPC++</td>
Expand All @@ -341,6 +341,12 @@ Supported compilers include:
<td align="center">Intel DPC++</td>
<td align="center">Dynamic, Static</td>
</tr>
<tr>
<td align="center">aarch64 CPU</td>
<td align="center">Arm Performance Libraries</td>
<td align="center">Open DPC++</br>AdaptiveCpp</td>
<td align="center">Dynamic, Static</td>
</tr>
<tr>
<td rowspan=2 align="center">Intel GPU</td>
<td align="center">Intel(R) oneMKL</td>
Expand Down
6 changes: 6 additions & 0 deletions include/oneapi/math/detail/backends_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ static std::map<domain, std::map<device, std::vector<const char*>>> libraries =
#endif
#ifdef ONEMATH_ENABLE_PORTFFT_BACKEND
LIB_NAME("dft_portfft")
#endif
} },
{ device::aarch64cpu,
{
#ifdef ONEMATH_ENABLE_ARMPL_BACKEND
LIB_NAME("dft_armpl"),
#endif
} },
{ device::intelgpu,
Expand Down
38 changes: 38 additions & 0 deletions include/oneapi/math/dft/detail/armpl/onemath_dft_armpl.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*******************************************************************************
* Copyright 2025 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
*******************************************************************************/

#ifndef _ONEMATH_DFT_ARMPL_HPP_
#define _ONEMATH_DFT_ARMPL_HPP_

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#else
#include <CL/sycl.hpp>
#endif

#include "oneapi/math/detail/export.hpp"
#include "oneapi/math/dft/detail/types_impl.hpp"

namespace oneapi::math::dft::armpl {

#include "oneapi/math/dft/detail/dft_ct.hxx"

} // namespace oneapi::math::dft::armpl

#endif // _ONEMATH_DFT_ARMPL_HPP_
4 changes: 4 additions & 0 deletions include/oneapi/math/dft/detail/descriptor_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class descriptor {
void commit(backend_selector<backend::portfft> selector);
#endif

#ifdef ONEMATH_ENABLE_ARMPL_BACKEND
void commit(backend_selector<backend::armpl> selector);
#endif

const dft_values<prec, dom>& get_values() const noexcept {
return values_;
}
Expand Down
5 changes: 5 additions & 0 deletions src/dft/backends/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ endif()
if(ENABLE_PORTFFT_BACKEND)
add_subdirectory(portfft)
endif()

if(ENABLE_ARMPL_BACKEND)
add_subdirectory(armpl)
endif()

85 changes: 85 additions & 0 deletions src/dft/backends/armpl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#===============================================================================
# Copyright 2025 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
#===============================================================================

set(LIB_NAME onemath_dft_armpl)
set(LIB_OBJ ${LIB_NAME}_obj)

include(WarningsUtils)

# Add third-party library
find_package(ARMPL REQUIRED)

add_library(${LIB_NAME})
add_deprecated_library(${LIB_NAME})
add_library(${LIB_OBJ} OBJECT
descriptor.cpp
commit.cpp
forward.cpp
backward.cpp
$<$<BOOL:${BUILD_SHARED_LIBS}>: armpl_wrappers.cpp>
)
add_dependencies(onemath_backend_libs_dft ${LIB_NAME})

target_include_directories(${LIB_OBJ}
PUBLIC ${ONEMATH_INCLUDE_DIRS}
PRIVATE ${PROJECT_SOURCE_DIR}/src/include
${PROJECT_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/bin
${ARMPL_INCLUDE}
${ONEMATH_GENERATED_INCLUDE_PATH}
)

target_compile_options(${LIB_OBJ} PRIVATE ${ONEMATH_BUILD_COPT} ${ARMPL_COPT})
if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
add_sycl_to_target(TARGET ${LIB_OBJ} SOURCES ${SOURCES})
endif()

target_link_libraries(${LIB_OBJ}
PUBLIC ONEMATH::SYCL::SYCL ${ARMPL_LINK}
PRIVATE onemath_warnings
)

set_target_properties(${LIB_OBJ} PROPERTIES
POSITION_INDEPENDENT_CODE ON
)
target_link_libraries(${LIB_NAME} PRIVATE ${LIB_OBJ})
target_include_directories(${LIB_NAME} PUBLIC ${ONEMATH_INCLUDE_DIRS})

#Set oneMath libraries as not transitive for dynamic
if(BUILD_SHARED_LIBS)
set_target_properties(${LIB_NAME} PROPERTIES
INTERFACE_LINK_LIBRARIES ONEMATH::SYCL::SYCL
)
endif()

# Add major version to the library
set_target_properties(${LIB_NAME} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
)

# Add dependencies rpath to the library
list(APPEND CMAKE_BUILD_RPATH $<TARGET_FILE_DIR:${LIB_NAME}>)

# Add the library to install package
install(TARGETS ${LIB_OBJ} EXPORT oneMathTargets)
install(TARGETS ${LIB_NAME} EXPORT oneMathTargets
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
58 changes: 58 additions & 0 deletions src/dft/backends/armpl/armpl_helpers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*******************************************************************************
* Copyright 2025 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
*******************************************************************************/

#ifndef _ONEMATH_DFT_SRC_ARMPL_HELPERS_HPP_
#define _ONEMATH_DFT_SRC_ARMPL_HELPERS_HPP_

#include "oneapi/math/exceptions.hpp"
#include "oneapi/math/dft/detail/types_impl.hpp"

#include "fftw3.h"

namespace oneapi::math::dft::armpl::detail {

template <typename K, typename H, typename F>
static inline auto host_task_internal(H& cgh, F f, int) -> decltype(cgh.host_task(f)) {
return cgh.host_task(f);
}

template <typename K, typename H, typename F>
static inline void host_task_internal([[maybe_unused]] H& cgh, [[maybe_unused]] F f, long) {
#ifndef __SYCL_DEVICE_ONLY__
cgh.template single_task<K>(f);
#endif
}

template <typename K, typename H, typename F>
static inline void host_task(H& cgh, F f) {
(void)host_task_internal<K>(cgh, f, 0);
}

template <typename Desc>
class kernel_name {};

template <typename AccType>
typename AccType::value_type* acc_to_ptr(AccType acc) {
// no need to decorate the pointer with the address space for armpl since its just getting passed to the a host function.
return acc.template get_multi_ptr<sycl::access::decorated::no>().get();
}

} // namespace oneapi::math::dft::armpl::detail

#endif // _ONEMATH_DFT_SRC_ARMPL_HELPERS_HPP_
29 changes: 29 additions & 0 deletions src/dft/backends/armpl/armpl_wrappers.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright 2025 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 "oneapi/math/dft/detail/armpl/onemath_dft_armpl.hpp"
#include "dft/function_table.hpp"

#define WRAPPER_VERSION 1
#define BACKEND armpl

extern "C" dft_function_table_t onemath_dft_table = {
WRAPPER_VERSION,
#include "dft/backends/backend_wrappers.cxx"
};
Loading
Loading