Skip to content

Commit 0c95f2f

Browse files
committed
Assert presence of user-range argument.
Signed-off-by: Julian Oppermann <[email protected]>
1 parent 17f6365 commit 0c95f2f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

sycl/source/detail/jit_compiler.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -713,15 +713,16 @@ jit_compiler::fuseKernels(QueueImplPtr Queue,
713713
!Args.empty()) {
714714
auto &A0 = Args[0];
715715
auto Dims = KernelCG->MNDRDesc.Dims;
716-
if (A0.MPtr && A0.MSize == static_cast<int>(Dims * sizeof(size_t)) &&
717-
A0.MType == kernel_param_kind_t::kind_std_layout) {
718-
size_t *UGS = reinterpret_cast<size_t *>(A0.MPtr);
719-
// Range-rounding only applies to the first dimension.
720-
assert(UGS[0] > KernelCG->MNDRDesc.GlobalSize[1]);
721-
assert(Dims < 2 || UGS[1] == KernelCG->MNDRDesc.GlobalSize[1]);
722-
assert(Dims < 3 || UGS[2] == KernelCG->MNDRDesc.GlobalSize[2]);
723-
UserGlobalSize = UGS[0];
724-
}
716+
assert(A0.MPtr && A0.MSize == static_cast<int>(Dims * sizeof(size_t)) &&
717+
A0.MType == kernel_param_kind_t::kind_std_layout &&
718+
"Unexpected signature for rounded range kernel");
719+
720+
size_t *UGS = reinterpret_cast<size_t *>(A0.MPtr);
721+
// Range-rounding only applies to the first dimension.
722+
assert(UGS[0] > KernelCG->MNDRDesc.GlobalSize[1]);
723+
assert(Dims < 2 || UGS[1] == KernelCG->MNDRDesc.GlobalSize[1]);
724+
assert(Dims < 3 || UGS[2] == KernelCG->MNDRDesc.GlobalSize[2]);
725+
UserGlobalSize = UGS[0];
725726
}
726727

727728
::jit_compiler::SYCLArgumentDescriptor ArgDescriptor{Args.size()};

0 commit comments

Comments
 (0)