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
987efb0f
Commit
987efb0f
authored
1 year ago
by
Nordine Feddal
Browse files
Options
Downloads
Patches
Plain Diff
added a wrapper for vector
parent
354a806b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gpusched_parser/parser.py
+8
-1
8 additions, 1 deletion
src/gpusched_parser/parser.py
src/gputask/gputask.py
+5
-1
5 additions, 1 deletion
src/gputask/gputask.py
with
13 additions
and
2 deletions
src/gpusched_parser/parser.py
+
8
−
1
View file @
987efb0f
...
@@ -27,10 +27,13 @@ def parse_tasks(args):
...
@@ -27,10 +27,13 @@ def parse_tasks(args):
inFileLines
=
inFile
.
readlines
()
inFileLines
=
inFile
.
readlines
()
print
(
"
Generate GPU tasks file: gpu_tasks.hpp
"
)
print
(
"
Generate GPU tasks file: gpu_tasks.hpp
"
)
outFile
.
write
(
"
#ifndef __GPU_TASKS_HPP
\n
"
outFile
.
write
(
"
#ifndef __GPU_TASKS_HPP
\n
"
"
#define __GPU_TASKS_HPP
\n
"
"
#define __GPU_TASKS_HPP
\n
"
"
#include <
array
>
\n
"
)
"
#include <
vector
>
\n
"
)
# dump the wrapper for vector
outFile
.
write
(
GPUTaskParams
.
dump_struct_wrapper
())
# dump the gputask structure here
# dump the gputask structure here
outFile
.
write
(
GPUTaskParams
.
dump_struct
())
outFile
.
write
(
GPUTaskParams
.
dump_struct
())
for
line
in
inFileLines
:
for
line
in
inFileLines
:
...
@@ -55,6 +58,10 @@ def parse_tasks(args):
...
@@ -55,6 +58,10 @@ def parse_tasks(args):
list_gpu_tasks_object
.
append
(
currTask
)
list_gpu_tasks_object
.
append
(
currTask
)
outFile
.
write
(
currTask
.
dump_str
()
+
"
\n
"
)
outFile
.
write
(
currTask
.
dump_str
()
+
"
\n
"
)
relation_task_id_task_name
[
currTask
.
task_id
]
=
currTask
.
name
relation_task_id_task_name
[
currTask
.
task_id
]
=
currTask
.
name
outFile
.
write
(
"
static std::vector<std::shared_ptr<igputask> >& get_gpusched_task_vector() {
\n
"
"
\t
std::vector<std:::shared_ptr<igputask> > gpu_tasks;
\n
"
"
}
\n
"
)
outFile
.
write
(
"
#endif
"
)
outFile
.
write
(
"
#endif
"
)
print
(
"
gpu_tasks.hpp file generated
"
)
print
(
"
gpu_tasks.hpp file generated
"
)
...
...
This diff is collapsed.
Click to expand it.
src/gputask/gputask.py
+
5
−
1
View file @
987efb0f
...
@@ -52,10 +52,11 @@ class GPUTaskParams:
...
@@ -52,10 +52,11 @@ class GPUTaskParams:
# STRUCT NAME
# STRUCT NAME
STRUCT_NAME
=
"
gpusched_task_t
"
STRUCT_NAME
=
"
gpusched_task_t
"
WRAPPER_STRUCT_NAME
=
"
gpusched_wrapper_task_t
"
def
dump_struct
():
def
dump_struct
():
dump
=
"
template<typename ...Types>
\n
"
dump
=
"
template<typename ...Types>
\n
"
dump
+=
"
struct
gpusched_task_t {
\n
"
dump
+=
"
struct
{struct_name}: public {wrapper_name} {{
\n
"
.
format
(
struct_name
=
GPUTaskParams
.
STRUCT_NAME
,
wrapper_name
=
GPUTaskParams
.
WRAPPER_STRUCT_NAME
)
dump
=
dump
+
GPUTaskParams
.
WCET
dump
=
dump
+
GPUTaskParams
.
WCET
dump
=
dump
+
GPUTaskParams
.
PERIOD
dump
=
dump
+
GPUTaskParams
.
PERIOD
dump
=
dump
+
GPUTaskParams
.
DEADLINE
dump
=
dump
+
GPUTaskParams
.
DEADLINE
...
@@ -71,7 +72,10 @@ class GPUTaskParams:
...
@@ -71,7 +72,10 @@ class GPUTaskParams:
dump
=
dump
+
"
};
\n
"
dump
=
dump
+
"
};
\n
"
return
dump
return
dump
def
dump_struct_wrapper
():
dump
=
"
struct {wrapper_name}{{}};
\n\n
"
.
format
(
wrapper_name
=
GPUTaskParams
.
WRAPPER_STRUCT_NAME
)
return
dump
#@TODO store the cuda kernel definition directly in the structure so we can call it with its params.
#@TODO store the cuda kernel definition directly in the structure so we can call it with its params.
class
GPUTask
:
class
GPUTask
:
...
...
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