Skip to content

Commit 737abfb

Browse files
committed
Try to be more elaborate about offset in DPC++ RT section
1 parent 6bd7cb8 commit 737abfb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sycl/doc/design/SYCL2020-SpecializationConstants.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,14 @@ pi_result piextProgramSetSpecializationConstant(pi_program prog,
959959
Plugin Interface function for descriptor of each property: `spec_id` and
960960
`spec_size` are taken from the descriptor, `spec_value` is calculated based on
961961
address of the specialization constant provided by user and `offset` field of
962-
the descriptor.
962+
the descriptor as `(char*)(SpecConstantValuesMap[SymbolicID]) + offset`.
963+
964+
That calculation is required, because at SPIR-V level composite
965+
specialization constants are respresented by several specialization constants
966+
for each element of a composite, whilst on a SYCL level, the whole composite
967+
is passed by user as a single blob of data. `offset` field from properties is
968+
used to specify which exact piece of that blob should be extracted to perform
969+
per-element composite specialization constant initialization.
963970

964971
If native specialization constants are not supported by the target device, then
965972
the runtime calculates the location (offset) of each specialization constant in

0 commit comments

Comments
 (0)