Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
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
Linshizhi
ffmpeg.wasm-core
Commits
caf5ef85
Commit
caf5ef85
authored
Aug 03, 2014
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpu-test: test av_cpu_count
Add CPU count and number threads as informative values for fate.
parent
07d8fa58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
cpu.c
libavutil/cpu.c
+13
-1
libavutil.mak
tests/fate/libavutil.mak
+1
-1
No files found.
libavutil/cpu.c
View file @
caf5ef85
...
@@ -180,6 +180,7 @@ int av_cpu_count(void)
...
@@ -180,6 +180,7 @@ int av_cpu_count(void)
#ifdef TEST
#ifdef TEST
#include <stdio.h>
#include <stdio.h>
#include "avstring.h"
#if !HAVE_GETOPT
#if !HAVE_GETOPT
#include "compat/getopt.c"
#include "compat/getopt.c"
...
@@ -245,12 +246,14 @@ int main(int argc, char **argv)
...
@@ -245,12 +246,14 @@ int main(int argc, char **argv)
{
{
int
cpu_flags_raw
=
av_get_cpu_flags
();
int
cpu_flags_raw
=
av_get_cpu_flags
();
int
cpu_flags_eff
;
int
cpu_flags_eff
;
int
cpu_count
=
av_cpu_count
();
char
threads
[
5
]
=
"auto"
;
if
(
cpu_flags_raw
<
0
)
if
(
cpu_flags_raw
<
0
)
return
1
;
return
1
;
for
(;;)
{
for
(;;)
{
int
c
=
getopt
(
argc
,
argv
,
"c:"
);
int
c
=
getopt
(
argc
,
argv
,
"c:
t:
"
);
if
(
c
==
-
1
)
if
(
c
==
-
1
)
break
;
break
;
switch
(
c
)
{
switch
(
c
)
{
...
@@ -262,6 +265,14 @@ int main(int argc, char **argv)
...
@@ -262,6 +265,14 @@ int main(int argc, char **argv)
av_set_cpu_flags_mask
(
cpuflags
);
av_set_cpu_flags_mask
(
cpuflags
);
break
;
break
;
}
}
case
't'
:
{
int
len
=
av_strlcpy
(
threads
,
optarg
,
sizeof
(
threads
));
if
(
len
>=
sizeof
(
threads
))
{
fprintf
(
stderr
,
"Invalid thread count '%s'
\n
"
,
optarg
);
return
2
;
}
}
}
}
}
}
...
@@ -272,6 +283,7 @@ int main(int argc, char **argv)
...
@@ -272,6 +283,7 @@ int main(int argc, char **argv)
print_cpu_flags
(
cpu_flags_raw
,
"raw"
);
print_cpu_flags
(
cpu_flags_raw
,
"raw"
);
print_cpu_flags
(
cpu_flags_eff
,
"effective"
);
print_cpu_flags
(
cpu_flags_eff
,
"effective"
);
fprintf
(
stderr
,
"threads = %s (cpu_count = %d)
\n
"
,
threads
,
cpu_count
);
return
0
;
return
0
;
}
}
...
...
tests/fate/libavutil.mak
View file @
caf5ef85
...
@@ -27,7 +27,7 @@ fate-blowfish: CMD = run libavutil/blowfish-test
...
@@ -27,7 +27,7 @@ fate-blowfish: CMD = run libavutil/blowfish-test
FATE_LIBAVUTIL += fate-cpu
FATE_LIBAVUTIL += fate-cpu
fate-cpu: libavutil/cpu-test$(EXESUF)
fate-cpu: libavutil/cpu-test$(EXESUF)
fate-cpu: CMD = run libavutil/cpu-test $(CPUFLAGS:%=-c%)
fate-cpu: CMD = run libavutil/cpu-test $(CPUFLAGS:%=-c%)
$(THREADS:%=-t%)
fate-cpu: REF = /dev/null
fate-cpu: REF = /dev/null
FATE_LIBAVUTIL += fate-crc
FATE_LIBAVUTIL += fate-crc
...
...
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