// -*- C++ -*-
//===-- algorithm ---------------------------------------------------------===//
//
// Copyright (C) Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// This file incorporates work covered by the following copyright and permission
// notice:
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//

#ifndef _ONEDPL_experimental_algorithm
#define _ONEDPL_experimental_algorithm

#define __cpp_lib_experimental_parallel_for_loop 201711

// Workarounds for libstdc++9, libstdc++10 when new TBB version is found in the environment
#if __cplusplus >= 201703L
#    if __has_include(<tbb/version.h>)
#        ifndef PSTL_USE_PARALLEL_POLICIES
#            define PSTL_USE_PARALLEL_POLICIES (_GLIBCXX_RELEASE != 9)
#        endif
#        ifndef _GLIBCXX_USE_TBB_PAR_BACKEND
#            define _GLIBCXX_USE_TBB_PAR_BACKEND (_GLIBCXX_RELEASE > 10)
#        endif
#    endif // __has_include(<tbb/version.h>)
#endif     // __cplusplus >= 201703L

// ATTENTION!!! Include the header from the C++ standard library before the oneDPL config header to see whether the _PSTL_VERSION macro is defined
#include <algorithm>

#include "internal/reduction.h"
#include "internal/induction.h"
#include "internal/for_loop.h"

namespace dpl = oneapi::dpl;

namespace std
{
namespace experimental
{
using oneapi::dpl::experimental::for_loop;
using oneapi::dpl::experimental::for_loop_n;
using oneapi::dpl::experimental::for_loop_n_strided;
using oneapi::dpl::experimental::for_loop_strided;
using oneapi::dpl::experimental::induction;
using oneapi::dpl::experimental::reduction;
using oneapi::dpl::experimental::reduction_bit_and;
using oneapi::dpl::experimental::reduction_bit_or;
using oneapi::dpl::experimental::reduction_bit_xor;
using oneapi::dpl::experimental::reduction_max;
using oneapi::dpl::experimental::reduction_min;
using oneapi::dpl::experimental::reduction_multiplies;
using oneapi::dpl::experimental::reduction_plus;
} // namespace experimental
} // namespace std

#endif /* _ONEDPL_experimental_algorithm */
