Comments (12)
And what is the use of the maker.template lines before the l2-doubleload
bandwidth tests? Are they offering shuffle regions for the bandwidth tests? (maybe I should open another issue?)
from uarch-bench.
Looks like a shell quoting issue: zsh
(your shell) is interpreting the *
, not uarch-bench. Try it like:
sudo ./uarch-bench.sh '--test-name=studies/memory/l2-doubleload/*normal*'
from uarch-bench.
And what is the use of the maker.template lines before the
l2-doubleload
bandwidth tests? Are they offering shuffle regions for the bandwidth tests? (maybe I should open another issue?)
Lines 422 through 434 are part of the l2-doubleload
tests. Each line defines an individual test. Take this line for example:
maker.template make<serial_double_load_oneload> ("single-load-16k", "Just one load 16k region", 1, []{ return &shuffled_region(16 * 1024); });
This defines a test called "single-load-16k" which calls the function serial_double_load_oneload
(written in asm) which is passed a "shuffled region" of 16 KiB (see the comments for "shuffled region" for what that is). The way the passed-in argument is used depends on the specific benchmark. This one does:
; one load only, as a baseline
define_bench serial_double_load_oneload
mov rsi, [rsi + region.start]
.top:
mov rcx, [rsi]
mov rsi, rcx
dec rdi
jnz .top
ret
I.e., it "pointer chases" across the region in a loop.
Did that answer your question?
from uarch-bench.
Looks like a shell quoting issue:
zsh
(your shell) is interpreting the*
, not uarch-bench. Try it like:sudo ./uarch-bench.sh '--test-name=studies/memory/l2-doubleload/*normal*'
This works! Thank you!
Lines 422 through 434 are part of the l2-doubleload tests. Each line defines an individual test.
I got it. Can I ask one more question? I notice that the region
is defined both in cpp and asm.
struc region
.size : resq 1
.start : resq 1
endstruc
struct region {
size_t size;
void *start; // actually a CacheLine object
};
I think instructions like mov rsi, [rsi + region.start]
are using the asm definition. After executing shuffled_region
in cpp and getting an address, how to pass the cpp struct data to the asm struct?
from uarch-bench.
I got it. Can I ask one more question?
Yes, of course, though in general I like separate issues for new questions.
I think instructions like mov rsi, [rsi + region.start] are using the asm definition.
That's correct, it's using nasm STRUC
support described here.
After executing shuffled_region in cpp and getting an address, how to pass the cpp struct data to the asm struct?
The 4th argument to maker.make
takes a function that returns a void *
, and this is passed to the asm where it is available in the rsi
register. The rdi
register contains the number of loops requested by the C++ code. A function is used instead of passing a void * directly in C++ to avoid running all the code for every test when the tests are just being registers: this lets us register the tests while referring the generation of their argument.
Does it make sense?
from uarch-bench.
Sorry I'm poor at c++. I am a little bit confused. How does the void *
pointer pass its value to the rsi
register? And how does the rsi
register pass it to region.start
?
from uarch-bench.
I don't think I can cover all the background required to understand this in a GitHub issue. I'm already linked to nasm STRUC doc, which is part of the puzzle, but you'll have to learn about x64 ABI and C++ for the rest.
In my experience you can get good answers on StackOverflow.
from uarch-bench.
Look up the SysV ABI to see how function parameters (in this case a void pointer) are passed to x86 registers. The second parameter goes in rsi by this convention.
from uarch-bench.
Thank you for all the answers! Maybe I don't express clearly. I do know that the first one goes to rdi
and second one to rsi
and so on. I will try to read nasm STRUC doc to see how the two structs are linked.
from uarch-bench.
from uarch-bench.
OK, totally got it. region.size
and region.start
are just offsets. Thanks for your patience and sorry for the trouble. Next time I will read the background first and then ask questions.
from uarch-bench.
from uarch-bench.
Related Issues (20)
- register-stalls.cpp function too giant HOT 1
- Compilation fails HOT 3
- store forwarding does not have fixed latency HOT 11
- prefetch performance test for AMD CPUs? HOT 1
- ERROR: jevents failed while reading events, error -5 HOT 2
- Cycles event sometimes gets unprogrammed with --extra-events
- [Feature Request]: A directory in the repo with numbers from different architectures HOT 4
- build fails if python2 not available
- perf timer should work on non-Intel HOT 4
- how can i test the performance of the snippet of assembly provided by myself HOT 2
- build error HOT 4
- remove MINSIGSTKSZ usage HOT 3
- 4GHz was detected as 8GHz HOT 13
- dead link on wiki HOT 3
- clock detectd is not right for hybrid CPU. HOT 6
- make: *** [Makefile:131: page-info.o] Error 127 HOT 1
- Questions about How much bandwidth does the L2 have to give, anyway? HOT 1
- Turboboost won't be disabled for isolated cores
- Issue building the package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uarch-bench.