-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Document for Code Usage Notes #37
Comments
Hi @wimrijnders, I agree this is a good thing to document. "Code Usage Notes" sounds a bit vague to me. The particular example you give seems to fit better into a "Known Limitations" document. With more examples of the things you want to include, we might come up with a better name, or even decide that multiple documents (or sections) are required, rather than one. |
OK. I have more things to document over various subjects and I was looking for a general tital. This particular thing was indeed a 'known limitation', but I also want to add parts on for example the code generators and the working of the QPU, as far as I understand it until now. If you have a better term, please let me know. 'Developer Notes' perhaps? |
How about I start it out with a 'Known Limitations' page? And see where it leads from there? |
This would be another item I would like to add to 'Known Limitations'. Float multiplication on the QPU always rounds downwardsMost CPU's make an effort to round up or down to the value nearest to the actual result of a multiplication. The This means that there will be small differences in the outputs of the exact same calculation on the CPU and a QPU; at first only in the least significant bits, but if you continue calculating, the differences will accumulate. Expect results to differ between CPU and QPU calculations. Of special note, the results between the |
Another chapter which find useful, in light of recent experiences. Handling privilegesIn order to use the You might run into the following situation (e.g.):
The solution for this is to become a member of group
Where you fill in a relevant user name for Unfortunately, this solution will not work for access to |
@mn416 Note the edits in previous comment "Handling privileges". |
Another chapter. Putting it here to get rid of the postit's littering my desk. Heap sizes are fixedHeaps are used in several locations of the The heaps have an upper limit in size; If you application is complex enough, you're are likely to run into them. Error messages will be shown that indicate the problem. Heap sizes can be adjusted easily enough by adjusting the heap size and recompiling. |
New chapter, based on recent insights. Known limitations for old distributionsFollowing is known to occur with Certain expected functions are not defined yetNotably, missing in in
There is a check on the presence of these function definitions in the Makefile; if not detected, However, the detection is not foolproof. If you get compilation errors anyway due to absence of these #USE_BCM_HEADERS:= $(shell grep bcm_host_get_peripheral_address /opt/vc/include/bcm_host.h && echo "no" || echo "yes")
USE_BCM_HEADERS:=no # <---- use this instead Known limitations with compiler
class Klass {
Klass(): m_value(0) {} // <-- Use this instead
int m_value{0}; // <-- This won't compile
}
Known cases (there may be more):
|
@mn416 Can you agree that a 'Known Limitations' document is a good idea? Can I add it to |
I would appreciate an overall document that lists the special attributes of the library. The goal is to make the code more understandable and to get any potential up to speed quicker.
@mn416 Would like to hear if you think this is a good idea, and if the format is OK. If so, I'll flesh it out with the items I have pending for it
Code Usage Notes
This document contains specific things to know, gotcha's and limitations of the
QPULib
library. By being aware of these things, it is hoped that the code will be easier to use for your own purposes.Function
compile()
is not Thread-SafeFunction
compile()
is used to compile a kernel from a class generator definition into a format that is runnable on a QPU. This uses global heaps internally for e.g. generating the AST and for storing the resulting statements.Because the heaps are global, running
compile()
parallel on different threads will lead to problems. The result of the compile, however, should be fine, so it's possible to have multiple kernel instances on different threads.As long a you run
compile()
on a single thread at a time, you're OK.....<more to come>...
The text was updated successfully, but these errors were encountered: