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
58c83770
Commit
58c83770
authored
Mar 05, 2014
by
Gaurav Kukreja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed convolution code
Signed-off-by:
Gaurav Kukreja
<
gmkukreja@gmail.com
>
parent
54dbd769
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
main.cu
gaurav/1_Assign/ex6/main.cu
+3
-3
No files found.
gaurav/1_Assign/ex6/main.cu
View file @
58c83770
...
@@ -61,11 +61,11 @@ __device__ void convolveImage(float* imgIn, float* kernel, float* imgOut, int ra
...
@@ -61,11 +61,11 @@ __device__ void convolveImage(float* imgIn, float* kernel, float* imgOut, int ra
int iz = threadIdx.z + blockDim.z * blockIdx.z;
int iz = threadIdx.z + blockDim.z * blockIdx.z;
// Index of the output image, this kernel works on
// Index of the output image, this kernel works on
in
t idx = ix + (iy * w) + (iz * w * h);
size_
t idx = ix + (iy * w) + (iz * w * h);
int kw = 2 * rad + 1;
int kw = 2 * rad + 1;
// check limits
// check limits
if (i
dx < w * h *
nc)
if (i
x < w && iy < h && iz <
nc)
{
{
imgOut[idx] = 0; // initialize
imgOut[idx] = 0; // initialize
float value = 0;
float value = 0;
...
@@ -275,7 +275,7 @@ int main(int argc, char **argv)
...
@@ -275,7 +275,7 @@ int main(int argc, char **argv)
// Repetitions Loop
// Repetitions Loop
for(int rep = 0; rep < repeats; rep++)
for(int rep = 0; rep < repeats; rep++)
{
{
size_t count = w * h * nc;
size_t count =
(size_t)
w * h * nc;
// Thread Dimensions
// Thread Dimensions
dim3 block = dim3(16, 8, nc);
dim3 block = dim3(16, 8, nc);
...
...
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