Skip to content

Commit 300b62f

Browse files
Sanjoy Dastensorflower-gardener
authored andcommitted
Add param name comments
PiperOrigin-RevId: 340848801 Change-Id: I090cef5a804d5a0faf26698daec68ef5d1c66857
1 parent 67e00c6 commit 300b62f

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎tensorflow/core/util/gpu_device_functions.h‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,26 +163,29 @@ using CudaGridRange = GpuGridRange<T...>;
163163
// Usage: for(int i : GpuGridRangeX(count)) { visit(i); }
164164
template <typename T>
165165
__device__ detail::GpuGridRange<T> GpuGridRangeX(T count) {
166-
return detail::GpuGridRange<T>(blockIdx.x * blockDim.x + threadIdx.x,
167-
gridDim.x * blockDim.x, count);
166+
return detail::GpuGridRange<T>(
167+
/*begin=*/blockIdx.x * blockDim.x + threadIdx.x,
168+
/*delta=*/gridDim.x * blockDim.x, /*end=*/count);
168169
}
169170
CREATE_CUDA_DEVICE_FUNCTION_ALIAS(GpuGridRangeX, CudaGridRangeX);
170171

171172
// Helper to visit indices in the range 0 <= i < count using the y-coordinate.
172173
// Usage: for(int i : GpuGridRangeY(count)) { visit(i); }
173174
template <typename T>
174175
__device__ detail::GpuGridRange<T> GpuGridRangeY(T count) {
175-
return detail::GpuGridRange<T>(blockIdx.y * blockDim.y + threadIdx.y,
176-
gridDim.y * blockDim.y, count);
176+
return detail::GpuGridRange<T>(
177+
/*begin=*/blockIdx.y * blockDim.y + threadIdx.y,
178+
/*delta=*/gridDim.y * blockDim.y, /*end=*/count);
177179
}
178180
CREATE_CUDA_DEVICE_FUNCTION_ALIAS(GpuGridRangeY, CudaGridRangeY);
179181

180182
// Helper to visit indices in the range 0 <= i < count using the z-coordinate.
181183
// Usage: for(int i : GpuGridRangeZ(count)) { visit(i); }
182184
template <typename T>
183185
__device__ detail::GpuGridRange<T> GpuGridRangeZ(T count) {
184-
return detail::GpuGridRange<T>(blockIdx.z * blockDim.z + threadIdx.z,
185-
gridDim.z * blockDim.z, count);
186+
return detail::GpuGridRange<T>(
187+
/*begin=*/blockIdx.z * blockDim.z + threadIdx.z,
188+
/*delta=*/gridDim.z * blockDim.z, /*end=*/count);
186189
}
187190
CREATE_CUDA_DEVICE_FUNCTION_ALIAS(GpuGridRangeZ, CudaGridRangeZ);
188191

0 commit comments

Comments
 (0)