-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: main
Are you sure you want to change the base?
Conversation
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
source/index.rst
Outdated
[source,,linenums] | ||
---- | ||
include::anatomy.cpp[lines=4..-1] | ||
---- |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"
A basic SYCL program, taken from the SYCL 2020 specification, looks like this: | ||
|
||
.. literalinclude:: /examples/anatomy.cpp | ||
:lines: 5- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:lines: 5- | |
:lines: 4- |
I think you want this, unless you are intentionally omitting the #include <iostream>
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