Skip to content

Commit 3385765

Browse files
committed
Change order of functions. Add comments.
1 parent 3621234 commit 3385765

File tree

4 files changed

+537
-538
lines changed

4 files changed

+537
-538
lines changed

openpiv/gpu/misc.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,21 @@
1717

1818
mod_logical_or = SourceModule(
1919
"""
20-
__global__ void gpu_logical_or_f(float *f_out, float *f1, float *f2, int size)
20+
__global__ void gpu_logical_or_f(float *f_out, float *f_in1, float *f_in2, int size)
2121
{
22-
// frame_masked : output argument
2322
int t_idx = blockIdx.x * blockDim.x + threadIdx.x;
2423
if (t_idx >= size) {return;}
2524
26-
f_out[t_idx] = f1[t_idx] || f2[t_idx];
25+
f_out[t_idx] = f_in1[t_idx] || f_in2[t_idx];
2726
}
2827
2928
30-
__global__ void gpu_logical_or_i(int *f_out, int *f1, int *f2, int size)
29+
__global__ void gpu_logical_or_i(int *f_out, int *f_in1, int *f_in2, int size)
3130
{
32-
// frame_masked : output argument
3331
int t_idx = blockIdx.x * blockDim.x + threadIdx.x;
3432
if (t_idx >= size) {return;}
3533
36-
f_out[t_idx] = f1[t_idx] || f2[t_idx];
34+
f_out[t_idx] = f_in1[t_idx] || f_in2[t_idx];
3735
}
3836
"""
3937
)
@@ -79,7 +77,6 @@ def gpu_logical_or(f1, f2):
7977
"""
8078
__global__ void gpu_mask_f(float *f_masked, float *f, int *mask, int size)
8179
{
82-
// frame_masked : output argument
8380
int t_idx = blockIdx.x * blockDim.x + threadIdx.x;
8481
if (t_idx >= size) {return;}
8582
@@ -89,7 +86,6 @@ def gpu_logical_or(f1, f2):
8986
9087
__global__ void gpu_mask_i(int *f_masked, int *f, int *mask, int size)
9188
{
92-
// frame_masked : output argument
9389
int t_idx = blockIdx.x * blockDim.x + threadIdx.x;
9490
if (t_idx >= size) {return;}
9591
@@ -142,7 +138,8 @@ def gpu_mask(f, mask):
142138
"""
143139
__global__ void scalar_mod_f(float *i, float *r, float *f, int m, int size)
144140
{
145-
// i, r : output arguments
141+
// i: integer part of quotient
142+
// r: remainder part of quotient
146143
int t_idx = blockIdx.x * blockDim.x + threadIdx.x;
147144
if (t_idx >= size) {return;}
148145
@@ -154,7 +151,8 @@ def gpu_mask(f, mask):
154151
155152
__global__ void scalar_mod_i(int *i, int *r, int *f, int m, int size)
156153
{
157-
// i, r : output arguments
154+
// i: integer part of quotient
155+
// r: remainder part of quotient
158156
int t_idx = blockIdx.x * blockDim.x + threadIdx.x;
159157
if (t_idx >= size) {return;}
160158

0 commit comments

Comments
 (0)