MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetGpuLaunchConfig

Function GetGpuLaunchConfig

tensorflow/core/util/gpu_launch_config.h:127–144  ·  view source on GitHub ↗

Calculate the GPU launch config we should use for a kernel launch. This is assuming the kernel is quite simple and will largely be memory-limited. REQUIRES: work_element_count > 0.

Source from the content-addressed store, hash-verified

125// memory-limited.
126// REQUIRES: work_element_count > 0.
127inline GpuLaunchConfig GetGpuLaunchConfig(int work_element_count,
128 const Eigen::GpuDevice& d) {
129 CHECK_GT(work_element_count, 0);
130 GpuLaunchConfig config;
131 const int virtual_thread_count = work_element_count;
132 const int physical_thread_count = std::min(
133 d.getNumGpuMultiProcessors() * d.maxGpuThreadsPerMultiProcessor(),
134 virtual_thread_count);
135 const int thread_per_block = std::min(1024, d.maxGpuThreadsPerBlock());
136 const int block_count =
137 std::min(DivUp(physical_thread_count, thread_per_block),
138 d.getNumGpuMultiProcessors());
139
140 config.virtual_thread_count = virtual_thread_count;
141 config.thread_per_block = thread_per_block;
142 config.block_count = block_count;
143 return config;
144}
145#ifndef TENSORFLOW_USE_ROCM
146inline CudaLaunchConfig GetCudaLaunchConfig(int work_element_count,
147 const Eigen::GpuDevice& d) {

Callers 15

operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
SolveForSizeOneOrTwoMethod · 0.85
RangeInitFunction · 0.85
MoveValuesFunction · 0.85
MoveSparseValuesFunction · 0.85
CompareAdjacentFunction · 0.85
NmsGpuFunction · 0.85
DoNMSFunction · 0.85
operator()Method · 0.85
operator()Method · 0.85

Calls 2

DivUpFunction · 0.85
minFunction · 0.50

Tested by

no test coverage detected