Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LifeGame
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
benjamin.sitbon
LifeGame
Commits
2b0ad9b6
Commit
2b0ad9b6
authored
3 years ago
by
=
Browse files
Options
Downloads
Patches
Plain Diff
mesures
parent
833be914
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/life.cu
+0
-6
0 additions, 6 deletions
src/life.cu
src/main.cu
+3
-3
3 additions, 3 deletions
src/main.cu
with
3 additions
and
9 deletions
src/life.cu
+
0
−
6
View file @
2b0ad9b6
...
...
@@ -54,13 +54,7 @@ __global__ void dummy_kernel(int* src, int* dest,int N, int M)
int
j
=
blockIdx
.
y
*
blockDim
.
y
+
threadIdx
.
y
;
int
index
=
((
j
-
1
)
*
N
+
i
);
//printf("\n i = %d j = %d",i,j);
//int index = i*(M-1)+j;
int
res
=
life_destiny
(
src
,
N
,
M
,
i
,
j
);
if
(
src
[
index
]
==
1
){
printf
(
"
\n
i = %d j = %d"
,
i
,
j
);
}
dest
[
index
]
=
res
;
}
...
...
This diff is collapsed.
Click to expand it.
src/main.cu
+
3
−
3
View file @
2b0ad9b6
...
...
@@ -22,8 +22,8 @@ void write_pbm(int* array, int nRows, int nCols, const char *filename) {
}
int
main
()
{
int
H
=
32
;
int
W
=
32
;
int
H
=
100
;
int
W
=
100
;
int
*
domain
=
(
int
*
)
calloc
(
H
*
W
,
sizeof
(
int
));
// carre au milieu du domaine, devrait rester statique
domain
[
9
*
W
+
9
]
=
1
;
...
...
@@ -46,7 +46,7 @@ int main() {
cudaEventRecord
(
start
,
0
);
life
(
domain
,
H
,
W
,
1
,
dim3
(
32
,
32
,
1
),
dim3
(
W
/
32
,
H
/
32
,
1
));
life
(
domain
,
H
,
W
,
500
,
dim3
(
32
,
32
,
1
),
dim3
(
W
/
32
,
H
/
32
,
1
));
cudaEventRecord
(
stop
,
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment