CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
67 lines
1.8 KiB
Markdown
67 lines
1.8 KiB
Markdown
# Jupyter Tools for TableGen
|
|
|
|
This folder contains notebooks relating to TableGen and a Jupyter kernel for
|
|
TableGen.
|
|
|
|
## Notebooks
|
|
|
|
[LLVM_TableGen.ipynb](LLVM_TableGen.ipynb) - A demo of the kernel's capabilities.
|
|
|
|
[tablegen_tutorial_part_1.ipynb](tablegen_tutorial_part_1.ipynb) - A tutorial on the TableGen language.
|
|
|
|
[sql_query_backend.ipynb](sql_query_backend.ipynb) - How to write a backend using
|
|
JSON output and Python.
|
|
|
|
Notebooks can be viewed in browser on Github or downloaded and run locally. If
|
|
that is not possible, there are Markdown versions next to the notebook files.
|
|
|
|
## TableGen Kernel
|
|
|
|
To use the kernel, first install it into jupyter.
|
|
|
|
If you have installed Jupyter into a virtual environment, adjust `python3` to
|
|
be the interpreter for that environment. This will ensure that tools run the
|
|
kernel in the correct context.
|
|
|
|
```shell
|
|
python3 -m tablegen_kernel.install
|
|
```
|
|
|
|
If you are going to open the notebook in an IDE like Visual Studio Code,
|
|
you should restart it now so that it will find the newly installed kernel.
|
|
|
|
Then run one of:
|
|
|
|
```shell
|
|
jupyter notebook
|
|
# Then in the notebook interface, select 'LLVM TableGen' from the 'New' menu.
|
|
|
|
# To run the example notebook in this folder.
|
|
jupyter notebook LLVM_TableGen.ipynb
|
|
|
|
# To use the kernel from the command line.
|
|
jupyter console --kernel tablegen
|
|
```
|
|
|
|
Or open the notebook in a tool with built in Jupyter support.
|
|
|
|
`llvm-tblgen` is expected to be either in the `PATH` or you can set
|
|
the environment variable `LLVM_TBLGEN_EXECUTABLE` to point to it directly.
|
|
|
|
If you see an error like this:
|
|
```shell
|
|
Cell In[8], line 2
|
|
// This is some tablegen
|
|
^
|
|
SyntaxError: invalid syntax
|
|
```
|
|
|
|
You are probably running the notebook using the iPython kernel. Make sure you
|
|
have selected the tablegen kernel.
|
|
|
|
To run the kernel's doctests do:
|
|
|
|
```shell
|
|
python3 tablegen_kernel/kernel.py
|
|
```
|