Create executable notebook for simple vector add example#3047
Conversation
|
An example executable book https://docs.hpx.dev/latest/html/index.html |
|
Neat! Would you be able to do a quick demo at the upcoming meeting? |
|
|
||
| This folder contains tutorials introducing Highway. The | ||
| tutorials are in Jupyter notebooks. They can be run on | ||
| your own machine, but can also be run through a web browser |
There was a problem hiding this comment.
Can add mention on how to run these locally?
| "cell_type": "code", | ||
| "source": [ | ||
| "!g++ -std=c++17 -O3 -I/content/highway_install/include -o vector_add_hwy.o -c vector_add_hwy.cpp\n", | ||
| "!g++ -o vector_add_hwy vector_add_hwy.o -L/content/highway_install/lib -lhwy_contrib -lhwy\n", |
There was a problem hiding this comment.
Let's add -I/ for the above.
| "// For dynamic dispatch, specify the name of the current file (unfortunately\n", | ||
| "// __FILE__ is not reliable) so that foreach_target.h can re-include it.\n", | ||
| "// The absolute path seems to be required\n", | ||
| "#define HWY_TARGET_INCLUDE \"/content/vector_add_hwy.cpp\"\n", |
There was a problem hiding this comment.
It's good practice to avoid absolute paths in includes. Just "vector_add_hwy"?
| "!cmake -GNinja \\\n", | ||
| " -DHWY_ENABLE_TESTS=OFF \\\n", | ||
| " -DHWY_ENABLE_EXAMPLES=OFF \\\n", | ||
| " -DHWY_ENABLE_CONTRIB=ON \\\n", |
There was a problem hiding this comment.
Shall we disable CONTRIB to speed up the build?
Also, if we were to build PPAs, how would those be referenced from the install step here?
There was a problem hiding this comment.
Disabling CONTRIB can help. It may be helpful to give a choice of building or installing a PPA. Going through the steps of building can be helpful for someone to build on their own machine.
Checking on PPAs at https://documentation.ubuntu.com/launchpad/user/reference/packaging/ppas/ppa/
There is an action that will help with this https://github.com/marketplace/actions/publish-ppa-package
Some people also use org-mode to create notebooks:
There was a problem hiding this comment.
OK, agree it would be nice to set ENABLE_CONTRIB=OFF here :)
Nice find with the PPA action! Would you like to send a separate PR adding that workflow for manual dispatch (by adding a workflow_dispatch section)? I'd be willing to run this after releases.
Start of creating a notebook. Possible changes include: