Skip to content

libclc: Stop using asm declarations for r600 on amdgcn for get_global_size #128692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions libclc/amdgcn/lib/workitem/get_global_size.cl
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#include <clc/clc.h>

uint __clc_amdgcn_get_global_size_x(void) __asm("llvm.r600.read.global.size.x");
uint __clc_amdgcn_get_global_size_y(void) __asm("llvm.r600.read.global.size.y");
uint __clc_amdgcn_get_global_size_z(void) __asm("llvm.r600.read.global.size.z");

_CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
switch (dim) {
case 0:
return __clc_amdgcn_get_global_size_x();
return __builtin_amdgcn_grid_size_x();
case 1:
return __clc_amdgcn_get_global_size_y();
return __builtin_amdgcn_grid_size_y();
case 2:
return __clc_amdgcn_get_global_size_z();
return __builtin_amdgcn_grid_size_z();
default:
return 1;
}
Expand Down