Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
td_spectre
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
Container Registry
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Térence Chateigné
td_spectre
Compare revisions
master to 1e2fa05c4daf2ef3ea1dca1cc13f3370d01937e2
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
tchateig/td_spectre
Select target project
No results found
1e2fa05c4daf2ef3ea1dca1cc13f3370d01937e2
Select Git revision
Branches
master
Swap
Target
SR07/td_spectre
Select target project
huruiqi/td_spectre
tchateig/td_spectre
SR07/td_spectre
3 results
master
Select Git revision
Branches
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
cachetime
· 1e2fa05c
Terence Chateigne
authored
4 years ago
1e2fa05c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cachetime.c
+13
-6
13 additions, 6 deletions
cachetime.c
with
13 additions
and
6 deletions
cachetime.c
View file @
1e2fa05c
...
...
@@ -17,23 +17,30 @@ int main(int argc, const char **argv)
array
[
i
*
4096
]
=
1
;
// Vider le tableau du cache
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
i
=
0
;
i
<
10
;
i
++
)
{
// TODO Vidage d'une ligne de cache
_mm_clflush
(
&
array
[
i
*
4096
]);
}
// TODO Accéder à quelques éléments de array
for
(
i
=
5
;
i
<
10
;
i
++
)
{
addr
=
&
array
[
i
*
4096
];
junk
=
*
addr
;
}
// Mesurer les temps d'accès
for
(
i
=
0
;
i
<
10
;
i
++
)
{
addr
=
&
array
[
i
*
4096
];
// TODO prendre le timestamp CPU avant lecture
// TODO prendre le timestamp CPU avant lecture
time1
=
__rdtsc
();
junk
=
*
addr
;
// TODO calculer le temps écoulé dans time2
time2
=
__rdtsc
()
-
time1
;
printf
(
"Temps d'accès à array[%d * 4096]: %ld cycles CPU.
\n
"
,
i
,
time2
);
}
return
0
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.