Skip to content

Commit ea1008a

Browse files
committed
Small fixes in spec doc examples
1 parent 0df930d commit ea1008a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ int main() {
818818
extern "C"
819819
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::nd_range_kernel<1>))
820820
void iota(float start, float *ptr) {
821-
size_t id = syclext::this_work_item::get_nd_item().get_global_linear_id();
821+
size_t id = syclext::this_work_item::get_nd_item<1>().get_global_linear_id();
822822
ptr[id] = start + static_cast<float>(id);
823823
}
824824
)""";
@@ -847,6 +847,7 @@ int main() {
847847
sycl::nd_range ndr{{NUM}, {WGSIZE}};
848848
cgh.parallel_for(ndr, iota);
849849
}).wait();
850+
sycl::free(ptr, q);
850851
}
851852
----
852853

@@ -874,13 +875,13 @@ int main() {
874875
875876
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::nd_range_kernel<1>))
876877
void iota(float start, float *ptr) {
877-
size_t id = syclext::this_work_item::get_nd_item().get_global_linear_id();
878+
size_t id = syclext::this_work_item::get_nd_item<1>().get_global_linear_id();
878879
ptr[id] = start + static_cast<float>(id);
879880
}
880881
881-
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::range_kernel<1>))
882+
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::nd_range_kernel<1>))
882883
void iota(int start, int *ptr) {
883-
size_t id = syclext::this_work_item::get_nd_item().get_global_linear_id();
884+
size_t id = syclext::this_work_item::get_nd_item<1>().get_global_linear_id();
884885
ptr[id] = start + static_cast<int>(id);
885886
}
886887
)""";
@@ -912,6 +913,7 @@ int main() {
912913
sycl::nd_range ndr{{NUM}, {WGSIZE}};
913914
cgh.parallel_for(ndr, iota);
914915
}).wait();
916+
sycl::free(ptr, q);
915917
}
916918
----
917919

0 commit comments

Comments
 (0)