[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 12 12:49:01 PDT 2024
================
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -x hip -aux-triple amdgcn-amd-amdhsa %s -fsyntax-only -verify
+
+#define __device__ __attribute__((device))
+
+__device__ __buffer_rsrc_t test_buffer_rsrc_t_device() {} // expected-warning {{non-void function does not return a value}}
+__buffer_rsrc_t test_buffer_rsrc_t_host() {} // expected-error {{'__buffer_rsrc_t' can only be used in device-side function}}
----------------
shiltian wrote:
@yxsamliu I forced that the type is only available if the target triple or the aux target triple is amdgpu. However, that doesn't force the check that `__buffer_rsrc_t` can only be used in device-side function. How do we do this kind of type check in Sema?
https://github.com/llvm/llvm-project/pull/94830
More information about the cfe-commits
mailing list