![]() |
ATLAS Offline Software
|
#include <GPUKernelSizeOptimizerSvc.h>
Classes | |
| struct | KernelRecord |
| struct | KernelsEntry |
Public Member Functions | |
| GPUKernelSizeOptimizerSvc (const std::string &name, ISvcLocator *svc) | |
| virtual void | register_kernels (const std::string &tool_name, const int number, void **kernels, const int *blocksize_hints, const int *gridsize_hints, const int *max_total_threads, const int offset=0) override |
| Register a set of kernels that can be referred back to with a name and a number. | |
| virtual CUDAKernelLaunchConfiguration | get_launch_configuration (const std::string &name, const int number=0, const int dynamic_memory=0) const override |
| Retrieve the (hopefully optimal) kernel launch configuration. | |
| virtual bool | can_use_cooperative_groups () const override |
| Whether the device + environment in use support cooperative groups. | |
| virtual bool | can_use_dynamic_parallelism () const override |
| Whether the device + environment in use support dynamic parallelism. | |
| virtual bool | should_use_minimal_kernel_sizes () const |
| Whether to avoid oversizing kernels and instead (if possible) launch kernels with the exact number of threads... | |
| virtual StatusCode | initialize () override |
| virtual StatusCode | initialize_CUDA () override |
| Initialization that invokes CUDA functions. | |
| virtual StatusCode | finalize () override |
| void | handle (const Incident &incident) override |
Protected Member Functions | |
| virtual StatusCode | initialize_non_CUDA () |
| Initialization that does not invoke CUDA functions. | |
Private Member Functions | |
| int | get_GPU_usage () const |
| Get the GPU usage, in percentage, rounded to the nearest integer. | |
Private Attributes | |
| bool | m_dynpar_support = false |
| bool | m_coopgroup_support = false |
| std::unordered_map< std::string, std::vector< KernelRecord > > | m_kernel_map |
| Gaudi::Property< std::vector< std::string > > | m_kernelFiles {this, "KernelSizeInput", {}, "Kernel size input JSON files"} |
| List of JSON files from where to read (hopefully optimized) kernel sizes for different GPUs. | |
| Gaudi::Property< bool > | m_outputSizes {this, "OutputSizes", true, "Write out last used kernel sizes"} |
If true, writes the (last used) kernel sizes to an output JSON file. | |
| Gaudi::Property< std::string > | m_outputFile {this, "OutputFile", "sizes.json", "Kernel size output file"} |
If m_outputSizes is true, the file to which the kernel sizes should be output. | |
| Gaudi::Property< bool > | m_overrideCooperativeGroups {this, "OverrideCooperativeGroups", false, "Disable cooperative group support (to force fallback to alternative iteration method)."} |
If true, forces can_use_cooperative_groups to always return false. | |
Definition at line 29 of file GPUKernelSizeOptimizerSvc.h.
| GPUKernelSizeOptimizerSvc::GPUKernelSizeOptimizerSvc | ( | const std::string & | name, |
| ISvcLocator * | svc ) |
Definition at line 12 of file GPUKernelSizeOptimizerSvc.cxx.
|
inlineoverridevirtual |
Whether the device + environment in use support cooperative groups.
Definition at line 55 of file GPUKernelSizeOptimizerSvc.h.
|
inlineoverridevirtual |
Whether the device + environment in use support dynamic parallelism.
Definition at line 61 of file GPUKernelSizeOptimizerSvc.h.
|
overridevirtual |
Definition at line 119 of file GPUKernelSizeOptimizerSvc.cxx.
|
inlineprivate |
Get the GPU usage, in percentage, rounded to the nearest integer.
Definition at line 113 of file GPUKernelSizeOptimizerSvc.h.
|
overridevirtual |
Retrieve the (hopefully optimal) kernel launch configuration.
Definition at line 51 of file GPUKernelSizeOptimizerSvc.cxx.
|
inlineoverrideinherited |
Definition at line 66 of file CaloGPUCUDAInitialization.h.
|
inlineoverridevirtual |
Reimplemented from CaloGPUCUDAInitialization.
Definition at line 74 of file GPUKernelSizeOptimizerSvc.h.
|
overridevirtual |
Initialization that invokes CUDA functions.
Reimplemented from CaloGPUCUDAInitialization.
Definition at line 66 of file GPUKernelSizeOptimizerSvc.cxx.
|
inlineprotectedvirtualinherited |
Initialization that does not invoke CUDA functions.
Reimplemented in BasicGPUClusterInfoCalculator, CaloGPUHybridClusterProcessor, GPUClusterInfoAndMomentsCalculator, GPUClusterSorter, TopoAutomatonClustering, and TopoAutomatonSplitting.
Definition at line 33 of file CaloGPUCUDAInitialization.h.
|
overridevirtual |
Register a set of kernels that can be referred back to with a name and a number.
Uses C-style arrays for more immediate CUDA compatibility, assumes the size of kernels, blocksize_hints and gridsize_hints is number and starts the numbering with an optional offset.
Definition at line 17 of file GPUKernelSizeOptimizerSvc.cxx.
|
inlinevirtual |
Whether to avoid oversizing kernels and instead (if possible) launch kernels with the exact number of threads...
Definition at line 67 of file GPUKernelSizeOptimizerSvc.h.
|
private |
Definition at line 86 of file GPUKernelSizeOptimizerSvc.h.
|
private |
Definition at line 85 of file GPUKernelSizeOptimizerSvc.h.
|
private |
Definition at line 107 of file GPUKernelSizeOptimizerSvc.h.
|
private |
List of JSON files from where to read (hopefully optimized) kernel sizes for different GPUs.
Definition at line 120 of file GPUKernelSizeOptimizerSvc.h.
|
private |
If m_outputSizes is true, the file to which the kernel sizes should be output.
Definition at line 129 of file GPUKernelSizeOptimizerSvc.h.
|
private |
If true, writes the (last used) kernel sizes to an output JSON file.
Defaults to true.
Definition at line 125 of file GPUKernelSizeOptimizerSvc.h.
|
private |
If true, forces can_use_cooperative_groups to always return false.
Defaults to false.
GPU algorithms may implement alternative code paths when cooperative groups are not supported. This allows easier testing of the performance impact of such a fallback.
Definition at line 137 of file GPUKernelSizeOptimizerSvc.h.