Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cuda_lab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
cuda_lab
Commits
641b58ba
Commit
641b58ba
authored
Mar 09, 2014
by
Miklós Homolya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add size_t
parent
9d221b25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
main.cu
submission/ex11/main.cu
+3
-3
No files found.
submission/ex11/main.cu
View file @
641b58ba
...
@@ -68,7 +68,7 @@ __global__ void compute_P(float *image, float *Px, float *Py, int w, int h, int
...
@@ -68,7 +68,7 @@ __global__ void compute_P(float *image, float *Px, float *Py, int w, int h, int
float G2 = 0;
float G2 = 0;
for (int c = 0; c < nc; c++) {
for (int c = 0; c < nc; c++) {
in
t i = x + (size_t)w*y + (size_t)w*h*c;
size_
t i = x + (size_t)w*y + (size_t)w*h*c;
float ux = ((x < w-1) ? (image[i + 1] - image[i]) : 0);
float ux = ((x < w-1) ? (image[i + 1] - image[i]) : 0);
float uy = ((y < h-1) ? (image[i + w] - image[i]) : 0);
float uy = ((y < h-1) ? (image[i + w] - image[i]) : 0);
sh_u[b + B*c + B*nc*0] = ux;
sh_u[b + B*c + B*nc*0] = ux;
...
@@ -78,7 +78,7 @@ __global__ void compute_P(float *image, float *Px, float *Py, int w, int h, int
...
@@ -78,7 +78,7 @@ __global__ void compute_P(float *image, float *Px, float *Py, int w, int h, int
float g = huber(sqrtf(G2), epsilon);
float g = huber(sqrtf(G2), epsilon);
for (int c = 0; c < nc; c++) {
for (int c = 0; c < nc; c++) {
in
t i = x + (size_t)w*y + (size_t)w*h*c;
size_
t i = x + (size_t)w*y + (size_t)w*h*c;
Px[i] = g * sh_u[b + B*c + B*nc*0];
Px[i] = g * sh_u[b + B*c + B*nc*0];
Py[i] = g * sh_u[b + B*c + B*nc*1];
Py[i] = g * sh_u[b + B*c + B*nc*1];
}
}
...
@@ -91,7 +91,7 @@ __global__ void divergence_and_update(float *image, float *Px, float *Py, int w,
...
@@ -91,7 +91,7 @@ __global__ void divergence_and_update(float *image, float *Px, float *Py, int w,
int y = threadIdx.y + blockDim.y * blockIdx.y;
int y = threadIdx.y + blockDim.y * blockIdx.y;
if (x < w && y < h) {
if (x < w && y < h) {
for (int c = 0; c < nc; c++) {
for (int c = 0; c < nc; c++) {
in
t i = x + (size_t)w*y + (size_t)w*h*c;
size_
t i = x + (size_t)w*y + (size_t)w*h*c;
float dx_u1 = ((x+1 < w) ? Px[i] : 0) - ((x > 0) ? Px[i - 1] : 0);
float dx_u1 = ((x+1 < w) ? Px[i] : 0) - ((x > 0) ? Px[i - 1] : 0);
float dy_u2 = ((y+1 < h) ? Py[i] : 0) - ((y > 0) ? Py[i - w] : 0);
float dy_u2 = ((y+1 < h) ? Py[i] : 0) - ((y > 0) ? Py[i - w] : 0);
image[i] += tau * (dx_u1 + dy_u2);
image[i] += tau * (dx_u1 + dy_u2);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment