Skip to content

Commit c560a62

Browse files
committed
Apply comments
Added an example of composite constant descriptor. Fixed a few typos. Applied clang-format
1 parent fa47324 commit c560a62

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

sycl/include/CL/sycl/detail/pi.hpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,20 +359,29 @@ class DeviceBinaryImage {
359359
return Format;
360360
}
361361

362-
/// Gets the iterator range over scalar specialization constants in this this
362+
/// Gets the iterator range over scalar specialization constants in this
363363
/// binary image. For each property pointed to by an iterator within the
364-
/// range, the name of the property is the specializaion constant symbolic ID
364+
/// range, the name of the property is the specialization constant symbolic ID
365365
/// and the value is 32-bit unsigned integer ID.
366366
const PropertyRange &getScalarSpecConstants() const {
367367
return ScalarSpecConstIDMap;
368368
}
369369
/// Gets the iterator range over composite specialization constants in this
370-
/// this binary image. For each property pointed to by an iterator within the
371-
/// range, the name of the property is the specializaion constant symbolic ID
370+
/// binary image. For each property pointed to by an iterator within the
371+
/// range, the name of the property is the specialization constant symbolic ID
372372
/// and the value is a list of tuples of 32-bit unsigned integer values, which
373-
/// encode scalar specialization constants, that form a composite one.
373+
/// encode scalar specialization constants, that form the composite one.
374374
/// Each tuple consist of ID of scalar specialization constant, its location
375375
/// within a composite (offset in bytes from the beginning) and its size.
376+
/// For example, for the following structure:
377+
/// struct A { int a; float b; };
378+
/// struct POD { A a[2]; int b; };
379+
/// List of tuples will look like:
380+
/// { ID0, 0, 4 }, // .a[0].a
381+
// { ID1, 4, 4 }, // .a[0].b
382+
// { ID2, 8, 4 }, // .a[1].a
383+
// { ID3, 12, 4 }, // .a[1].b
384+
// { ID4, 16, 4 }, // .b
376385
const PropertyRange &getCompositeSpecConstants() const {
377386
return CompositeSpecConstIDMap;
378387
}

sycl/test/composite-spec-const.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@ int main(int argc, char **argv) {
7474

7575
q.submit([&](cl::sycl::handler &cgh) {
7676
auto acci = bufi.get_access<cl::sycl::access::mode::write>(cgh);
77-
cgh.single_task<Test>(
78-
program.get_kernel<Test>(),
79-
[=]() {
80-
acci[0] = pod.get();
81-
});
77+
cgh.single_task<Test>(program.get_kernel<Test>(),
78+
[=]() { acci[0] = pod.get(); });
8279
});
8380
} catch (cl::sycl::exception &e) {
8481
std::cout << "*** Exception caught: " << e.what() << "\n";

0 commit comments

Comments
 (0)