Template Numerical Library version\ main:8246197
Loading...
Searching...
No Matches
TNL::Algorithms::Segments::LaunchConfiguration Struct Reference

Launch configuration for segment operations. More...

#include <TNL/Algorithms/Segments/LaunchConfiguration.h>

Inheritance diagram for TNL::Algorithms::Segments::LaunchConfiguration:
[legend]
Collaboration diagram for TNL::Algorithms::Segments::LaunchConfiguration:
[legend]

Public Member Functions

 LaunchConfiguration ()=default
 Constructs a configuration with the Default mapping.
 LaunchConfiguration (ThreadsToSegmentsMapping threadsToSegmentsMapping, int threadsPerSegmentCount, int blockSize=1)
 Constructs a configuration with the given mapping and threads per segment count.
const Backend::LaunchConfiguration & getBackendLaunchConfiguration () const
 Returns the backend part of the launch configuration with the grid and block sizes.
int getThreadsPerSegmentCount () const
 Returns the number of threads per segment.
ThreadsToSegmentsMapping getThreadsToSegmentsMapping () const
 Returns the mapping of threads to segments.
void setThreadsPerSegmentCount (int threadsPerSegmentCount)
 Sets the number of threads per segment.
void setThreadsPerSegmentCountToWarpSize ()
 Sets the number of threads per segment to the warp size of the current GPU.
void setThreadsToSegmentsMapping (ThreadsToSegmentsMapping threadsToSegmentsMapping)
 Sets the mapping of threads to segments.
Public Member Functions inherited from TNL::Backend::LaunchConfiguration
constexpr LaunchConfiguration (const LaunchConfiguration &)=default
constexpr LaunchConfiguration (dim3 gridSize, dim3 blockSize, std::size_t dynamicSharedMemorySize=0U, Backend::stream_t stream=0, bool blockHostUntilFinished=true)
constexpr LaunchConfiguration (LaunchConfiguration &&)=default

Protected Attributes

int threadsPerSegmentCount = 1
ThreadsToSegmentsMapping threadsToSegmentsMapping = ThreadsToSegmentsMapping::Default

Additional Inherited Members

Public Attributes inherited from TNL::Backend::LaunchConfiguration
bool blockHostUntilFinished = true
 indicates whether host execution is blocked until the kernel execution is finished
dim3 blockSize
 kernel block dimensions (in threads)
std::size_t dynamicSharedMemorySize = 0U
 size of dynamic shared memory (in bytes per block)
dim3 gridSize
 kernel grid dimensions (in blocks)
Backend::stream_t stream = 0
 stream handle

Detailed Description

Launch configuration for segment operations.

This class encapsulates the configuration for launching segment operations, including the mapping of threads to segments and the number of threads per segment. The default configuration requests the Default mapping, i.e. the best native strategy of the segments format. A segments format which does not support the requested mapping or threads per segment count throws std::invalid_argument.

Constructor & Destructor Documentation

◆ LaunchConfiguration()

TNL::Algorithms::Segments::LaunchConfiguration::LaunchConfiguration ( ThreadsToSegmentsMapping threadsToSegmentsMapping,
int threadsPerSegmentCount,
int blockSize = 1 )
inline

Constructs a configuration with the given mapping and threads per segment count.

Parameters
threadsToSegmentsMappingThe mapping of threads to segments.
threadsPerSegmentCountThe number of threads per segment, which must be a positive power of two.
blockSizeThe block size of the backend launch configuration.

Member Function Documentation

◆ setThreadsPerSegmentCount()

void TNL::Algorithms::Segments::LaunchConfiguration::setThreadsPerSegmentCount ( int threadsPerSegmentCount)
inline

Sets the number of threads per segment.

Its meaning depends on the mapping, see ThreadsToSegmentsMapping.

Parameters
threadsPerSegmentCountThe number of threads per segment.
Exceptions
std::invalid_argumentif threadsPerSegmentCount is not a positive power of two. The current count is not changed in that case.

The documentation for this struct was generated from the following file:
  • src/TNL/Algorithms/Segments/LaunchConfiguration.h