mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-08 14:54:42 +00:00
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8 This adds the flag `-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL`. A future enhancement could possibly pass something different if there is a compelling parallel implementation. That libdispatch one might be worth looking into.
39 lines
1.1 KiB
C++
Vendored
39 lines
1.1 KiB
C++
Vendored
// -*- C++ -*-
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef _PSTL_PARALLEL_BACKEND_H
|
|
#define _PSTL_PARALLEL_BACKEND_H
|
|
|
|
#include <__config>
|
|
|
|
#if defined(_PSTL_PAR_BACKEND_SERIAL)
|
|
# include "parallel_backend_serial.h"
|
|
# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
|
|
namespace __pstl
|
|
{
|
|
namespace __par_backend = __serial_backend;
|
|
} // namespace __pstl
|
|
# endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
|
|
#elif defined(_PSTL_PAR_BACKEND_TBB)
|
|
# include "parallel_backend_tbb.h"
|
|
namespace __pstl
|
|
{
|
|
namespace __par_backend = __tbb_backend;
|
|
}
|
|
#elif defined(_PSTL_PAR_BACKEND_OPENMP)
|
|
# include "parallel_backend_omp.h"
|
|
namespace __pstl
|
|
{
|
|
namespace __par_backend = __omp_backend;
|
|
}
|
|
#else
|
|
# error "No backend set"
|
|
#endif
|
|
|
|
#endif /* _PSTL_PARALLEL_BACKEND_H */
|