|
| template<typename Policy> |
| const Policy * | getBackendExecutionPolicy (const AbstractBackendExecutionPolicy &p) noexcept |
| template<typename Policy> |
| CheckedBackendExecutionPolicy< Policy > | checkBackendExecutionPolicy (const AbstractBackendExecutionPolicy *const p, const bool has_statistics) noexcept |
| MFRONT_VISIBILITY_EXPORT void | declareExecutionPolicyOption (tfel::utilities::DataMapValidator &) |
| | declare the execution_policy option of the backends based on the parallel algorithms of the standard library
|
| MFRONT_VISIBILITY_EXPORT std::string | getExecutionPolicy (const tfel::utilities::DataMap &) |
| MFRONT_VISIBILITY_EXPORT void | declareDeviceStackSizeOption (tfel::utilities::DataMapValidator &) |
| | declare the device_stack_size option, which gives the minimal stack size, in bytes, of the threads of the device
|
| MFRONT_VISIBILITY_EXPORT int | getDeviceStackSize (const tfel::utilities::DataMap &) |
| MFRONT_VISIBILITY_EXPORT void | declareDataTransferPolicyOption (tfel::utilities::DataMapValidator &) |
| | declare the data_transfer_policy option of the SYCL backends
|
| MFRONT_VISIBILITY_EXPORT bool | areDataTransfersAutomatic (const tfel::utilities::DataMap &) |
| TFEL_HOST_DEVICE constexpr atomic_size_type | toOrderedKey (const double v) noexcept |
| template<typename Atomics, typename Statistics, typename real> |
| TFEL_HOST_DEVICE void | updateStatistics (Statistics &s, const BatchStatistics< real > &r, const atomic_size_type rdt0) |
| | update the statistics shared by the threads with the statistics of a point or of a group of points, by atomic operations. The shared statistics are only accessed if an event occurred: a failure, an unreliable result, or a time step scaling factor lower than the initial one.
|
| template<typename OutputStatus> |
| int | report (OutputStatus &s, const int status, const std::string_view msg) noexcept |
| | set the status and the error message of an output status
|
| template<typename OutputStatus, typename Initialize, typename Function> |
| int | handleExceptions (OutputStatus *const s, const Initialize &initialize, Function &&f) noexcept |
| | call the body of a generated function of batches, so that no exception goes through its C interface: an exception is reported as an error of the backend (status -7). The output status is initialized before the call, and errno is restored on return: it may be modified by the runtimes of the backends and by the computations on the host.
|
| CUDABackendExecutionPolicy | makeCUDABackendExecutionPolicy (const CUDABackendExecutionOptions &opts={}) noexcept |
| std::mutex & | getStackSizeMutex () noexcept |
| bool | setMinimalCUDAStackSize (const std::size_t stack_size, const bool preserve=false) noexcept |
| | increase the stack size of the threads of the current CUDA device, if the CUDA runtime is loaded by the process. Otherwise, nothing is done. A loaded CUDA runtime does not mean that the computations are performed on an NVIDIA GPU: the primitives of the stlpar and sycl backends only call this function when the computations are offloaded to a GPU (nvc++ -stdpar=gpu, sycl queue running on a GPU).
|
| HIPBackendExecutionPolicy | makeHIPBackendExecutionPolicy (const HIPBackendExecutionOptions &opts={}) noexcept |
| constexpr const char * | getNVHPCOffloadMemorySpace () noexcept |
| constexpr const char * | getParallelSTLMemorySpace () noexcept |
| ParallelSTLBackendExecutionPolicy | makeParallelSTLBackendExecutionPolicy (const BackendExecutionCommonPolicy &opts={}) noexcept |
| TFEL_HOST_DEVICE constexpr atomic_size_type | makeKey (const atomic_size_type i, const atomic_size_type c) noexcept |
| TFEL_HOST_DEVICE constexpr atomic_size_type | getPointIndex (const atomic_size_type k) noexcept |
| TFEL_HOST_DEVICE constexpr atomic_size_type | getCheck (const atomic_size_type k) noexcept |
| SyclBackendExecutionPolicy | makeSyclBackendExecutionPolicy (const ::sycl::queue &q, const BackendExecutionCommonPolicy &opts={}) |
|
| template<typename Statistics> |
| constexpr bool | hasTimeStepScalingFactor |
| | true if the statistics updated by the devices hold a time step scaling factor, false otherwise, which is the case of the statistics of the material properties
|
| constexpr const char * | stack_size_error_message |
| | error message associated with setMinimalCUDAStackSize
|
|
constexpr const char * | host_memory_space = "host" |
| | the computations are performed on the host: the fields must be accessible by the host (ordinary or shared memory)
|
|
constexpr const char * | device_memory_space = "device" |
| | the computations are performed on a device, which may not access the ordinary memory of the host: the fields must be accessible by the device (memory of the device or shared memory). The library can't assume that the device accesses the ordinary memory of the host, even if the device is a CPU (sycl backend without data transfers).
|
|
constexpr const char * | any_memory_space = "any" |
| | the fields may be located anywhere (for instance, the fields which are not accessible by the device are copied)
|
|
constexpr atomic_size_type | no_event = ~atomic_size_type{0} |
| | value of a key meaning that no event occurred
|
|
constexpr unsigned int | check_bits = 16 |
| | number of bits of the identifier of a check in a key. The other bits hold the index of the point.
|
| constexpr atomic_size_type | maximal_number_of_checks |
| | maximal number of checks
|
| constexpr atomic_size_type | maximal_number_of_points |
| | maximal number of points of a batch
|
The primitives of the backends (apply, see for instance MFront/GenericParallel/ParallelSTL.hxx) apply a function at the points of a batch. This function returns the statistics of a point (BatchStatistics). The primitives combine them, by atomic operations or by reductions, and report the result through a handler of the statistics given by the interface (mfront::gpmp::StatisticsHandler for the material properties), which provides:
- the type OutputStatus of the output status and the type Statistics of the statistics updated by the devices and given by the calling code (C structures of the interface);
- initial(): the statistics of a batch without event, neutral element of the reductions;
- hasEvents(): false if the function applied at the points never reports an event, in which case the statistics are neither combined nor reported;
- initialize(Statistics&): initialization of the statistics updated by the devices;
- report(OutputStatus&, const Statistics&): report of the statistics updated by the devices, once the computations are completed;
- report(OutputStatus&, Statistics*, const BatchStatistics&): report of the statistics combined by a reduction, or accumulation of those statistics in the statistics given by the calling code, if any.
| bool mfront::generic_parallel::setMinimalCUDAStackSize |
( |
const std::size_t | stack_size, |
|
|
const bool | preserve = false ) |
|
inlinenoexcept |
increase the stack size of the threads of the current CUDA device, if the CUDA runtime is loaded by the process. Otherwise, nothing is done. A loaded CUDA runtime does not mean that the computations are performed on an NVIDIA GPU: the primitives of the stlpar and sycl backends only call this function when the computations are offloaded to a GPU (nvc++ -stdpar=gpu, sycl queue running on a GPU).
Some parallel programming models execute the computations on NVIDIA GPUs through the CUDA runtime but give no access to the stack size of the threads: the C++ standard parallelism with nvc++ -stdpar=gpu and SYCL with AdaptiveCpp. The default stack size (1024 bytes) and the automatic increase performed by the CUDA driver at kernel launch, which does not take into account the internal routines of the compilers (such as the division of double precision numbers), are not sufficient for some kernels.
The CUDA runtime is looked up among the loaded libraries, whatever its version, so that this function does not require the CUDA headers nor the CUDA runtime. Nothing is done on systems other than Linux.
- Returns
- true on success, false if the stack size could not be set or is too small and must be preserved
- Parameters
-
| [in] | stack_size | minimal stack size, in bytes |
| [in] | preserve | if true, the stack size is only checked |