Skip to content
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

Add anatomy example to index page #182

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tomdeakin
Copy link

People new to SYCL might want to see a simple SYCL program so that they can then investigate the APIs further in the rest of this reference page, so I've included the anatomy example from the SYCL 2020 spec on the main page

People new to SYCL might want to see a simple SYCL program so that they
can then investigate the APIs further in the rest of this reference
page, so I've included the anatomy example from the SYCL 2020 spec on
the main page
@CLAassistant
Copy link

CLAassistant commented Mar 28, 2024

CLA assistant check
All committers have signed the CLA.

source/anatomy.cpp Outdated Show resolved Hide resolved
source/index.rst Outdated
[source,,linenums]
----
include::anatomy.cpp[lines=4..-1]
----
Copy link
Contributor

Choose a reason for hiding this comment

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

This is Asciidoc syntax, which causes a build error because these docs are using reStructuredText (rst). I don't know this documentation tool well, but you can see an example of how to add a code snippet in "source/iface/device-selector.rst":

.. literalinclude:: /examples/gpu-selector.cpp
   :lines: 5-
   :linenos:

I think you want something like that.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @gmlueck - I'm struggling to get local builds working on my machine. Do you know if there is a straight forward way to get all the plugins installed locally?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was a while ago, but I think I just installed Python 3 and then:

$ pip install -r requirements.txt

Copy link
Contributor

Choose a reason for hiding this comment

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

Then to do a build:

$ make html

The output is in "build/html"

source/anatomy.cpp Outdated Show resolved Hide resolved
A basic SYCL program, taken from the SYCL 2020 specification, looks like this:

.. literalinclude:: /examples/anatomy.cpp
:lines: 5-
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
:lines: 5-
:lines: 4-

I think you want this, unless you are intentionally omitting the #include <iostream>

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.

3 participants