[PATCH] D110089: [CUDA] Implement experimental support for texture lookups.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 7 09:59:40 PDT 2021


tra added a comment.

In D110089#3047161 <https://reviews.llvm.org/D110089#3047161>, @kgk wrote:

> Will the new macros in this patch also be useful for supporting the surface-related methods that also use __nv_tex_surf_handler (from surface_indirect_functions.h)?
>
> I gave this new code a try with surf2Dread and surf2Dwrite, and based on the errors, it look like it may just be a matter of creating the right mappings from Tag to the correct asm using these new macros (e.g. __isurf2Dwrite_v2 and isurf2Dread).

Only textures are supported at the moment, but adding support for surface operations would indeed be very similar.

Basically we just need to add specializations for the surface operations. It's fairly tedious, but straightforward in principle.



================
Comment at: clang/lib/Headers/__clang_cuda_texture_intrinsics.h:61-64
+// First, we need a perfect hash function and a few constexpr helper functions
+// for converting a string literal into a numeric value which can be used to
+// parametrize a template. We can not use string literals for that as that would
+// require C++20.
----------------
An alternative would be to use something like this: https://github.com/gelldur/gcpp/blob/master/src/gcpp/string/ConstexprString.hpp

That would be a bit too complicated for this limited use case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110089



More information about the cfe-commits mailing list