Skip to content

Commit d8d1c3d

Browse files
authored
[SYCL][Doc] Fix specification example (#19701)
Fix a few syntax errors in the example for this extension.
1 parent 7f7360b commit d8d1c3d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_device_image_backend_content.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,24 +224,24 @@ namespace syclexp = sycl::ext::oneapi::experimental;
224224
225225
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::nd_range_kernel<1>))
226226
void iota(float start, float *ptr) {
227-
size_t id = syclext::this_work_item::get_nd_item().get_global_linear_id();
227+
size_t id = syclext::this_work_item::get_nd_item<1>().get_global_linear_id();
228228
ptr[id] = start + static_cast<float>(id);
229229
}
230230
231-
void main() {
231+
int main() {
232232
sycl::device d;
233233
sycl::queue q{d};
234234
sycl::context ctxt = q.get_context();
235235
236236
// Get a kernel bundle that contains the kernel "iota".
237-
sycl::kernel_id iota = syclexp::get_kernel_id<iota>();
237+
sycl::kernel_id iota_id = syclexp::get_kernel_id<iota>();
238238
auto exe_bndl =
239-
sycl::get_kernel_bundle<sycl::bundle_state::executable>(ctxt, {iota});
239+
sycl::get_kernel_bundle<sycl::bundle_state::executable>(ctxt, {iota_id});
240240
241241
std::vector<std::byte> bytes;
242-
for (auto& img: bundle) {
242+
for (auto& img: exe_bndl) {
243243
// Search for the device image that contains "iota" for this device.
244-
if (img.has_kernel(iota, dev)) {
244+
if (img.has_kernel(iota_id, d)) {
245245
bytes = img.ext_oneapi_get_backend_content();
246246
break;
247247
}

0 commit comments

Comments
 (0)