Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alberta3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
ians-nmh-siebert
alberta
alberta3
Commits
fe352d37
Commit
fe352d37
authored
16 years ago
by
Claus-Justus Heine
Browse files
Options
Downloads
Patches
Plain Diff
Replace "echo -n -e" by printf
parent
847a82cb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mkdoffreemasks.sh
+12
-10
12 additions, 10 deletions
mkdoffreemasks.sh
with
12 additions
and
10 deletions
mkdoffreemasks.sh
+
12
−
10
View file @
fe352d37
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
DOF_FREE_SIZE
=
$1
DOF_FREE_SIZE
=
$1
MAX_STRIDE
=
$2
MAX_STRIDE
=
$2
FW
=
$((
${
DOF_FREE_SIZE
}
/
4
))
FW
=
$((
${
DOF_FREE_SIZE
}
/
4
))
PRINT
=
"printf"
#echo -n -e
ALLBITS
=
$((
(
1
<<
${
DOF_FREE_SIZE
}
)
-
1
))
ALLBITS
=
$((
(
1
<<
${
DOF_FREE_SIZE
}
)
-
1
))
if
test
${
ALLBITS
}
-eq
0
;
then
if
test
${
ALLBITS
}
-eq
0
;
then
...
@@ -15,7 +17,7 @@ if test ${MAX_STRIDE} -gt 1; then
...
@@ -15,7 +17,7 @@ if test ${MAX_STRIDE} -gt 1; then
#ifndef _ALBERTA_STRIDE_DOF_FREE_BIT_H_
#ifndef _ALBERTA_STRIDE_DOF_FREE_BIT_H_
#define _ALBERTA_STRIDE_DOF_FREE_BIT_H_
#define _ALBERTA_STRIDE_DOF_FREE_BIT_H_
EOF
EOF
echo
-n
-e
'\n#define MAX_STRIDE '
"
${
MAX_STRIDE
}
"
'\n\n'
${
PRINT
}
'\n#define MAX_STRIDE '
"
${
MAX_STRIDE
}
"
'\n\n'
cat
<<
EOF
cat
<<
EOF
const DOF_FREE_UNIT dof_stride_free_bit[MAX_STRIDE][DOF_FREE_SIZE] = {
const DOF_FREE_UNIT dof_stride_free_bit[MAX_STRIDE][DOF_FREE_SIZE] = {
EOF
EOF
...
@@ -39,33 +41,33 @@ while test ${STRIDE} -le ${MAX_STRIDE}; do
...
@@ -39,33 +41,33 @@ while test ${STRIDE} -le ${MAX_STRIDE}; do
BIT
=
0
BIT
=
0
if
test
${
MAX_STRIDE
}
-gt
1
;
then
if
test
${
MAX_STRIDE
}
-gt
1
;
then
echo
-n
-e
' {\n '
${
PRINT
}
' {\n '
else
else
echo
-n
-e
' '
${
PRINT
}
' '
fi
fi
while
test
${
BIT
}
-lt
${
DOF_FREE_SIZE
}
;
do
while
test
${
BIT
}
-lt
${
DOF_FREE_SIZE
}
;
do
VALUE
=
$((
(
${
MASK
}
<<
${
BIT
}
)
&
${
ALLBITS
}
))
VALUE
=
$((
(
${
MASK
}
<<
${
BIT
}
)
&
${
ALLBITS
}
))
printf
'0x%0'
${
FW
}
'x'
${
VALUE
}
${
PRINT
}
'0x%0'
${
FW
}
'x'
${
VALUE
}
BIT
=
$((
${
BIT
}
+
1
))
BIT
=
$((
${
BIT
}
+
1
))
if
test
${
BIT
}
-lt
$((
${
DOF_FREE_SIZE
}
+
${
MAX_STRIDE
}
-
1
))
;
then
if
test
${
BIT
}
-lt
$((
${
DOF_FREE_SIZE
}
+
${
MAX_STRIDE
}
-
1
))
;
then
if
test
$((
${
BIT
}
%
${
WRAP
}
))
-eq
0
;
then
if
test
$((
${
BIT
}
%
${
WRAP
}
))
-eq
0
;
then
if
test
${
MAX_STRIDE
}
-gt
1
;
then
if
test
${
MAX_STRIDE
}
-gt
1
;
then
echo
-n
-e
',\n '
${
PRINT
}
',\n '
else
else
echo
-n
-e
',\n '
${
PRINT
}
',\n '
fi
fi
else
else
echo
-n
-e
', '
${
PRINT
}
', '
fi
fi
fi
fi
done
done
if
test
${
MAX_STRIDE
}
-gt
1
;
then
if
test
${
MAX_STRIDE
}
-gt
1
;
then
echo
-n
-e
'\n }'
${
PRINT
}
'\n }'
fi
fi
if
test
${
STRIDE
}
-lt
${
MAX_STRIDE
}
;
then
if
test
${
STRIDE
}
-lt
${
MAX_STRIDE
}
;
then
echo
-n
-e
',\n'
${
PRINT
}
',\n'
else
else
echo
-n
-e
'\n'
${
PRINT
}
'\n'
fi
fi
STRIDE
=
$((
${
STRIDE
}
+
1
))
STRIDE
=
$((
${
STRIDE
}
+
1
))
done
done
...
...
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