Skip to content

Commit 24b1271

Browse files
committed
add comments
Signed-off-by: gejin <[email protected]>
1 parent 1472761 commit 24b1271

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,6 +3500,12 @@ pi_result piKernelCreate(pi_program Program, const char *KernelName,
35003500
ze_result_t ZeResult = ZE_RESULT_ERROR_INVALID_KERNEL_NAME;
35013501
_pi_program::ModuleIterator ModIt(Program);
35023502
while (!ModIt.Done()) {
3503+
// For a module with valid sycl kernel inside, zeKernelCreate API
3504+
// should return ZE_RESULT_SUCCESS if target kernel is found and
3505+
// ZE_RESULT_ERROR_INVALID_KERNEL_NAME otherwise. However, some module
3506+
// may not include any sycl kernel such as device library modules. For such
3507+
// modules, zeKernelCreate will return ZE_RESULT_ERROR_INVALID_ARGUMENT and
3508+
// we should skip them.
35033509
uint32_t KernelNum = 0;
35043510
ZE_CALL(zeModuleGetKernelNames, (*ModIt, &KernelNum, nullptr));
35053511
if (KernelNum != 0) {

0 commit comments

Comments
 (0)