@@ -271,8 +271,8 @@ kernel_bundle<bundle_state::executable> build(
271
271
272
272
_Constraints:_ Available only when `PropertyListT` is an instance of
273
273
`sycl::ext::oneapi::experimental::properties` which contains no properties
274
- other than those listed below in the section "New properties for the `build`
275
- function ".
274
+ other than those listed below in the section "New properties for the `build` and
275
+ `compile` functions ".
276
276
277
277
_Effects (1):_ The source code from `sourceBundle` is translated into one or more
278
278
device images of state `bundle_state::executable`, and a new kernel bundle is
@@ -316,6 +316,81 @@ source code used to create the kernel bundle being printed to the terminal.
316
316
In situations where this is undesirable, developers must ensure that the
317
317
exception is caught and handled appropriately.
318
318
_{endnote}_]
319
+
320
+ a|
321
+ [frame=all,grid=none]
322
+ !====
323
+ a!
324
+ [source]
325
+ ----
326
+ namespace sycl::ext::oneapi::experimental {
327
+
328
+ template<typename PropertyListT = empty_properties_t> (1)
329
+ kernel_bundle<bundle_state::object> compile(
330
+ const kernel_bundle<bundle_state::ext_oneapi_source>& source,
331
+ const std::vector<device>& devs, PropertyListT props={})
332
+
333
+ template<typename PropertyListT = empty_properties_t> (2)
334
+ kernel_bundle<bundle_state::executable> build(
335
+ const kernel_bundle<bundle_state::ext_oneapi_source>& sourceBundle,
336
+ PropertyListT props = {})
337
+
338
+ } // namespace sycl::ext::oneapi::experimental
339
+ ----
340
+ !====
341
+
342
+
343
+ _Constraints:_ Available only when `PropertyListT` is an instance of
344
+ `sycl::ext::oneapi::experimental::properties` which contains no properties
345
+ other than those listed below in the section "New properties for the `build` and
346
+ `compile` functions".
347
+
348
+ _Effects (1):_ The source code from `sourceBundle` is translated into one or
349
+ more device images of state `bundle_state::object`, and a new kernel bundle is
350
+ created to contain these device images.
351
+ The new bundle represents all of the kernels in `sourceBundle` that are
352
+ compatible with at least one of the devices in `devs`.
353
+ Any remaining kernels (those that are not compatible with any of the devices in
354
+ `devs`) are not represented in the new kernel bundle.
355
+
356
+ The new bundle has the same associated context as `sourceBundle`, and the new
357
+ bundle's set of associated devices is `devs` (with duplicate devices removed).
358
+
359
+ _Effects (2)_: Equivalent to `compile(sourceBundle, sourceBundle.get_devices(),
360
+ props)`.
361
+
362
+ _Returns:_ The newly created kernel bundle, which has `object` state.
363
+
364
+ _Throws:_
365
+
366
+ * An `exception` with the `errc::invalid` error code if `source` was not created
367
+ with `source_language::sycl` or `source_language::sycl_jit` or was the result
368
+ of `sycl::join` taking one or more `kernel_bundle` objects not created with
369
+ `source_language::sycl` or `source_language::sycl_jit`.
370
+
371
+ * An `exception` with the `errc::invalid` error code if any of the devices in
372
+ `devs` is not contained by the context associated with `sourceBundle`.
373
+
374
+ * An `exception` with the `errc::invalid` error code if any of the devices in
375
+ `devs` does not support compilation of kernels in the source language of
376
+ `sourceBundle`.
377
+
378
+ * An `exception` with the `errc::invalid` error code if `props` contains an
379
+ `options` property that specifies an invalid option.
380
+
381
+ * An `exception` with the `errc::build` error code if the compilation operation
382
+ fails. In this case, the exception `what` string provides a full build log,
383
+ including descriptions of any errors, warning messages, and other
384
+ diagnostics.
385
+ This string is intended for human consumption, and the format may not be
386
+ stable across implementations of this extension.
387
+
388
+ [_Note:_ An uncaught `errc::build` exception may result in some or all of the
389
+ source code used to create the kernel bundle being printed to the terminal.
390
+ In situations where this is undesirable, developers must ensure that the
391
+ exception is caught and handled appropriately.
392
+ _{endnote}_]
393
+
319
394
|====
320
395
321
396
=== New properties for the `create_kernel_bundle_from_source` function
@@ -383,10 +458,10 @@ _Throws (3):_
383
458
entry with `name` in this property.
384
459
|====
385
460
386
- === New properties for the `build` function
461
+ === New properties for the `build` and `compile` functions
387
462
388
463
This extension adds the following properties, which can be used in conjunction
389
- with the `build` function that is defined above:
464
+ with the `build` and `compile` function that is defined above:
390
465
391
466
|====
392
467
a|
0 commit comments