Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
5
5504-research
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
Container 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
Milo Craun
5504-research
Commits
7e6c5e36
Commit
7e6c5e36
authored
11 months ago
by
Milo Craun
Browse files
Options
Downloads
Patches
Plain Diff
Working on workloads and building
parent
8ed1521e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+13
-0
13 additions, 0 deletions
README.md
build.sh
+24
-0
24 additions, 0 deletions
build.sh
img_gray.c
+47
-0
47 additions, 0 deletions
img_gray.c
with
84 additions
and
0 deletions
README.md
+
13
−
0
View file @
7e6c5e36
...
...
@@ -36,3 +36,16 @@ For more info on the vectorizer go [vectorizer](https://gcc.gnu.org/projects/tre
The official ARM NEON page has a good overview of the NEON architecture for vector instructions.
It can be found
[
here
](
https://developer.arm.com/documentation/102474/0100/Overview?lang=en
)
.
Key takeaways are that Vector instructions act on vector registers (128-bit or 64-bit).
# 2024-04-13 - Milo
## First workload
I added a basic image processing task to the repo.
The file
`img_gray.c`
will convert an RBG image into grayscale
by computing the luminance of each pixel.
This should be heavily vectorizable, and should see a great improvement.
## Build Script
Currently writing a build script to build vectorized and non-vectorized objects for
x86 and ARM automatically.
This diff is collapsed.
Click to expand it.
build.sh
0 → 100755
+
24
−
0
View file @
7e6c5e36
#!/usr/bin/bash
# This shell script will build vectorized and un-vectorized versions of code
# for x86_64 and AArch64
# Must have the AArch64 cross compiler placed in your home dir under ~/aarch
# Build the x86 with O1 and -ftree-vectorize -fopt-info-vec-all and static
ARM
=
~/aarch/bin/aarch64-none-linux-gnu-gcc
echo
"Building x86"
echo
"Vectorized"
gcc
-static
-O1
-ftree-vectorize
-msse
-fopt-info-vec-all
$1
.c
-o
$1
-x86-vec
echo
"No vectorize"
gcc
-static
-O1
-msse
$1
.c
-o
$1
-x86-nvec
echo
"Building AArch64"
echo
"Vectorized"
$ARM
-static
-O1
-ftree-vectorize
-fopt-info-vec-all
$1
.c
-o
$1
-arm-vec
echo
"No vectorize"
$ARM
-static
-O1
$1
.c
-o
$1
-arm-nvec
This diff is collapsed.
Click to expand it.
img_gray.c
0 → 100644
+
47
−
0
View file @
7e6c5e36
/**
* A very basic (and abstracted) image processing filter that
* converts an RBG image (represented as 3 matrices) into a
* grayscale image using the CIE 1931 color space
*/
#include
<stdio.h>
#include
<stdlib.h>
#include
<math.h>
#define num 64
void
convert
(
float
**
R
,
float
**
G
,
float
**
B
,
float
**
lum
)
{
// Formula: Y = 0.2126*R + 0.7152*G + 0.0722*B
for
(
int
y
=
0
;
y
<
num
;
y
++
)
{
for
(
int
x
=
0
;
x
<
num
;
x
++
)
{
lum
[
y
][
x
]
=
0
.
2126
*
R
[
y
][
x
]
+
0
.
7152
*
G
[
y
][
x
]
+
0
.
0722
*
B
[
y
][
x
];
}
}
}
int
main
()
{
float
**
R
=
(
float
**
)
malloc
(
num
*
sizeof
(
float
*
));
float
**
G
=
(
float
**
)
malloc
(
num
*
sizeof
(
float
*
));
float
**
B
=
(
float
**
)
malloc
(
num
*
sizeof
(
float
*
));
float
**
lum
=
(
float
**
)
malloc
(
num
*
sizeof
(
float
*
));
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
R
[
i
]
=
(
float
*
)
malloc
(
num
*
sizeof
(
float
));
G
[
i
]
=
(
float
*
)
malloc
(
num
*
sizeof
(
float
));
B
[
i
]
=
(
float
*
)
malloc
(
num
*
sizeof
(
float
));
lum
[
i
]
=
(
float
*
)
malloc
(
num
*
sizeof
(
float
));
}
for
(
int
y
=
0
;
y
<
num
;
y
++
)
{
for
(
int
x
=
0
;
x
<
num
;
x
++
)
{
R
[
y
][
x
]
=
x
*
0
.
2
;
G
[
y
][
x
]
=
x
*
0
.
3
;
B
[
y
][
x
]
=
x
*
0
.
4
;
lum
[
y
][
x
]
=
0
.
0
;
}
}
convert
(
R
,
G
,
B
,
lum
);
printf
(
"Success!
\n
"
);
return
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