Skip to content
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

Missing tex2Dgather #176

Open
pvelesko opened this issue Oct 3, 2022 · 8 comments
Open

Missing tex2Dgather #176

pvelesko opened this issue Oct 3, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@pvelesko
Copy link
Collaborator

pvelesko commented Oct 3, 2022

From HIP unit tets HIP hipArrayCommon.hh

// read from a texture using normalized coordinates
constexpr size_t ChannelToRead = 1;
template <typename T>
__global__ void readFromTexture(T* output, hipTextureObject_t texObj, size_t width, size_t height,
                                bool textureGather) {
  #if !defined(__HIP_NO_IMAGE_SUPPORT) || !__HIP_NO_IMAGE_SUPPORT
  // Calculate normalized texture coordinates
  const unsigned int x = blockIdx.x * blockDim.x + threadIdx.x;
  const unsigned int y = blockIdx.y * blockDim.y + threadIdx.y;
  const float u = x / (float)width;

  // Read from texture and write to global memory
  if (height == 0) {
    output[x] = tex1D<T>(texObj, u);
  } else {
    const float v = y / (float)height;
    if (textureGather) {
      // tex2Dgather not supported on __gfx90a__
      #if !defined(__gfx90a__) && !(defined(__HIP_PLATFORM_SPIRV__))
      output[y * width + x] = tex2Dgather<T>(texObj, u, v, ChannelToRead);
      #else
      #warning("tex2Dgather not supported on gfx90a");
      #endif
    } else {
      output[y * width + x] = tex2D<T>(texObj, u, v);
    }
  }
  #endif
}
@pvelesko pvelesko added the enhancement New feature or request label Oct 3, 2022
@pvelesko
Copy link
Collaborator Author

pvelesko commented Oct 3, 2022

readFromTexture

@pvelesko
Copy link
Collaborator Author

pvelesko commented Oct 3, 2022

tex1D

@pvelesko
Copy link
Collaborator Author

pvelesko commented Oct 3, 2022

tex3D

@pvelesko
Copy link
Collaborator Author

pvelesko commented Oct 3, 2022

tex2DLayered

@pvelesko
Copy link
Collaborator Author

pvelesko commented Oct 3, 2022

tex3D

@pvelesko
Copy link
Collaborator Author

pvelesko commented Oct 3, 2022

tex1Dfetch

@pjaaskel pjaaskel added this to the 1.0 milestone Mar 22, 2023
@pjaaskel
Copy link
Collaborator

These might be a lot of work. Are these needed by apps of interest and is someone committed to implement by 1.0?

@linehill linehill removed this from the 1.0 milestone Jun 9, 2023
@linehill
Copy link
Collaborator

linehill commented Jun 9, 2023

Dropped from Milestone 1.0: so far no demand for fixing gaps in the texture support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants