// Copyright 2019-2026, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto.  Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.

#ifndef _NVCOMPILER_EXECUTION_INCLUDED_
#define _NVCOMPILER_EXECUTION_INCLUDED_

#if __cplusplus < 201703L
  #error The header file "<execution>" requires at least C++17 mode
#endif

// stdpar implementation
#include <nvhpc/execution.hpp>

// stdexec implementation
#if _NVHPC_STDEXEC_ENABLED && __cplusplus >= 202002L
  #include <stdexec/execution.hpp>
  #ifndef __cpp_lib_counting_scope
    #define __cpp_lib_counting_scope 202506L
  #endif
  #ifndef __cpp_lib_parallel_scheduler
    #define __cpp_lib_parallel_scheduler 202506L
  #endif
  #ifndef __cpp_lib_senders
    #define __cpp_lib_senders 202506L
  #endif
  #ifndef __cpp_lib_task
    #define __cpp_lib_task 202506L
  #endif
#endif

#if defined(_NVCOMPILER_EXECUTION_HEADER_) && \
    !defined(__NVCOMPILER_PROCESSING_THRUST_INCLUDES)
  #if defined(_NVCOMPILER_ALGORITHM_HEADER_) && \
      !defined(_NVCOMPILER_ALGORITHM_EXECUTION_HEADER_)
    #include <nvhpc/algorithm_execution.hpp>
  #endif
  #if defined(_NVCOMPILER_NUMERIC_HEADER_) && \
      !defined(_NVCOMPILER_NUMERIC_EXECUTION_HEADER_)
    #include <nvhpc/numeric_execution.hpp>
  #endif
  #if defined(_NVCOMPILER_MEMORY_HEADER_) && \
      !defined(_NVCOMPILER_MEMORY_EXECUTION_HEADER_)
    #include <nvhpc/memory_execution.hpp>
  #endif
#endif

#endif
