Skip to content

[SYCL][COMPLEX] Split complex header file and tests into multiple files #11600

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 3 commits into from
Oct 30, 2023
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
16 changes: 16 additions & 0 deletions sycl/include/sycl/ext/oneapi/experimental/complex/complex.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===- complex.hpp --------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#pragma once

#ifdef SYCL_EXT_ONEAPI_COMPLEX

#include "./detail/complex.hpp"
#include "./detail/complex_math.hpp"

#endif // SYCL_EXT_ONEAPI_COMPLEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//===- common.hpp ---------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#pragma once

#include <type_traits>

#include <sycl/half_type.hpp>

namespace sycl {
inline namespace _V1 {

namespace ext {
namespace oneapi {
namespace experimental {

////////////////////////////////////////////////////////////////////////////////
/// FORWARD DECLARATIONS
////////////////////////////////////////////////////////////////////////////////

template <class _Tp> struct is_genfloat;

template <class _Tp, class _Enable = void> class complex;

template <class _Tp>
class complex<_Tp, typename std::enable_if_t<is_genfloat<_Tp>::value>>;

////////////////////////////////////////////////////////////////////////////////
/// TRAITS
////////////////////////////////////////////////////////////////////////////////

template <class _Tp>
struct is_genfloat
: std::integral_constant<bool, std::is_same_v<_Tp, double> ||
std::is_same_v<_Tp, float> ||
std::is_same_v<_Tp, sycl::half>> {};

template <class _Tp>
struct is_gencomplex
: std::integral_constant<bool,
std::is_same_v<_Tp, complex<double>> ||
std::is_same_v<_Tp, complex<float>> ||
std::is_same_v<_Tp, complex<sycl::half>>> {};

////////////////////////////////////////////////////////////////////////////////
/// DEFINES
////////////////////////////////////////////////////////////////////////////////

#define _SYCL_EXT_CPLX_INLINE_VISIBILITY \
inline __attribute__((__visibility__("hidden"), __always_inline__))

} // namespace experimental
} // namespace oneapi
} // namespace ext

} // namespace _V1
} // namespace sycl
Loading