Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rtgpgpu
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
Model registry
Operate
Environments
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
PTASK
rtgpgpu
Commits
56743af8
Commit
56743af8
authored
5 years ago
by
rtekin
Browse files
Options
Downloads
Patches
Plain Diff
add reschedFpSingle and prudaUsing code
parent
388a27d5
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
presentation/poster/code/mainCodeMinted.tex
+72
-1
72 additions, 1 deletion
presentation/poster/code/mainCodeMinted.tex
with
72 additions
and
1 deletion
presentation/poster/code/mainCodeMinted.tex
+
72
−
1
View file @
56743af8
\documentclass
[varwidth=1
0
cm, border={0.5cm 0.1cm 0.1cm 0.1cm}]
{
standalone
}
\documentclass
[varwidth=1
5
cm, border={0.5cm 0.1cm 0.1cm 0.1cm}]
{
standalone
}
\usepackage
{
minted
}
\begin{document}
%------------------------------------------------------------------------------
\begin{figure}
\centering
\begin{minted}
[gobble=0,frame=lines]
{
c
}
#define N 8
__
global
__
void add(int *a, int *b, int *c)
{
int tid = blockDim.x * blockIdx.x + threadIdx.x;
while (tid < N)
{
c[tid] = a[tid] + b[tid];
tid += blockDim.x;
}
}
int main()
{
int *dev
_
a, *dev
_
b, *dev
_
c;
//Memory allocation and initializing
//Kernel initializing
init
_
kernel
_
listing();
create
_
kernel(std::get<0>(get
_
listing()), add, 2, 5, dev
_
a, dev
_
b, dev
_
c);
//Periodic task parameters
struct gpu
_
sched
_
param ga;
ga.period
_
us = 5000;
ga.deadline
_
us= 5000;
ga.priority = 3;
//Periodic task creation
struct pruda
_
task
_
t * p
_
task
_
a = create
_
pruda
_
task(0, ga, 1, 1);
//Using Fixed Priority algorithm with the Single-stream strategy
init
_
scheduler(SINGLE, FP);
add
_
pruda
_
task(p
_
task
_
a);
//One CPU thread per CUDA kernel (see pruda
_
task() function example above)
create
_
cpu
_
threads();
//CPU operations
//Memory free
return 0;
}
\end{minted}
\end{figure}
% \begin{figure}
% \centering
% \begin{minted}[gobble=0,frame=lines]{c}
%void pruda_resched_fp_single(){
% pthread_mutex_lock(&(scheduler->mut));
% if (scheduler->lsq_free == 1) {
% pthread_mutex_unlock(&(scheduler->mut));
% return;
% }
% sched_on_lsq();
% pthread_mutex_unlock(&(scheduler->mut));
%}
% \end{minted}
%
% %\caption{Pseudo-code of pruda\_resched\_fp\_single()}
%%\label{algo:reschedFpSingle}
%\end{figure}
%--------- ADD TASK
% \begin{figure}
% \centering
...
...
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