Skip to content

Create executable notebook for simple vector add example#3047

Open
bkmgit wants to merge 1 commit into
google:masterfrom
bkmgit:vector-add-tutorial
Open

Create executable notebook for simple vector add example#3047
bkmgit wants to merge 1 commit into
google:masterfrom
bkmgit:vector-add-tutorial

Conversation

@bkmgit
Copy link
Copy Markdown
Contributor

@bkmgit bkmgit commented May 11, 2026

Start of creating a notebook. Possible changes include:

  • Examining produced assembly code
  • Getting information about the machine architecture
  • Profiling the code
  • Enable export to other formats
  • Enable all the documentation to be written in a notebook or a way to synchronize examples, documentation and notebooks
  • Use the Xeus-cpp kernel or c-kernel instead of going to a shell

@bkmgit
Copy link
Copy Markdown
Contributor Author

bkmgit commented May 11, 2026

An example executable book https://docs.hpx.dev/latest/html/index.html

@jan-wassenberg
Copy link
Copy Markdown
Member

Neat! Would you be able to do a quick demo at the upcoming meeting?

Comment thread tutorials/README.md

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants