-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report error if
intel_reqd_sub_group_size
` cannot be satisfied
Without this change, IGC silently switches to SIMD16 for kernels with nested stackcalls even though a kernel has `intel_reqd_sub_group_size(32)`` attribute attached
- Loading branch information
Showing
3 changed files
with
85 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
IGC/ocloc_tests/features/reqd_sub_group_size/report_error.cl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*========================== begin_copyright_notice ============================ | ||
Copyright (C) 2024 Intel Corporation | ||
SPDX-License-Identifier: MIT | ||
============================= end_copyright_notice ===========================*/ | ||
|
||
// REQUIRES: dg2-supported | ||
// RUN: not ocloc compile -file %s -device dg2 | FileCheck %s | ||
|
||
// IGC enables EUFusion CallWA for DG2 when nested stackcalls or indirect calls | ||
// are present in a module. The workaround is not supported in SIMD32. This test | ||
// verifies if a proper error message is printed if CallWA is required and | ||
// intel_reqd_sub_group_size kernel attribute is set to 32. | ||
|
||
// CHECK: error: Cannot compile a kernel in the SIMD mode specified by intel_reqd_sub_group_size(32) | ||
// CHECK-NEXT: in kernel: 'test_simple' | ||
|
||
int fact(int n) { | ||
return n < 2 ? 1 : n * fact(n - 1); | ||
} | ||
|
||
__attribute__((intel_reqd_sub_group_size(32))) | ||
kernel void test_simple(global int* out, int n) { | ||
out[0] = fact(n); | ||
} |