Skip to content

Commit 44c80c1

Browse files
authored
add guard to block_count (#2909)
* add log * update test script * guard for block_count * remove test script
1 parent a120566 commit 44c80c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tensorflow/core/util/gpu_launch_config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ GpuLaunchConfig GetGpuLaunchConfigFixedBlockSize(
203203
#elif TENSORFLOW_USE_ROCM
204204
hipError_t err = hipOccupancyMaxActiveBlocksPerMultiprocessor(
205205
&block_count, func, fixed_block_size, dynamic_shared_memory_size);
206+
if (block_count < 1) { block_count = 1; }
206207
CHECK_EQ(err, hipSuccess);
207208
#endif
208209
block_count = std::min(block_count * d.getNumGpuMultiProcessors(),

0 commit comments

Comments
 (0)