Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gpusched_parser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GPUSched
gpusched_parser
Commits
e2584478
Commit
e2584478
authored
1 year ago
by
Nordine Feddal
Browse files
Options
Downloads
Patches
Plain Diff
added timer initialization
parent
8173e3c3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.py
+13
-1
13 additions, 1 deletion
src/main.py
with
13 additions
and
1 deletion
src/main.py
+
13
−
1
View file @
e2584478
...
@@ -48,12 +48,24 @@ def generate_cudaStreams():
...
@@ -48,12 +48,24 @@ def generate_cudaStreams():
for
i
in
range
(
0
,
stream_number
):
for
i
in
range
(
0
,
stream_number
):
dump_stream
+=
"
\t
cudaStreamCreate(&{name});
\n
"
.
format
(
name
=
stream_name
.
format
(
no
=
i
))
dump_stream
+=
"
\t
cudaStreamCreate(&{name});
\n
"
.
format
(
name
=
stream_name
.
format
(
no
=
i
))
dump_stream
+=
"
\n
"
return
dump_stream
return
dump_stream
def
write_timer_initialization
():
chrono_dump
=
"
\t
// Initialize timer
\n
"
chrono_dump
+=
"
\t
using namespace std::chrono
\n
"
;
chrono_dump
+=
"
\t
typedef duration<double> dsec
\n
"
;
chrono_dump
+=
"
\t
typedef milliseconds ms;
\n
"
;
chrono_dump
+=
"
\t
high_resolution_clock::time_point step_end;
\n
"
chrono_dump
+=
"
\t
high_resolution_clock::time_point base = high_resolution_block::now();
\n
"
return
chrono_dump
def
write_main
(
args
):
def
write_main
(
args
):
with
open
(
args
.
output_file
,
"
a
"
)
as
outFile
:
with
open
(
args
.
output_file
,
"
a
"
)
as
outFile
:
# Start message
# Start message
outFile
.
write
(
"
#include <stdio.h>
\n
"
outFile
.
write
(
"
#include <stdio.h>
\n
"
"
#include <chrono>
\n
"
"
#include <string>
\n
"
"
#include <string>
\n
"
"
#include
\"
steps_struct.hpp
\"\n
"
"
#include
\"
steps_struct.hpp
\"\n
"
"
#include
\"
gpu_tasks.hpp
\"\n
"
"
#include
\"
gpu_tasks.hpp
\"\n
"
...
@@ -66,6 +78,7 @@ def write_main(args):
...
@@ -66,6 +78,7 @@ def write_main(args):
"
\t
printf(
\"
There is %d steps to execute
\"
, steps.size());
\n
"
"
\t
printf(
\"
There is %d steps to execute
\"
, steps.size());
\n
"
)
)
outFile
.
write
(
generate_cudaStreams
())
outFile
.
write
(
generate_cudaStreams
())
outFile
.
write
(
write_timer_initialization
())
outFile
.
write
(
generate_main_unroll_step
())
outFile
.
write
(
generate_main_unroll_step
())
outFile
.
write
(
'
}
'
)
outFile
.
write
(
'
}
'
)
...
@@ -79,7 +92,6 @@ def main():
...
@@ -79,7 +92,6 @@ def main():
parser
.
add_argument
(
'
-o
'
,
'
--output_file
'
,
type
=
str
,
default
=
'
gpusched_impl.cu
'
,
help
=
'
Output file containing the implementation of GPUSCHED
'
)
parser
.
add_argument
(
'
-o
'
,
'
--output_file
'
,
type
=
str
,
default
=
'
gpusched_impl.cu
'
,
help
=
'
Output file containing the implementation of GPUSCHED
'
)
parser
.
add_argument
(
'
-v
'
,
'
--version
'
,
action
=
'
version
'
,
version
=
'
%(prog)s 0.1
'
)
parser
.
add_argument
(
'
-v
'
,
'
--version
'
,
action
=
'
version
'
,
version
=
'
%(prog)s 0.1
'
)
#@TODO add a check for -t -j -s -k mandatory parameter
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
...
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