Skip to content

Commit 3f10fd4

Browse files
committed
[libclc] Workaround AMDGPU GlobalOffset assert
After removing the always_inline, we are getting assert in getLoads in GlobalOffset because of phi. Add back the always inline temporarily to workaround the assert.
1 parent 9ae38d9 commit 3f10fd4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libclc/libspirv/lib/amdgcn/workitem/get_group_id.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <libspirv/spirv.h>
1010

11-
_CLC_DEF _CLC_OVERLOAD size_t __spirv_BuiltInWorkgroupId(int dim) {
11+
__attribute__((always_inline)) _CLC_DEF _CLC_OVERLOAD size_t __spirv_BuiltInWorkgroupId(int dim) {
1212
switch (dim) {
1313
case 0:
1414
return __builtin_amdgcn_workgroup_id_x();

libclc/libspirv/lib/generic/workitem/get_global_id.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <libspirv/spirv.h>
1010

11-
_CLC_DEF _CLC_OVERLOAD size_t __spirv_BuiltInGlobalInvocationId(int dim) {
11+
__attribute__((always_inline)) _CLC_DEF _CLC_OVERLOAD size_t __spirv_BuiltInGlobalInvocationId(int dim) {
1212
return __spirv_BuiltInWorkgroupId(dim) * __spirv_BuiltInWorkgroupSize(dim) +
1313
__spirv_BuiltInLocalInvocationId(dim) +
1414
__spirv_BuiltInGlobalOffset(dim);

0 commit comments

Comments
 (0)