Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imageProcessing
Project
Project
Details
Activity
Releases
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
Ecole
imageProcessing
Commits
42f39ea7
Commit
42f39ea7
authored
Apr 08, 2018
by
BORNON Théophile
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
possibility to add a max thread arguement
parent
1825f502
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
5 deletions
+16
-5
ImageProcessing.exe
ImageProcessing_Benchmark/bin/Debug/ImageProcessing.exe
+0
-0
MultiThreadedTask.cs
S04_Projet/MultiThreadedTask.cs
+1
-4
Program.cs
S04_Projet/Program.cs
+7
-1
ImageProcessing.exe
S04_Projet/bin/Debug/ImageProcessing.exe
+0
-0
threads.bat
S04_Projet/bin/Debug/threads.bat
+8
-0
No files found.
ImageProcessing_Benchmark/bin/Debug/ImageProcessing.exe
View file @
42f39ea7
No preview for this file type
S04_Projet/MultiThreadedTask.cs
View file @
42f39ea7
...
...
@@ -30,7 +30,6 @@ namespace S04_Projet
private
short
[,]
filter
;
private
double
factor
;
private
int
size
;
//private double stepSize;
private
Operation
ToDo
;
#
endregion
...
...
@@ -62,7 +61,7 @@ namespace S04_Projet
nbPixel
=
opt
.
width
*
opt
.
height
;
size
=
filter
.
GetLength
(
0
);
if
(
Program
.
MULTITHREADING
)
nbProcessors
=
Math
.
Min
(
Environment
.
ProcessorCount
,
8
)
;
nbProcessors
=
Program
.
MAX_THREADS
;
else
nbProcessors
=
1
;
}
...
...
@@ -137,7 +136,6 @@ namespace S04_Projet
NewGMatrix
=
new
byte
[
nbPixel
];
NewBMatrix
=
new
byte
[
nbPixel
];
//stepSize = (Math.E - 1) / nbProcessors;
Thread
[]
threads
=
new
Thread
[
nbProcessors
];
Console
.
WriteLine
(
"Creating {0} thread(s)"
,
nbProcessors
);
...
...
@@ -145,7 +143,6 @@ namespace S04_Projet
for
(
int
i
=
0
;
i
<
nbProcessors
;
i
++)
{
threads
[
i
]
=
new
Thread
(
new
ParameterizedThreadStart
(
ApplyFilterTask
));
//double param = 1 + i * stepSize;
threads
[
i
].
Start
(
i
);
}
...
...
S04_Projet/Program.cs
View file @
42f39ea7
...
...
@@ -8,6 +8,7 @@ namespace S04_Projet
{
//public static bool MULTITHREADING_LOAD = false;
public
static
bool
MULTITHREADING
=
false
;
public
static
int
MAX_THREADS
=
Environment
.
ProcessorCount
;
public
static
bool
DEBUG
=
false
;
private
static
string
[]
menuItems
=
new
string
[]
{
"Charger une image"
,
"Créer une image"
};
...
...
@@ -111,7 +112,12 @@ namespace S04_Projet
break
;
}
img
=
img
.
Filter
(
Filter
.
Filtres
[
choix
],
Filter
.
Facteurs
[
choix
]);
};
}
else
if
(
args
[
i
]
==
"--threads"
||
args
[
i
]
==
"-t"
)
{
MAX_THREADS
=
int
.
Parse
(
args
[
i
+
1
]);
increment
=
2
;
}
if
(
DEBUG
)
{
...
...
S04_Projet/bin/Debug/ImageProcessing.exe
View file @
42f39ea7
No preview for this file type
S04_Projet/bin/Debug/threads.bat
0 → 100644
View file @
42f39ea7
@echo off
FOR /L %%i IN (1,1,30) DO (
ECHO i : %%i
FOR /L %%j IN (1,1,20) DO (
ECHO j : %%j
ImageProcessing.exe -d -MT -t %%i -i img\flocon.bmp -f flou
)
)
\ No newline at end of file
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