[WIP] Fix and improve parrot vs thrust example code - #71
Conversation
- `build-docs.sh` uses uv to run `generate_comparisons.py` - fix path `script` -> `scripts`
The thrust code has `uniform_int_distribution<int> dist(10, 99)`.
for a more accurate code ratio
still missing arg passing, exaggerating ratio
also removed reshape, which wasn't in the thrust example?
- extract vars: R, C - fix random distribution [10, 89] (not [0, 99])
it could be argued that the intermiddiate prints should not be included as part of the ratio
- extract vars: lo, hi - add missing print, negated values - rename args to match thrust example
something is filtering the entire block if it contains `// TODO`
Matches the thrust code. An example of using scalar repeat is found in the saxpy example.
|
Thanks for this PR! Let me know if I can help with the devcontainer issues. I don't have Windows but I still might be able to help troubleshoot. Looks like other than clang-format, ci is passing. Although there is a GHA that runs the example tests and thrust comparisons - so we should run that on this branch as well. |
33412e3 to
3abfb66
Compare
|
I've figured something out, I think it's to do with how the # docker compose exec parrot-dev bash
time="2025-11-22T04:15:46Z" level=warning msg="The \"LD_LIBRARY_PATH\" variable is not set. Defaulting to a blank string."
OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found in $PATHThe ">Dev Containers: Clone Repository in [Named] Container Volume..." option didn't work either, but things work fine under my Debian WSL instance (as it should). Looking at my devcontainer logs, the problem seems to be that As I've got something working, I'll start fixing it up this PR first. |
Really cool project, I wanted to have a go but found some of the parrot vs thrust example code misleading, which slightly inflates the code reduction. Unfortunately I haven't been able to get a working dev environment, so these changes were made purely by referring to the docs.
A common bug I found was translating
into
rather than
There are also a handful of features that are undocumented. I'd love to get some advice as to where I should take this. Here were some of my thoughts:
TODO
To Consider
// todocommentsrange(start, end)operator=worksoperator[](multidimensional in C++23!)