[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 27 10:17:15 PDT 2020


tra added a comment.

In D76365#1946345 <https://reviews.llvm.org/D76365#1946345>, @tra wrote:

> Looks like the change breaks compilation for us:
>
>   In file included from <built-in>:1:
>   In file included from llvm_unstable/toolchain/lib/clang/google3-trunk/include/__clang_cuda_runtime_wrapper.h:104:
>   In file included from cuda/include/cuda_runtime.h:116: cuda/include/cuda_surface_types.h:91:42: error: illegal device builtin surface reference type 'surface<void, dim>' declared here
>   struct  __device_builtin_surface_type__  surface<void, dim> : public surfaceReference
>                                            ^
>   cuda/include/cuda_surface_types.h:91:42: note: 'surface<void, dim>' needs to be instantiated from a class template with the 2nd template argument as an integral value
>   1 error generated when compiling for sm_60.
>
>
> I'm investigating, but we may need to roll back this patch. Stay tuned.


It appears that the assumptions of what types the attributes can apply to are not valid. In CUDA headers they are also used on non-templated classes/structs. E.g in cuda/include/cuda_surface_types.h:74

  struct __attribute__((device_builtin_surface_type)) surface : public surfaceReference
  {
  ...
  };

I'll undo this patch until we can make it work.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76365/new/

https://reviews.llvm.org/D76365





More information about the cfe-commits mailing list