-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL][Docs] Implement compile and link for source-based kernel bundles #17442
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
Changes from 14 commits
70be072
419929a
147cb3d
7fc5202
4ef1ce4
14b44c4
3592e0d
18a0310
5472cc9
3d5ef96
a7d51ce
6d7a894
6bb6050
d947479
8df3327
3683732
b03367f
8fa8545
2861344
449437f
c33808d
70c692a
2f42578
2989462
cdec73e
aa9f502
f900a6a
3cc2029
02fca8f
b5324f0
d6dc083
81943ea
62f06fc
5a189dc
daeacc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -271,8 +271,8 @@ kernel_bundle<bundle_state::executable> build( | |
|
|
||
| _Constraints:_ Available only when `PropertyListT` is an instance of | ||
| `sycl::ext::oneapi::experimental::properties` which contains no properties | ||
| other than those listed below in the section "New properties for the `build` | ||
| function". | ||
| other than those listed below in the section "New properties for the `build` and | ||
| `compile` functions". | ||
|
|
||
| _Effects (1):_ The source code from `sourceBundle` is translated into one or more | ||
| device images of state `bundle_state::executable`, and a new kernel bundle is | ||
|
|
@@ -317,6 +317,80 @@ source code used to create the kernel bundle being printed to the terminal. | |
| In situations where this is undesirable, developers must ensure that the | ||
| exception is caught and handled appropriately. | ||
| _{endnote}_] | ||
|
|
||
| a| | ||
| [frame=all,grid=none] | ||
| !==== | ||
| a! | ||
| [source] | ||
| ---- | ||
| namespace sycl::ext::oneapi::experimental { | ||
|
|
||
| template<typename PropertyListT = empty_properties_t> (1) | ||
| kernel_bundle<bundle_state::object> compile( | ||
| const kernel_bundle<bundle_state::ext_oneapi_source>& sourceBundle, | ||
| const std::vector<device>& devs, PropertyListT props={}) | ||
|
|
||
| template<typename PropertyListT = empty_properties_t> (2) | ||
| kernel_bundle<bundle_state::object> compile( | ||
| const kernel_bundle<bundle_state::ext_oneapi_source>& sourceBundle, | ||
| PropertyListT props = {}) | ||
steffenlarsen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| } // namespace sycl::ext::oneapi::experimental | ||
| ---- | ||
| !==== | ||
|
|
||
|
|
||
| _Constraints:_ Available only when `PropertyListT` is an instance of | ||
| `sycl::ext::oneapi::experimental::properties` which contains no properties | ||
| other than those listed below in the section "New properties for the `build` and | ||
| `compile` functions". | ||
|
|
||
| _Effects (1):_ The source code from `sourceBundle` is translated into one or | ||
| more device images of state `bundle_state::object`, and a new kernel bundle is | ||
| created to contain these device images. | ||
| The new bundle represents all of the kernels in `sourceBundle` that are | ||
| compatible with at least one of the devices in `devs`. | ||
| Any remaining kernels (those that are not compatible with any of the devices in | ||
| `devs`) are not represented in the new kernel bundle. | ||
|
|
||
| The new bundle has the same associated context as `sourceBundle`, and the new | ||
| bundle's set of associated devices is `devs` (with duplicate devices removed). | ||
|
|
||
| _Effects (2)_: Equivalent to | ||
| `compile(sourceBundle, sourceBundle.get_devices(), props)`. | ||
|
|
||
| _Returns:_ The newly created kernel bundle, which has `object` state. | ||
|
|
||
| _Throws:_ | ||
|
|
||
| * An `exception` with the `errc::invalid` error code if `source` was not created | ||
| with `source_language::sycl` or was the result of `sycl::join` taking one or | ||
| more `kernel_bundle` objects not created with `source_language::sycl`. | ||
|
||
|
|
||
| * An `exception` with the `errc::invalid` error code if any of the devices in | ||
| `devs` is not contained by the context associated with `sourceBundle`. | ||
|
|
||
| * An `exception` with the `errc::invalid` error code if any of the devices in | ||
| `devs` does not support compilation of kernels in the source language of | ||
| `sourceBundle`. | ||
|
|
||
| * An `exception` with the `errc::invalid` error code if `props` contains an | ||
| `build_options` property that specifies an invalid option. | ||
|
|
||
| * An `exception` with the `errc::build` error code if the compilation operation | ||
| fails. In this case, the exception `what` string provides a full build log, | ||
| including descriptions of any errors, warning messages, and other | ||
| diagnostics. | ||
| This string is intended for human consumption, and the format may not be | ||
| stable across implementations of this extension. | ||
|
|
||
| [_Note:_ An uncaught `errc::build` exception may result in some or all of the | ||
| source code used to create the kernel bundle being printed to the terminal. | ||
| In situations where this is undesirable, developers must ensure that the | ||
| exception is caught and handled appropriately. | ||
| _{endnote}_] | ||
|
|
||
| |==== | ||
|
|
||
| === New properties for the `create_kernel_bundle_from_source` function | ||
|
|
@@ -384,10 +458,10 @@ _Throws (3):_ | |
| entry with `name` in this property. | ||
| |==== | ||
|
|
||
| === New properties for the `build` function | ||
| === New properties for the `build` and `compile` functions | ||
|
|
||
| This extension adds the following properties, which can be used in conjunction | ||
| with the `build` function that is defined above: | ||
| with the `build` and `compile` function that is defined above: | ||
|
|
||
| |==== | ||
| a| | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.