Skip to content

Commit 1ab03d4

Browse files
committed
Fix gru_op related code style in gpu_kernel
1 parent 3e552cd commit 1ab03d4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

paddle/operators/math/detail/gru_gpu_kernel.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ __global__ void KeGruForwardResetOutput(OpResetOutput op_reset_output,
3636
T *prev_output_value, int frame_size,
3737
int batch_size,
3838
activation_mode_t active_gate) {
39-
const int frame_idx = block_idx.x * block_dim.x + thread_idx.x;
39+
const int frame_idx = blockIdx.x * blockDim.x + threadIdx.x;
4040
if (frame_idx >= frame_size) return;
4141

4242
int batch_idx = 0;
4343
if (is_batch) {
44-
batch_idx = block_idx.y * block_dim.y + thread_idx.y;
44+
batch_idx = blockIdx.y * blockDim.y + threadIdx.y;
4545
if (batch_idx >= batch_size) return;
4646
gate_value += batch_idx * 3 * frame_size;
4747
reset_output_value += batch_idx * frame_size;
@@ -75,11 +75,11 @@ __global__ void KeGruForwardFinalOutput(OpFinalOutput op_final_output,
7575
T *output_value, int frame_size,
7676
int batch_size,
7777
activation_mode_t active_node) {
78-
const int frame_idx = block_idx.x * block_dim.x + thread_idx.x;
78+
const int frame_idx = blockIdx.x * blockDim.x + threadIdx.x;
7979
if (frame_idx >= frame_size) return;
8080
int batch_idx = 0;
8181
if (is_batch) {
82-
batch_idx = block_idx.y * block_dim.y + thread_idx.y;
82+
batch_idx = blockIdx.y * blockDim.y + threadIdx.y;
8383
if (batch_idx >= batch_size) return;
8484
gate_value += batch_idx * 3 * frame_size;
8585
output_value += batch_idx * frame_size;
@@ -112,11 +112,11 @@ __global__ void KeGruBackwardStateGrad(OpStateGrad op_state_grad, T *gate_value,
112112
T *prev_out_grad, T *output_grad,
113113
int frame_size, int batch_size,
114114
activation_mode_t active_node) {
115-
const int frame_idx = block_idx.x * block_dim.x + thread_idx.x;
115+
const int frame_idx = blockIdx.x * blockDim.x + threadIdx.x;
116116
if (frame_idx >= frame_size) return;
117117
int batch_idx = 0;
118118
if (is_batch) {
119-
batch_idx = block_idx.y * block_dim.y + thread_idx.y;
119+
batch_idx = blockIdx.y * blockDim.y + threadIdx.y;
120120
if (batch_idx >= batch_size) return;
121121
gate_value += batch_idx * 3 * frame_size;
122122
gate_grad += batch_idx * 3 * frame_size;
@@ -160,11 +160,11 @@ __global__ void KeGruBackwardResetGrad(OpResetGrad op_reset_grad, T *gate_value,
160160
T *prev_out_grad, T *reset_output_grad,
161161
int frame_size, int batch_size,
162162
activation_mode_t active_gate) {
163-
const int frame_idx = block_idx.x * block_dim.x + thread_idx.x;
163+
const int frame_idx = blockIdx.x * blockDim.x + threadIdx.x;
164164
if (frame_idx >= frame_size) return;
165165
int batch_idx = 0;
166166
if (is_batch) {
167-
batch_idx = block_idx.y * block_dim.y + thread_idx.y;
167+
batch_idx = blockIdx.y * blockDim.y + threadIdx.y;
168168
if (batch_idx >= batch_size) return;
169169
gate_value += batch_idx * 3 * frame_size;
170170
gate_grad += batch_idx * 3 * frame_size;

0 commit comments

Comments
 (0)