diff --git a/hipamd/include/hip/amd_detail/host_defines.h b/hipamd/include/hip/amd_detail/host_defines.h index bb7f8d2b46..6c3438311d 100644 --- a/hipamd/include/hip/amd_detail/host_defines.h +++ b/hipamd/include/hip/amd_detail/host_defines.h @@ -50,6 +50,12 @@ THE SOFTWARE. #define __noinline__ __attribute__((noinline)) #define __forceinline__ inline __attribute__((always_inline)) +#if __HIP_NO_IMAGE_SUPPORT +#define __hip_img_chk__ __attribute__((unavailable("The image/texture API not supported on the device"))) +#else +#define __hip_img_chk__ +#endif + #else // Non-HCC compiler @@ -67,6 +73,7 @@ THE SOFTWARE. #define __shared__ #define __constant__ +#define __hip_img_chk__ #endif #endif diff --git a/hipamd/include/hip/amd_detail/texture_fetch_functions.h b/hipamd/include/hip/amd_detail/texture_fetch_functions.h index b2a3e0ddaf..47dfdbe9c2 100644 --- a/hipamd/include/hip/amd_detail/texture_fetch_functions.h +++ b/hipamd/include/hip/amd_detail/texture_fetch_functions.h @@ -138,7 +138,7 @@ struct __hip_tex_ret< }; template -static __forceinline__ __device__ __hip_tex_ret_t tex1Dfetch(texture t, int x) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex1Dfetch(texture t, int x) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_load_1Db(i, x); @@ -146,7 +146,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex1Dfetch(textur } template -static __forceinline__ __device__ __hip_tex_ret_t tex1D(texture t, float x) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex1D(texture t, float x) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_1D(i, s, x); @@ -154,7 +154,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex1D(texture -static __forceinline__ __device__ __hip_tex_ret_t tex2D(texture t, float x, float y) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex2D(texture t, float x, float y) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_2D(i, s, float2(x, y).data); @@ -162,7 +162,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex2D(texture -static __forceinline__ __device__ __hip_tex_ret_t tex1DLayered(texture t, float x, int layer) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex1DLayered(texture t, float x, int layer) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_1Da(i, s, float2(x, layer).data); @@ -170,7 +170,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex1DLayered(text } template -static __forceinline__ __device__ __hip_tex_ret_t tex2DLayered(texture t, float x, float y, int layer) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex2DLayered(texture t, float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); @@ -178,7 +178,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex2DLayered(text } template -static __forceinline__ __device__ __hip_tex_ret_t tex3D(texture t, float x, float y, float z) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex3D(texture t, float x, float y, float z) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); @@ -186,7 +186,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex3D(texture -static __forceinline__ __device__ __hip_tex_ret_t texCubemap(texture t, float x, float y, float z) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t texCubemap(texture t, float x, float y, float z) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_CM(i, s, float4(x, y, z, 0.0f).data); @@ -194,7 +194,7 @@ static __forceinline__ __device__ __hip_tex_ret_t texCubemap(textur } template -static __forceinline__ __device__ __hip_tex_ret_t tex1DLod(texture t, float x, float level) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex1DLod(texture t, float x, float level) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_lod_1D(i, s, x, level); @@ -202,7 +202,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex1DLod(texture< } template -static __forceinline__ __device__ __hip_tex_ret_t tex2DLod(texture t, float x, float y, float level) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex2DLod(texture t, float x, float y, float level) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); @@ -210,7 +210,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex2DLod(texture< } template -static __forceinline__ __device__ __hip_tex_ret_t tex1DLayeredLod(texture t, float x, int layer, float level) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex1DLayeredLod(texture t, float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); @@ -218,7 +218,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex1DLayeredLod(t } template -static __forceinline__ __device__ __hip_tex_ret_t tex2DLayeredLod(texture t, float x, float y, int layer, float level) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex2DLayeredLod(texture t, float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_lod_2Da(i, s, float4(x, y, layer, 0.0f).data, level); @@ -226,7 +226,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex2DLayeredLod(t } template -static __forceinline__ __device__ __hip_tex_ret_t tex3DLod(texture t, float x, float y, float z, float level) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex3DLod(texture t, float x, float y, float z, float level) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, level); @@ -234,7 +234,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex3DLod(texture< } template -static __forceinline__ __device__ __hip_tex_ret_t texCubemapLod(texture t, float x, float y, float z, float level) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t texCubemapLod(texture t, float x, float y, float z, float level) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_lod_CM(i, s, float4(x, y, z, 0.0f).data, level); @@ -242,7 +242,7 @@ static __forceinline__ __device__ __hip_tex_ret_t texCubemapLod(tex } template -static __forceinline__ __device__ __hip_tex_ret_t texCubemapLayered(texture t, float x, float y, float z, int layer) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t texCubemapLayered(texture t, float x, float y, float z, int layer) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_CMa(i, s, float4(x, y, z, layer).data); @@ -250,7 +250,7 @@ static __forceinline__ __device__ __hip_tex_ret_t texCubemapLayered } template -static __forceinline__ __device__ __hip_tex_ret_t texCubemapLayeredLod(texture t, float x, float y, float z, int layer, float level) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t texCubemapLayeredLod(texture t, float x, float y, float z, int layer, float level) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_lod_CMa(i, s, float4(x, y, z, layer).data, level); @@ -258,7 +258,7 @@ static __forceinline__ __device__ __hip_tex_ret_t texCubemapLayered } template -static __forceinline__ __device__ __hip_tex_ret_t texCubemapGrad(texture t, float x, float y, float z, float4 dPdx, float4 dPdy) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t texCubemapGrad(texture t, float x, float y, float z, float4 dPdx, float4 dPdy) { TEXTURE_PARAMETERS_INIT; // TODO missing in device libs. @@ -268,7 +268,7 @@ static __forceinline__ __device__ __hip_tex_ret_t texCubemapGrad(te } template -static __forceinline__ __device__ __hip_tex_ret_t texCubemapLayeredGrad(texture t, float x, float y, float z, int layer, float4 dPdx, float4 dPdy) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t texCubemapLayeredGrad(texture t, float x, float y, float z, int layer, float4 dPdx, float4 dPdy) { TEXTURE_PARAMETERS_INIT; // TODO missing in device libs. @@ -278,7 +278,7 @@ static __forceinline__ __device__ __hip_tex_ret_t texCubemapLayered } template -static __forceinline__ __device__ __hip_tex_ret_t tex1DGrad(texture t, float x, float dPdx, float dPdy) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex1DGrad(texture t, float x, float dPdx, float dPdy) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_grad_1D(i, s, x, dPdx, dPdy); @@ -286,7 +286,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex1DGrad(texture } template -static __forceinline__ __device__ __hip_tex_ret_t tex2DGrad(texture t, float x, float y, float2 dPdx, float2 dPdy) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex2DGrad(texture t, float x, float y, float2 dPdx, float2 dPdy) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, float2(dPdx.x, dPdx.y).data, float2(dPdy.x, dPdy.y).data); @@ -294,7 +294,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex2DGrad(texture } template -static __forceinline__ __device__ __hip_tex_ret_t tex1DLayeredGrad(texture t, float x, int layer, float dPdx, float dPdy) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex1DLayeredGrad(texture t, float x, int layer, float dPdx, float dPdy) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dPdx, dPdy); @@ -302,7 +302,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex1DLayeredGrad( } template -static __forceinline__ __device__ __hip_tex_ret_t tex2DLayeredGrad(texture t, float x, float y, int layer, float2 dPdx, float2 dPdy) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex2DLayeredGrad(texture t, float x, float y, int layer, float2 dPdx, float2 dPdy) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, float2(dPdx.x, dPdx.y).data, float2(dPdy.x, dPdy.y).data); @@ -310,7 +310,7 @@ static __forceinline__ __device__ __hip_tex_ret_t tex2DLayeredGrad( } template -static __forceinline__ __device__ __hip_tex_ret_t tex3DGrad(texture t, float x, float y, float z, float4 dPdx, float4 dPdy) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t tex3DGrad(texture t, float x, float y, float z, float4 dPdx, float4 dPdy) { TEXTURE_PARAMETERS_INIT; auto tmp = __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, float4(dPdx.x, dPdx.y, dPdx.z, 0.0f).data, float4(dPdy.x, dPdy.y, dPdy.z, 0.0f).data); @@ -361,7 +361,7 @@ struct __hip_tex2dgather_ret< }; template -static __forceinline__ __device__ __hip_tex2dgather_ret_t tex2Dgather(texture t, float x, float y, int comp=0) +static __forceinline__ __device__ __hip_img_chk__ __hip_tex2dgather_ret_t tex2Dgather(texture t, float x, float y, int comp=0) { TEXTURE_PARAMETERS_INIT; switch (comp) { diff --git a/hipamd/include/hip/amd_detail/texture_functions.h b/hipamd/include/hip/amd_detail/texture_functions.h deleted file mode 100644 index e9bfe70197..0000000000 --- a/hipamd/include/hip/amd_detail/texture_functions.h +++ /dev/null @@ -1,11102 +0,0 @@ -/* -Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#ifndef HIP_INCLUDE_HIP_AMD_DETAIL_TEXTURE_FUNCTIONS_H -#define HIP_INCLUDE_HIP_AMD_DETAIL_TEXTURE_FUNCTIONS_H -#include -#include - -#pragma push_macro("TYPEDEF_VECTOR_VALUE_TYPE") -#define TYPEDEF_VECTOR_VALUE_TYPE(SCALAR_TYPE) \ -typedef SCALAR_TYPE __hip_##SCALAR_TYPE##2_vector_value_type __attribute__((ext_vector_type(2))); \ -typedef SCALAR_TYPE __hip_##SCALAR_TYPE##3_vector_value_type __attribute__((ext_vector_type(3))); \ -typedef SCALAR_TYPE __hip_##SCALAR_TYPE##4_vector_value_type __attribute__((ext_vector_type(4))); \ -typedef SCALAR_TYPE __hip_##SCALAR_TYPE##8_vector_value_type __attribute__((ext_vector_type(8))); \ -typedef SCALAR_TYPE __hip_##SCALAR_TYPE##16_vector_value_type __attribute__((ext_vector_type(16))); - -TYPEDEF_VECTOR_VALUE_TYPE(float); -TYPEDEF_VECTOR_VALUE_TYPE(int); -TYPEDEF_VECTOR_VALUE_TYPE(uint); - -#undef TYPEDEF_VECTOR_VALUE_TYPE -#pragma pop_macro("TYPEDEF_VECTOR_VALUE_TYPE") - -union TData { - __hip_float4_vector_value_type f; - __hip_int4_vector_value_type i; - __hip_uint4_vector_value_type u; -}; - -#define __TEXTURE_FUNCTIONS_DECL__ static inline __device__ - - -#if __clang__ -#define ADDRESS_SPACE_CONSTANT __attribute__((address_space(4))) -#else -#define ADDRESS_SPACE_CONSTANT __attribute__((address_space(2))) -#endif - -#define TEXTURE_PARAMETERS_INIT \ - unsigned int ADDRESS_SPACE_CONSTANT* i = (unsigned int ADDRESS_SPACE_CONSTANT*)textureObject; \ - unsigned int ADDRESS_SPACE_CONSTANT* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ - TData texel; -#define TEXTURE_REF_PARAMETERS_INIT \ - unsigned int ADDRESS_SPACE_CONSTANT* i = (unsigned int ADDRESS_SPACE_CONSTANT*)texRef.textureObject; \ - unsigned int ADDRESS_SPACE_CONSTANT* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ - TData texel; -#define TEXTURE_SET_FLOAT *retVal = texel.f.x; - -#define TEXTURE_SET_SIGNED *retVal = texel.i.x; - -#define TEXTURE_SET_UNSIGNED *retVal = texel.u.x; - -#define TEXTURE_SET_FLOAT_X retVal->x = texel.f.x; - -#define TEXTURE_SET_SIGNED_X retVal->x = texel.i.x; - -#define TEXTURE_SET_UNSIGNED_X retVal->x = texel.u.x; - -#define TEXTURE_SET_FLOAT_XY \ - retVal->x = texel.f.x; \ - retVal->y = texel.f.y; - -#define TEXTURE_SET_SIGNED_XY \ - retVal->x = texel.i.x; \ - retVal->y = texel.i.y; - -#define TEXTURE_SET_UNSIGNED_XY \ - retVal->x = texel.u.x; \ - retVal->y = texel.u.y; - -#define TEXTURE_SET_FLOAT_XYZW \ - retVal->x = texel.f.x; \ - retVal->y = texel.f.y; \ - retVal->z = texel.f.z; \ - retVal->w = texel.f.w; - -#define TEXTURE_SET_SIGNED_XYZW \ - retVal->x = texel.i.x; \ - retVal->y = texel.i.y; \ - retVal->z = texel.i.z; \ - retVal->w = texel.i.w; - -#define TEXTURE_SET_UNSIGNED_XYZW \ - retVal->x = texel.u.x; \ - retVal->y = texel.u.y; \ - retVal->z = texel.u.z; \ - retVal->w = texel.u.w; - -#define TEXTURE_RETURN_CHAR return texel.i.x; - -#define TEXTURE_RETURN_UCHAR return texel.u.x; - -#define TEXTURE_RETURN_SHORT return texel.i.x; - -#define TEXTURE_RETURN_USHORT return texel.u.x; - -#define TEXTURE_RETURN_INT return texel.i.x; - -#define TEXTURE_RETURN_UINT return texel.u.x; - -#define TEXTURE_RETURN_SIGNED return texel.i.x; - -#define TEXTURE_RETURN_UNSIGNED return texel.u.x; - -#define TEXTURE_RETURN_CHAR_X return make_char1(texel.i.x); - -#define TEXTURE_RETURN_UCHAR_X return make_uchar1(texel.u.x); - -#define TEXTURE_RETURN_SHORT_X return make_short1(texel.i.x); - -#define TEXTURE_RETURN_USHORT_X return make_ushort1(texel.u.x); - -#define TEXTURE_RETURN_INT_X return make_int1(texel.i.x); - -#define TEXTURE_RETURN_UINT_X return make_uint1(texel.u.x); - -#define TEXTURE_RETURN_CHAR_XY return make_char2(texel.i.x, texel.i.y); - -#define TEXTURE_RETURN_UCHAR_XY return make_uchar2(texel.u.x, texel.u.y); - -#define TEXTURE_RETURN_SHORT_XY return make_short2(texel.i.x, texel.i.y); - -#define TEXTURE_RETURN_USHORT_XY return make_ushort2(texel.u.x, texel.u.y); - -#define TEXTURE_RETURN_INT_XY return make_int2(texel.i.x, texel.i.y); - -#define TEXTURE_RETURN_UINT_XY return make_uint2(texel.u.x, texel.u.y); - -#define TEXTURE_RETURN_CHAR_XYZW return make_char4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); - -#define TEXTURE_RETURN_UCHAR_XYZW return make_uchar4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); - -#define TEXTURE_RETURN_SHORT_XYZW return make_short4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); - -#define TEXTURE_RETURN_USHORT_XYZW return make_ushort4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); - -#define TEXTURE_RETURN_INT_XYZW return make_int4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); - -#define TEXTURE_RETURN_UINT_XYZW return make_uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); - -#define TEXTURE_RETURN_FLOAT return texel.f.x; - -#define TEXTURE_RETURN_FLOAT_X return make_float1(texel.f.x); - -#define TEXTURE_RETURN_FLOAT_XY return make_float2(texel.f.x, texel.f.y); - -#define TEXTURE_RETURN_FLOAT_XYZW return make_float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w); - -extern "C" { - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_1D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - float c); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_1Da( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_2D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c); - - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_2Da( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c); - -__device__ -float __ockl_image_sample_2Dad( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c); - -__device__ -float __ockl_image_sample_2Dd( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_3D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_grad_1D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - float c, float dx, float dy); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_grad_1Da( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c, float dx, float dy); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_grad_2D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_grad_2Da( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy); - -__device__ -float __ockl_image_sample_grad_2Dad( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy); - -__device__ -float __ockl_image_sample_grad_2Dd( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_grad_3D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c, __hip_float4_vector_value_type dx, __hip_float4_vector_value_type dy); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_lod_1D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - float c, float l); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_lod_1Da( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c, float l); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_lod_2D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c, float l); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_lod_2Da( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c, float l); - -__device__ -float __ockl_image_sample_lod_2Dad( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c, float l); - -__device__ -float __ockl_image_sample_lod_2Dd( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float2_vector_value_type c, float l); - -__device__ -__hip_float4_vector_value_type __ockl_image_sample_lod_3D( - unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s, - __hip_float4_vector_value_type c, float l); -} - -//////////////////////////////////////////////////////////// -// Texture object APIs -//////////////////////////////////////////////////////////// - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char1* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char2* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char4* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned char* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar1* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar2* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar4* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short1* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short2* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short4* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned short* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort1* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort2* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort4* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int1* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int2* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int4* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned int* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint1* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint2* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint4* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float* retVal, hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float1* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float2* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float4* retVal, hipTextureObject_t textureObject, - int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex1Dfetch(hipTextureObject_t textureObject, int x) { - T ret; - tex1Dfetch(&ret, textureObject, x); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char1* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char2* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char4* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned char* retVal, hipTextureObject_t textureObject, - float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar1* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar2* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar4* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short1* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short2* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short4* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned short* retVal, hipTextureObject_t textureObject, - float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort1* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort2* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort4* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int1* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int2* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int4* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned int* retVal, hipTextureObject_t textureObject, - float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint1* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint2* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint4* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float1* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float2* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float4* retVal, hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_FLOAT_XYZW; -} -template -__TEXTURE_FUNCTIONS_DECL__ T tex1D(hipTextureObject_t textureObject, float x) { - T ret; - tex1D(&ret, textureObject, x); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char1* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char2* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char4* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned char* retVal, hipTextureObject_t textureObject, - float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar1* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar2* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar4* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short1* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short2* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short4* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned short* retVal, hipTextureObject_t textureObject, - float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort1* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort2* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort4* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int1* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int2* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int4* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned int* retVal, hipTextureObject_t textureObject, - float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint1* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint2* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint4* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float1* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float2* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float4* retVal, hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLod(hipTextureObject_t textureObject, float x, float level) { - T ret; - tex1DLod(&ret, textureObject, x, level); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char1* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char2* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char4* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned char* retVal, hipTextureObject_t textureObject, - float x, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar1* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar2* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar4* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short1* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short2* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short4* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned short* retVal, hipTextureObject_t textureObject, - float x, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort1* retVal, hipTextureObject_t textureObject, - float x, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort2* retVal, hipTextureObject_t textureObject, - float x, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort4* retVal, hipTextureObject_t textureObject, - float x, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int1* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int2* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int4* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned int* retVal, hipTextureObject_t textureObject, - float x, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint1* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint2* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint4* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float1* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float2* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float4* retVal, hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex1DGrad(hipTextureObject_t textureObject, float x, float dx, - float dy) { - T ret; - tex1DLod(&ret, textureObject, x, dx, dy); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char1* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char2* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char4* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned char* retVal, hipTextureObject_t textureObject, - float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar1* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar2* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar4* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short1* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short2* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short4* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned short* retVal, hipTextureObject_t textureObject, - float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort1* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort2* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort4* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int1* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int2* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int4* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned int* retVal, hipTextureObject_t textureObject, - float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint1* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint2* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint4* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float1* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float2* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float4* retVal, hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex2D(hipTextureObject_t textureObject, float x, float y) { - T ret; - tex2D(&ret, textureObject, x, y); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char1* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char2* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char4* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned char* retVal, hipTextureObject_t textureObject, - float x, float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar1* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar2* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar4* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short1* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short2* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short4* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned short* retVal, hipTextureObject_t textureObject, - float x, float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort1* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort2* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort4* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int1* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int2* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int4* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned int* retVal, hipTextureObject_t textureObject, - float x, float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint1* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint2* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint4* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float1* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float2* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float4* retVal, hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex2DLod(hipTextureObject_t textureObject, float x, float y, - float level) { - T ret; - tex2DLod(&ret, textureObject, x, y, level); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char1* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char2* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char4* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned char* retVal, hipTextureObject_t textureObject, - float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar1* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar2* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar4* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short1* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short2* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short4* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned short* retVal, hipTextureObject_t textureObject, - float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort1* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort2* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort4* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int1* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int2* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int4* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned int* retVal, hipTextureObject_t textureObject, - float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint1* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint2* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint4* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float1* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float2* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float4* retVal, hipTextureObject_t textureObject, float x, - float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex3D(hipTextureObject_t textureObject, float x, float y, float z) { - T ret; - tex3D(&ret, textureObject, x, y, z); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char1* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char2* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char4* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned char* retVal, hipTextureObject_t textureObject, - float x, float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar1* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar2* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar4* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short1* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short2* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short4* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned short* retVal, hipTextureObject_t textureObject, - float x, float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort1* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort2* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort4* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int1* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int2* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int4* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned int* retVal, hipTextureObject_t textureObject, - float x, float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint1* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint2* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint4* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float1* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float2* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float4* retVal, hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, float z, - float level) { - T ret; - tex3DLod(&ret, textureObject, x, y, z, level); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char1* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char2* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_XY; -} -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char4* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned char* retVal, - hipTextureObject_t textureObject, float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar1* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar2* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_XY; -} -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar4* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short1* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short2* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_XY; -} -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short4* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned short* retVal, - hipTextureObject_t textureObject, float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort1* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort2* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_XY; -} -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort4* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int* retVal, hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int1* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int2* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_XY; -} -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int4* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned int* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint1* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint2* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_XY; -} -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint4* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float1* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float2* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_FLOAT_XY; -} -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float4* retVal, hipTextureObject_t textureObject, - float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLayered(hipTextureObject_t textureObject, float x, int layer) { - T ret; - tex1DLayered(&ret, textureObject, x, layer); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char1* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char2* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char4* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned char* retVal, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short1* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short2* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short4* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned short* retVal, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int1* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int2* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int4* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned int* retVal, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint1* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint2* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint4* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float1* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float2* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float4* retVal, hipTextureObject_t textureObject, - float x, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, int layer, - float level) { - T ret; - tex1DLayeredLod(&ret, textureObject, x, layer, level); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char1* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char2* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char4* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned char* retVal, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar1* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar2* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar4* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short1* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short2* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short4* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned short* retVal, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort1* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort2* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort4* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int1* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int2* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int4* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned int* retVal, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint1* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint2* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint4* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float1* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float2* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float4* retVal, hipTextureObject_t textureObject, - float x, int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, int layer, - float dx, float dy) { - T ret; - tex1DLayeredGrad(&ret, textureObject, x, layer, dx, dy); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned char* retVal, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned short* retVal, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int* retVal, hipTextureObject_t textureObject, float x, - float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned int* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex2DLayered(hipTextureObject_t textureObject, float x, float y, - int layer) { - T ret; - tex2DLayered(&ret, textureObject, x, y, layer); - return ret; -} - -//////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned char* retVal, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned short* retVal, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_SIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned int* retVal, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_UNSIGNED_XYZW; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_FLOAT; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float1* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_FLOAT_X; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float2* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_FLOAT_XY; -} - -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float4* retVal, hipTextureObject_t textureObject, - float x, float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_SET_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - T ret; - tex2DLayeredLod(&ret, textureObject, x, y, layer, level); - return ret; -} - -//////////////////////////////////////////////////////////// -// Texture Reference APIs -//////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture texRef, - int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture texRef, - int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture texRef, - int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texRef, int x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texRef, - hipTextureObject_t textureObject, int x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture texRef, - float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture texRef, - float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT; -} -////// - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, float x) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, - hipTextureObject_t textureObject, float x) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR_X; -} -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture texRef, - float x, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture texRef, - float x, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture texRef, float x, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture texRef, - float x, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef, float x, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR_X; -} -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef, - hipTextureObject_t textureObject, float x, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1D(i, s, x, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture texRef, - float x, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture texRef, - float x, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture texRef, - float x, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture texRef, float x, float dx, - float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRef, float x, - float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float dx, - float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture texRef, - float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture texRef, - float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture texRef, float x, - float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT_XYZW; -} - - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture texRef, - hipTextureObject_t textureObject, float x, - float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, float x, float y) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, - hipTextureObject_t textureObject, float x, float y) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture texRef, - float x, float y, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture texRef, - float x, float y, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture texRef, float x, - float y, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture texRef, float x, - float y, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture texRef, float x, - float y, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture texRef, - float x, float y, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef, float x, float y, - float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture texRef, - float x, float y, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture texRef, - float x, float y, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture texRef, float x, - float y, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture texRef, float x, - float y, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture texRef, float x, - float y, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture texRef, - float x, float y, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRef, float x, float y, - float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture texRef, - float x, float y, float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture texRef, - float x, float y, float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture texRef, float x, - float y, float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, float x, float y, - float z) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture texRef, - float x, float y, float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture texRef, - float x, float y, float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef, float x, float y, - float z, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, float z, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, - level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture texRef, - float x, float y, float z, float4 dx, - float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture texRef, - float x, float y, float z, float4 dx, - float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture texRef, float x, - float y, float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture texRef, float x, - float y, float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture texRef, float x, - float y, float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture texRef, - float x, float y, float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRef, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - float z, float4 dx, float4 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, - float4(dx.x, dx.y, dx.z, dx.w).data, - float4(dy.x, dy.y, dy.z, dy.w).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture texRef, - float x, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered( - texture texRef, float x, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture texRef, - float x, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture texRef, float x, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered( - texture texRef, hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod( - texture texRef, float x, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod( - texture texRef, float x, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture texRef, - float x, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture texRef, float x, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod( - texture texRef, hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod( - texture texRef, hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, int layer, - float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad( - texture texRef, float x, int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad( - texture texRef, hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad( - texture texRef, float x, int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad( - texture texRef, hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad( - texture texRef, float x, int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad( - texture texRef, hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, float x, - int layer, float dx, float dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - int layer, float dx, float dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, float x, float y, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, - float x, float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered( - texture texRef, float x, float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered( - texture texRef, hipTextureObject_t textureObject, float x, - float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, float x, float y, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, float x, float y, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, float x, float y, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, float x, float y, - int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, - float x, float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, float x, - float y, int layer) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod( - texture texRef, float x, float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod( - texture texRef, hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod( - texture texRef, float x, float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod( - texture texRef, hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, float x, float y, - int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, - float x, float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, float x, - float y, int layer, float level) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float level) { - TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da( - i, s, float4(x, y, layer, 0.0f).data, level); - TEXTURE_RETURN_FLOAT_XYZW; -} - -//////////////////////////////////////////////////////////// - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_CHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad( - texture texRef, float x, float y, int layer, float2 dx, - float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad( - texture texRef, hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UCHAR_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_SHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad( - texture texRef, float x, float y, int layer, float2 dx, - float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad( - texture texRef, hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_USHORT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, float y, - int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_INT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad( - texture texRef, float x, float y, int layer, float2 dx, - float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad( - texture texRef, hipTextureObject_t textureObject, float x, float y, - int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_UINT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_X; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XY; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_REF_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XYZW; -} - -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, - hipTextureObject_t textureObject, float x, - float y, int layer, float2 dx, float2 dy) { - TEXTURE_PARAMETERS_INIT; - texel.f = - __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, - float2(dx.x, dx.y).data, - float2(dy.x, dy.y).data); - TEXTURE_RETURN_FLOAT_XYZW; -} -#endif diff --git a/hipamd/include/hip/amd_detail/texture_indirect_functions.h b/hipamd/include/hip/amd_detail/texture_indirect_functions.h index 33457f2ae6..e583b94006 100644 --- a/hipamd/include/hip/amd_detail/texture_indirect_functions.h +++ b/hipamd/include/hip/amd_detail/texture_indirect_functions.h @@ -64,7 +64,7 @@ struct __hip_is_itex_channel_type> template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex1Dfetch(hipTextureObject_t textureObject, int x) +static __device__ __hip_img_chk__ T tex1Dfetch(hipTextureObject_t textureObject, int x) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_load_1Db(i, x); @@ -74,7 +74,7 @@ static __device__ T tex1Dfetch(hipTextureObject_t textureObject, int x) template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex1Dfetch(T *ptr, hipTextureObject_t textureObject, int x) +static __device__ __hip_img_chk__ void tex1Dfetch(T *ptr, hipTextureObject_t textureObject, int x) { *ptr = tex1Dfetch(textureObject, x); } @@ -82,7 +82,7 @@ static __device__ void tex1Dfetch(T *ptr, hipTextureObject_t textureObject, int template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex1D(hipTextureObject_t textureObject, float x) +static __device__ __hip_img_chk__ T tex1D(hipTextureObject_t textureObject, float x) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_1D(i, s, x); @@ -92,7 +92,7 @@ static __device__ T tex1D(hipTextureObject_t textureObject, float x) template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex1D(T *ptr, hipTextureObject_t textureObject, float x) +static __device__ __hip_img_chk__ void tex1D(T *ptr, hipTextureObject_t textureObject, float x) { *ptr = tex1D(textureObject, x); } @@ -100,7 +100,7 @@ static __device__ void tex1D(T *ptr, hipTextureObject_t textureObject, float x) template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex2D(hipTextureObject_t textureObject, float x, float y) +static __device__ __hip_img_chk__ T tex2D(hipTextureObject_t textureObject, float x, float y) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_2D(i, s, float2(x, y).data); @@ -110,7 +110,7 @@ static __device__ T tex2D(hipTextureObject_t textureObject, float x, float y) template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex2D(T *ptr, hipTextureObject_t textureObject, float x, float y) +static __device__ __hip_img_chk__ void tex2D(T *ptr, hipTextureObject_t textureObject, float x, float y) { *ptr = tex2D(textureObject, x, y); } @@ -118,7 +118,7 @@ static __device__ void tex2D(T *ptr, hipTextureObject_t textureObject, float x, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex3D(hipTextureObject_t textureObject, float x, float y, float z) +static __device__ __hip_img_chk__ T tex3D(hipTextureObject_t textureObject, float x, float y, float z) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data); @@ -128,7 +128,7 @@ static __device__ T tex3D(hipTextureObject_t textureObject, float x, float y, fl template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex3D(T *ptr, hipTextureObject_t textureObject, float x, float y, float z) +static __device__ __hip_img_chk__ void tex3D(T *ptr, hipTextureObject_t textureObject, float x, float y, float z) { *ptr = tex3D(textureObject, x, y, z); } @@ -136,7 +136,7 @@ static __device__ void tex3D(T *ptr, hipTextureObject_t textureObject, float x, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex1DLayered(hipTextureObject_t textureObject, float x, int layer) +static __device__ __hip_img_chk__ T tex1DLayered(hipTextureObject_t textureObject, float x, int layer) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_1Da(i, s, float2(x, layer).data); @@ -146,7 +146,7 @@ static __device__ T tex1DLayered(hipTextureObject_t textureObject, float x, int template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex1DLayered(T *ptr, hipTextureObject_t textureObject, float x, int layer) +static __device__ __hip_img_chk__ void tex1DLayered(T *ptr, hipTextureObject_t textureObject, float x, int layer) { *ptr = tex1DLayered(textureObject, x, layer); } @@ -154,7 +154,7 @@ static __device__ void tex1DLayered(T *ptr, hipTextureObject_t textureObject, fl template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex2DLayered(hipTextureObject_t textureObject, float x, float y, int layer) +static __device__ __hip_img_chk__ T tex2DLayered(hipTextureObject_t textureObject, float x, float y, int layer) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); @@ -164,7 +164,7 @@ static __device__ T tex2DLayered(hipTextureObject_t textureObject, float x, floa template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex2DLayered(T *ptr, hipTextureObject_t textureObject, float x, float y, int layer) +static __device__ __hip_img_chk__ void tex2DLayered(T *ptr, hipTextureObject_t textureObject, float x, float y, int layer) { *ptr = tex1DLayered(textureObject, x, y, layer); } @@ -172,7 +172,7 @@ static __device__ void tex2DLayered(T *ptr, hipTextureObject_t textureObject, fl template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T texCubemap(hipTextureObject_t textureObject, float x, float y, float z) +static __device__ __hip_img_chk__ T texCubemap(hipTextureObject_t textureObject, float x, float y, float z) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_CM(i, s, float4(x, y, z, 0.0f).data); @@ -182,7 +182,7 @@ static __device__ T texCubemap(hipTextureObject_t textureObject, float x, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void texCubemap(T *ptr, hipTextureObject_t textureObject, float x, float y, float z) +static __device__ __hip_img_chk__ void texCubemap(T *ptr, hipTextureObject_t textureObject, float x, float y, float z) { *ptr = texCubemap(textureObject, x, y, z); } @@ -190,7 +190,7 @@ static __device__ void texCubemap(T *ptr, hipTextureObject_t textureObject, floa template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T texCubemapLayered(hipTextureObject_t textureObject, float x, float y, float z, int layer) +static __device__ __hip_img_chk__ T texCubemapLayered(hipTextureObject_t textureObject, float x, float y, float z, int layer) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_CMa(i, s, float4(x, y, z, layer).data); @@ -200,7 +200,7 @@ static __device__ T texCubemapLayered(hipTextureObject_t textureObject, float x, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void texCubemapLayered(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, int layer) +static __device__ __hip_img_chk__ void texCubemapLayered(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, int layer) { *ptr = texCubemapLayered(textureObject, x, y, z, layer); } @@ -208,7 +208,7 @@ static __device__ void texCubemapLayered(T *ptr, hipTextureObject_t textureObjec template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex2Dgather(hipTextureObject_t textureObject, float x, float y, int comp = 0) +static __device__ __hip_img_chk__ T tex2Dgather(hipTextureObject_t textureObject, float x, float y, int comp = 0) { TEXTURE_OBJECT_PARAMETERS_INIT switch (comp) { @@ -239,7 +239,7 @@ static __device__ T tex2Dgather(hipTextureObject_t textureObject, float x, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex2Dgather(T *ptr, hipTextureObject_t textureObject, float x, float y, int comp = 0) +static __device__ __hip_img_chk__ void tex2Dgather(T *ptr, hipTextureObject_t textureObject, float x, float y, int comp = 0) { *ptr = texCubemapLayered(textureObject, x, y, comp); } @@ -247,7 +247,7 @@ static __device__ void tex2Dgather(T *ptr, hipTextureObject_t textureObject, flo template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex1DLod(hipTextureObject_t textureObject, float x, float level) +static __device__ __hip_img_chk__ T tex1DLod(hipTextureObject_t textureObject, float x, float level) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_lod_1D(i, s, x, level); @@ -257,7 +257,7 @@ static __device__ T tex1DLod(hipTextureObject_t textureObject, float x, float le template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex1DLod(T *ptr, hipTextureObject_t textureObject, float x, float level) +static __device__ __hip_img_chk__ void tex1DLod(T *ptr, hipTextureObject_t textureObject, float x, float level) { *ptr = tex1DLod(textureObject, x, level); } @@ -265,7 +265,7 @@ static __device__ void tex1DLod(T *ptr, hipTextureObject_t textureObject, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex2DLod(hipTextureObject_t textureObject, float x, float y, float level) +static __device__ __hip_img_chk__ T tex2DLod(hipTextureObject_t textureObject, float x, float y, float level) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level); @@ -275,7 +275,7 @@ static __device__ T tex2DLod(hipTextureObject_t textureObject, float x, float y, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex2DLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float level) +static __device__ __hip_img_chk__ void tex2DLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float level) { *ptr = tex2DLod(textureObject, x, y, level); } @@ -283,7 +283,7 @@ static __device__ void tex2DLod(T *ptr, hipTextureObject_t textureObject, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, float z, float level) +static __device__ __hip_img_chk__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, float z, float level) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, level); @@ -293,7 +293,7 @@ static __device__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex3DLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float level) +static __device__ __hip_img_chk__ void tex3DLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float level) { *ptr = tex3DLod(textureObject, x, y, z, level); } @@ -301,7 +301,7 @@ static __device__ void tex3DLod(T *ptr, hipTextureObject_t textureObject, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, int layer, float level) +static __device__ __hip_img_chk__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, int layer, float level) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_1Da(i, s, float2(x, layer).data); @@ -311,7 +311,7 @@ static __device__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, i template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex1DLayeredLod(T *ptr, hipTextureObject_t textureObject, float x, int layer, float level) +static __device__ __hip_img_chk__ void tex1DLayeredLod(T *ptr, hipTextureObject_t textureObject, float x, int layer, float level) { *ptr = tex1DLayeredLod(textureObject, x, layer, level); } @@ -319,7 +319,7 @@ static __device__ void tex1DLayeredLod(T *ptr, hipTextureObject_t textureObject, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, float y, int layer, float level) +static __device__ __hip_img_chk__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, float y, int layer, float level) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data); @@ -329,7 +329,7 @@ static __device__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex2DLayeredLod(T *ptr, hipTextureObject_t textureObject, float x, float y, int layer, float level) +static __device__ __hip_img_chk__ void tex2DLayeredLod(T *ptr, hipTextureObject_t textureObject, float x, float y, int layer, float level) { *ptr = tex2DLayeredLod(textureObject, x, y, layer, level); } @@ -337,7 +337,7 @@ static __device__ void tex2DLayeredLod(T *ptr, hipTextureObject_t textureObject, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T texCubemapLod(hipTextureObject_t textureObject, float x, float y, float z, float level) +static __device__ __hip_img_chk__ T texCubemapLod(hipTextureObject_t textureObject, float x, float y, float z, float level) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_lod_CM(i, s, float4(x, y, z, 0.0f).data, level); @@ -347,7 +347,7 @@ static __device__ T texCubemapLod(hipTextureObject_t textureObject, float x, flo template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void texCubemapLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float level) +static __device__ __hip_img_chk__ void texCubemapLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float level) { *ptr = texCubemapLod(textureObject, x, y, z, level); } @@ -355,7 +355,7 @@ static __device__ void texCubemapLod(T *ptr, hipTextureObject_t textureObject, f template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T texCubemapGrad(hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) +static __device__ __hip_img_chk__ T texCubemapGrad(hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) { TEXTURE_OBJECT_PARAMETERS_INIT // TODO missing in device libs. @@ -367,7 +367,7 @@ static __device__ T texCubemapGrad(hipTextureObject_t textureObject, float x, fl template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void texCubemapGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) +static __device__ __hip_img_chk__ void texCubemapGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) { *ptr = texCubemapGrad(textureObject, x, y, z, dPdx, dPdy); } @@ -375,7 +375,7 @@ static __device__ void texCubemapGrad(T *ptr, hipTextureObject_t textureObject, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T texCubemapLayeredLod(hipTextureObject_t textureObject, float x, float y, float z, int layer, float level) +static __device__ __hip_img_chk__ T texCubemapLayeredLod(hipTextureObject_t textureObject, float x, float y, float z, int layer, float level) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_lod_CMa(i, s, float4(x, y, z, layer).data, level); @@ -385,7 +385,7 @@ static __device__ T texCubemapLayeredLod(hipTextureObject_t textureObject, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void texCubemapLayeredLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, int layer, float level) +static __device__ __hip_img_chk__ void texCubemapLayeredLod(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, int layer, float level) { *ptr = texCubemapLayeredLod(textureObject, x, y, z, layer, level); } @@ -393,7 +393,7 @@ static __device__ void texCubemapLayeredLod(T *ptr, hipTextureObject_t textureOb template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex1DGrad(hipTextureObject_t textureObject, float x, float dPdx, float dPdy) +static __device__ __hip_img_chk__ T tex1DGrad(hipTextureObject_t textureObject, float x, float dPdx, float dPdy) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_grad_1D(i, s, x, dPdx, dPdy); @@ -403,7 +403,7 @@ static __device__ T tex1DGrad(hipTextureObject_t textureObject, float x, float d template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex1DGrad(T *ptr, hipTextureObject_t textureObject, float x, float dPdx, float dPdy) +static __device__ __hip_img_chk__ void tex1DGrad(T *ptr, hipTextureObject_t textureObject, float x, float dPdx, float dPdy) { *ptr = tex1DGrad(textureObject, x, dPdx, dPdy); } @@ -411,7 +411,7 @@ static __device__ void tex1DGrad(T *ptr, hipTextureObject_t textureObject, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex2DGrad(hipTextureObject_t textureObject, float x, float y, float2 dPdx, float2 dPdy) +static __device__ __hip_img_chk__ T tex2DGrad(hipTextureObject_t textureObject, float x, float y, float2 dPdx, float2 dPdy) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, float2(dPdx.x, dPdx.y).data, float2(dPdy.x, dPdy.y).data); @@ -421,7 +421,7 @@ static __device__ T tex2DGrad(hipTextureObject_t textureObject, float x, float y template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex2DGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float2 dPdx, float2 dPdy) +static __device__ __hip_img_chk__ void tex2DGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float2 dPdx, float2 dPdy) { *ptr = tex2DGrad(textureObject, x, y, dPdx, dPdy); } @@ -429,7 +429,7 @@ static __device__ void tex2DGrad(T *ptr, hipTextureObject_t textureObject, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex3DGrad(hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) +static __device__ __hip_img_chk__ T tex3DGrad(hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, float4(dPdx.x, dPdx.y, dPdx.z, 0.0f).data, float4(dPdy.x, dPdy.y, dPdy.z, 0.0f).data); @@ -439,7 +439,7 @@ static __device__ T tex3DGrad(hipTextureObject_t textureObject, float x, float y template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex3DGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) +static __device__ __hip_img_chk__ void tex3DGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, float4 dPdx, float4 dPdy) { *ptr = tex3DGrad(textureObject, x, y, z, dPdx, dPdy); } @@ -447,7 +447,7 @@ static __device__ void tex3DGrad(T *ptr, hipTextureObject_t textureObject, float template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, int layer, float dPdx, float dPdy) +static __device__ __hip_img_chk__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, int layer, float dPdx, float dPdy) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dPdx, dPdy); @@ -457,7 +457,7 @@ static __device__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex1DLayeredGrad(T *ptr, hipTextureObject_t textureObject, float x, int layer, float dPdx, float dPdy) +static __device__ __hip_img_chk__ void tex1DLayeredGrad(T *ptr, hipTextureObject_t textureObject, float x, int layer, float dPdx, float dPdy) { *ptr = tex1DLayeredGrad(textureObject, x, layer, dPdx, dPdy); } @@ -465,7 +465,7 @@ static __device__ void tex1DLayeredGrad(T *ptr, hipTextureObject_t textureObject template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T tex2DLayeredGrad(hipTextureObject_t textureObject, float x, float y, int layer, float2 dPdx, float2 dPdy) +static __device__ __hip_img_chk__ T tex2DLayeredGrad(hipTextureObject_t textureObject, float x, float y, int layer, float2 dPdx, float2 dPdy) { TEXTURE_OBJECT_PARAMETERS_INIT auto tmp = __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, float2(dPdx.x, dPdx.y).data, float2(dPdy.x, dPdy.y).data); @@ -475,7 +475,7 @@ static __device__ T tex2DLayeredGrad(hipTextureObject_t textureObject, float x, template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void tex2DLayeredGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, int layer, float2 dPdx, float2 dPdy) +static __device__ __hip_img_chk__ void tex2DLayeredGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, int layer, float2 dPdx, float2 dPdy) { *ptr = tex2DLayeredGrad(textureObject, x, y, layer, dPdx, dPdy); } @@ -483,7 +483,7 @@ static __device__ void tex2DLayeredGrad(T *ptr, hipTextureObject_t textureObject template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ T texCubemapLayeredGrad(hipTextureObject_t textureObject, float x, float y, float z, int layer, float4 dPdx, float4 dPdy) +static __device__ __hip_img_chk__ T texCubemapLayeredGrad(hipTextureObject_t textureObject, float x, float y, float z, int layer, float4 dPdx, float4 dPdy) { TEXTURE_OBJECT_PARAMETERS_INIT // TODO missing in device libs. @@ -495,7 +495,7 @@ static __device__ T texCubemapLayeredGrad(hipTextureObject_t textureObject, flo template < typename T, typename std::enable_if<__hip_is_itex_channel_type::value>::type* = nullptr> -static __device__ void texCubemapLayeredGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, int layer, float4 dPdx, float4 dPdy) +static __device__ __hip_img_chk__ void texCubemapLayeredGrad(T *ptr, hipTextureObject_t textureObject, float x, float y, float z, int layer, float4 dPdx, float4 dPdy) { *ptr = texCubemapLayeredGrad(textureObject, x, y, z, layer, dPdx, dPdy); } diff --git a/hipamd/src/hip_device_runtime.cpp b/hipamd/src/hip_device_runtime.cpp index 5a3735252b..384de70948 100644 --- a/hipamd/src/hip_device_runtime.cpp +++ b/hipamd/src/hip_device_runtime.cpp @@ -318,6 +318,9 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) // hipStreamWaitValue64() and hipStreamWaitValue32() support *pi = g_devices[device]->devices()[0]->info().aqlBarrierValue_; break; + case hipDeviceAttributeImageSupport: + *pi = static_cast(g_devices[device]->devices()[0]->info().imageSupport_); + break; default: HIP_RETURN(hipErrorInvalidValue); } diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index af2d627f78..e28e33a3ce 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -663,6 +663,12 @@ hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const if ((texRef == nullptr) || (name == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } /* Get address and size for the global symbol */ if (hipSuccess != PlatformState::instance().getDynTexRef(name, hmod, texRef)) { diff --git a/hipamd/src/hip_texture.cpp b/hipamd/src/hip_texture.cpp index 4ff7f288cd..36b69688f2 100644 --- a/hipamd/src/hip_texture.cpp +++ b/hipamd/src/hip_texture.cpp @@ -76,6 +76,10 @@ hipError_t ihipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceViewDesc* pResViewDesc) { amd::Device* device = hip::getCurrentDevice()->devices()[0]; const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + return hipErrorNotSupported; + } // Validate input params if (pTexObject == nullptr || pResDesc == nullptr || pTexDesc == nullptr) { @@ -313,6 +317,12 @@ hipError_t ihipDestroyTextureObject(hipTextureObject_t texObject) { if (texObject == nullptr) { return hipSuccess; } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + return hipErrorNotSupported; + } const hipResourceType type = texObject->resDesc.resType; const bool isImageFromBuffer = (type == hipResourceTypeLinear) || (type == hipResourceTypePitch2D); @@ -341,6 +351,13 @@ hipError_t ihipUnbindTexture(textureReference* texRef) { break; } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } + hip_error = ihipDestroyTextureObject(texRef->textureObject); if (hip_error != hipSuccess) { break; @@ -367,6 +384,12 @@ hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc, if ((pResDesc == nullptr) || (texObject == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pResDesc = texObject->resDesc; @@ -380,6 +403,12 @@ hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc if ((pResViewDesc == nullptr) || (texObject == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pResViewDesc = texObject->resViewDesc; @@ -393,16 +422,26 @@ hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc, if ((pTexDesc == nullptr) || (texObject == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pTexDesc = texObject->texDesc; HIP_RETURN(hipSuccess); } -inline bool ihipGetTextureAlignmentOffset(size_t* offset, +inline hipError_t ihipGetTextureAlignmentOffset(size_t* offset, const void* devPtr) { amd::Device* device = hip::getCurrentDevice()->devices()[0]; const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + return hipErrorNotSupported; + } const char* alignedDevPtr = amd::alignUp(static_cast(devPtr), info.imageBaseAddressAlignment_); const size_t alignedOffset = alignedDevPtr - static_cast(devPtr); @@ -411,14 +450,14 @@ inline bool ihipGetTextureAlignmentOffset(size_t* offset, // the offset is guaranteed to be 0 and NULL may be passed as the offset parameter. if ((alignedOffset != 0) && (offset == nullptr)) { LogPrintfError("Texture object not aligned with offset %u \n", alignedOffset); - return false; + return hipErrorInvalidValue; } if (offset != nullptr) { *offset = alignedOffset; } - return true; + return hipSuccess; } hipError_t ihipBindTexture(size_t* offset, @@ -435,21 +474,23 @@ hipError_t ihipBindTexture(size_t* offset, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texref->textureObject); + hipError_t err = ihipDestroyTextureObject(texref->textureObject); + if (err != hipSuccess) { + return err; + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypeLinear; resDesc.res.linear.devPtr = const_cast(devPtr); resDesc.res.linear.desc = *desc; resDesc.res.linear.sizeInBytes = size; - - if (ihipGetTextureAlignmentOffset(offset, devPtr)) { - // Align the user ptr to HW requirments. - resDesc.res.linear.devPtr = static_cast(const_cast(devPtr)) - *offset; - } else { - return hipErrorInvalidValue; + err = ihipGetTextureAlignmentOffset(offset, devPtr); + if (err != hipSuccess) { + return err; } + // Align the user ptr to HW requirments. + resDesc.res.linear.devPtr = static_cast(const_cast(devPtr)) - *offset; hipTextureDesc texDesc = hip::getTextureDesc(texref); return ihipCreateTextureObject(const_cast(&texref->textureObject), &resDesc, &texDesc, nullptr); @@ -471,7 +512,10 @@ hipError_t ihipBindTexture2D(size_t* offset, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texref->textureObject); + hipError_t err = ihipDestroyTextureObject(texref->textureObject); + if (err != hipSuccess) { + return err; + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypePitch2D; @@ -480,14 +524,13 @@ hipError_t ihipBindTexture2D(size_t* offset, resDesc.res.pitch2D.width = width; resDesc.res.pitch2D.height = height; resDesc.res.pitch2D.pitchInBytes = pitch; - - if (ihipGetTextureAlignmentOffset(offset, devPtr)) { - // Align the user ptr to HW requirments. - resDesc.res.pitch2D.devPtr = static_cast(const_cast(devPtr)) - *offset; - } else { - return hipErrorInvalidValue; + err = ihipGetTextureAlignmentOffset(offset, devPtr); + if (err != hipSuccess) { + return err; } + // Align the user ptr to HW requirments. + resDesc.res.pitch2D.devPtr = static_cast(const_cast(devPtr)) - *offset; hipTextureDesc texDesc = hip::getTextureDesc(texref); return ihipCreateTextureObject(const_cast(&texref->textureObject), &resDesc, &texDesc, nullptr); @@ -530,7 +573,10 @@ hipError_t ihipBindTextureToArray(const textureReference* texref, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texref->textureObject); + hipError_t err = ihipDestroyTextureObject(texref->textureObject); + if (err != hipSuccess) { + return err; + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypeArray; @@ -576,7 +622,10 @@ hipError_t ihipBindTextureToMipmappedArray(const textureReference* texref, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texref->textureObject); + hipError_t err = ihipDestroyTextureObject(texref->textureObject); + if (err != hipSuccess) { + return err; + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypeMipmappedArray; @@ -645,6 +694,12 @@ hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, if ((desc == nullptr) || (array == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } // It is UB to call hipGetChannelDesc() on an array created via hipArrayCreate()/hipArray3DCreate(). // This is due to hip not differentiating between runtime and driver types. @@ -660,6 +715,12 @@ hipError_t hipGetTextureAlignmentOffset(size_t* offset, if ((offset == nullptr) || (texref == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } // TODO enforce alignment on devPtr. *offset = 0; @@ -673,6 +734,13 @@ hipError_t hipGetTextureReference(const textureReference** texref, const void* s if (texref == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } + *texref = reinterpret_cast(symbol); HIP_RETURN(hipSuccess); @@ -686,6 +754,12 @@ hipError_t hipTexRefSetFormat(textureReference* texRef, if (texRef == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->format = fmt; texRef->numChannels = NumPackedComponents; @@ -700,6 +774,12 @@ hipError_t hipTexRefSetFlags(textureReference* texRef, if (texRef == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->readMode = hipReadModeNormalizedFloat; texRef->normalized = 0; @@ -727,6 +807,12 @@ hipError_t hipTexRefSetFilterMode(textureReference* texRef, if (texRef == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->filterMode = fm; @@ -742,6 +828,12 @@ hipError_t hipTexRefGetAddressMode(hipTextureAddressMode* pam, if ((pam == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } // Currently, the only valid value for dim are 0 and 1. if ((dim != 0) && (dim != 1)) { @@ -773,6 +865,12 @@ hipError_t hipTexRefSetAddressMode(textureReference* texRef, dim); HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->addressMode[dim] = am; @@ -831,7 +929,10 @@ hipError_t hipTexRefSetArray(textureReference* texRef, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texRef->textureObject); + hipError_t err = ihipDestroyTextureObject(texRef->textureObject); + if (err != hipSuccess) { + HIP_RETURN(err); + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypeArray; @@ -842,7 +943,7 @@ hipError_t hipTexRefSetArray(textureReference* texRef, hipResourceViewFormat format = hip::getResourceViewFormat(hip::getChannelFormatDesc(texRef->numChannels, texRef->format)); hipResourceViewDesc resViewDesc = hip::getResourceViewDesc(array, format); - hipError_t err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, &resViewDesc); + err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, &resViewDesc); if (err != hipSuccess) { HIP_RETURN(err); } @@ -906,24 +1007,26 @@ hipError_t hipTexRefSetAddress(size_t* ByteOffset, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texRef->textureObject); + hipError_t err = ihipDestroyTextureObject(texRef->textureObject); + if (err != hipSuccess) { + HIP_RETURN(err); + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypeLinear; resDesc.res.linear.devPtr = dptr; resDesc.res.linear.desc = hip::getChannelFormatDesc(texRef->numChannels, texRef->format); resDesc.res.linear.sizeInBytes = bytes; - - if (ihipGetTextureAlignmentOffset(ByteOffset, dptr)) { - // Align the user ptr to HW requirments. - resDesc.res.linear.devPtr = static_cast(dptr) - *ByteOffset; - } else { - HIP_RETURN(hipErrorInvalidValue); + err = ihipGetTextureAlignmentOffset(ByteOffset, dptr); + if (err != hipSuccess) { + HIP_RETURN(err); } + // Align the user ptr to HW requirments. + resDesc.res.linear.devPtr = static_cast(dptr) - *ByteOffset; hipTextureDesc texDesc = hip::getTextureDesc(texRef); - hipError_t err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, nullptr); + err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, nullptr); if (err != hipSuccess) { HIP_RETURN(err); } @@ -950,7 +1053,10 @@ hipError_t hipTexRefSetAddress2D(textureReference* texRef, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texRef->textureObject); + hipError_t err = ihipDestroyTextureObject(texRef->textureObject); + if (err != hipSuccess) { + HIP_RETURN(err); + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypePitch2D; @@ -962,7 +1068,7 @@ hipError_t hipTexRefSetAddress2D(textureReference* texRef, hipTextureDesc texDesc = hip::getTextureDesc(texRef); - hipError_t err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, nullptr); + err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, nullptr); if (err != hipSuccess) { HIP_RETURN(err); } @@ -983,6 +1089,12 @@ hipError_t hipTexRefGetBorderColor(float* pBorderColor, if ((pBorderColor == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } // TODO add textureReference::borderColor. assert(false && "textureReference::borderColor is missing in header"); @@ -999,6 +1111,12 @@ hipError_t hipTexRefGetFilterMode(hipTextureFilterMode* pfm, if ((pfm == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pfm = texRef->filterMode; @@ -1013,6 +1131,12 @@ hipError_t hipTexRefGetFlags(unsigned int* pFlags, if ((pFlags == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pFlags = 0; @@ -1041,6 +1165,12 @@ hipError_t hipTexRefGetFormat(hipArray_Format* pFormat, (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pFormat = texRef->format; *pNumChannels = texRef->numChannels; @@ -1056,6 +1186,12 @@ hipError_t hipTexRefGetMaxAnisotropy(int* pmaxAnsio, if ((pmaxAnsio == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pmaxAnsio = texRef->maxAnisotropy; @@ -1070,6 +1206,12 @@ hipError_t hipTexRefGetMipmapFilterMode(hipTextureFilterMode* pfm, if ((pfm == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pfm = texRef->mipmapFilterMode; @@ -1084,6 +1226,12 @@ hipError_t hipTexRefGetMipmapLevelBias(float* pbias, if ((pbias == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pbias = texRef->mipmapLevelBias; @@ -1100,6 +1248,12 @@ hipError_t hipTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, (texRef == nullptr)){ HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pminMipmapLevelClamp = texRef->minMipmapLevelClamp; *pmaxMipmapLevelClamp = texRef->maxMipmapLevelClamp; @@ -1115,6 +1269,12 @@ hipError_t hipTexRefGetMipmappedArray(hipMipmappedArray_t* pArray, if ((pArray == nullptr) || (texRef == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } hipResourceDesc resDesc = {}; // TODO use ihipGetTextureObjectResourceDesc() to not pollute the API trace. @@ -1144,6 +1304,12 @@ hipError_t hipTexRefSetBorderColor(textureReference* texRef, if ((texRef == nullptr) || (pBorderColor == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } // TODO add textureReference::borderColor. assert(false && "textureReference::borderColor is missing in header"); @@ -1159,6 +1325,12 @@ hipError_t hipTexRefSetMaxAnisotropy(textureReference* texRef, if (texRef == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->maxAnisotropy = maxAniso; @@ -1172,6 +1344,12 @@ hipError_t hipTexRefSetMipmapFilterMode(textureReference* texRef, if (texRef == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->mipmapFilterMode = fm; @@ -1185,6 +1363,12 @@ hipError_t hipTexRefSetMipmapLevelBias(textureReference* texRef, if (texRef == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->mipmapLevelBias = bias; @@ -1199,6 +1383,12 @@ hipError_t hipTexRefSetMipmapLevelClamp(textureReference* texRef, if (texRef == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } texRef->minMipmapLevelClamp = minMipMapLevelClamp; texRef->maxMipmapLevelClamp = maxMipMapLevelClamp; @@ -1227,7 +1417,10 @@ hipError_t hipTexRefSetMipmappedArray(textureReference* texRef, // Any previous address or HIP array state associated with the texture reference is superseded by this function. // Any memory previously bound to hTexRef is unbound. // No need to check for errors. - ihipDestroyTextureObject(texRef->textureObject); + hipError_t err = ihipDestroyTextureObject(texRef->textureObject); + if (err != hipSuccess) { + HIP_RETURN(err); + } hipResourceDesc resDesc = {}; resDesc.resType = hipResourceTypeMipmappedArray; @@ -1238,7 +1431,7 @@ hipError_t hipTexRefSetMipmappedArray(textureReference* texRef, hipResourceViewFormat format = hip::getResourceViewFormat(hip::getChannelFormatDesc(texRef->numChannels, texRef->format)); hipResourceViewDesc resViewDesc = hip::getResourceViewDesc(mipmappedArray, format); - hipError_t err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, &resViewDesc); + err = ihipCreateTextureObject(&texRef->textureObject, &resDesc, &texDesc, &resViewDesc); if (err != hipSuccess) { HIP_RETURN(err); } @@ -1281,6 +1474,12 @@ hipError_t hipTexObjectGetResourceDesc(HIP_RESOURCE_DESC* pResDesc, if ((pResDesc == nullptr) || (texObject == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pResDesc = hip::getResourceDesc(texObject->resDesc); @@ -1294,6 +1493,12 @@ hipError_t hipTexObjectGetResourceViewDesc(HIP_RESOURCE_VIEW_DESC* pResViewDesc, if ((pResViewDesc == nullptr) || (texObject == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pResViewDesc = hip::getResourceViewDesc(texObject->resViewDesc); @@ -1307,6 +1512,12 @@ hipError_t hipTexObjectGetTextureDesc(HIP_TEXTURE_DESC* pTexDesc, if ((pTexDesc == nullptr) || (texObject == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + amd::Device* device = hip::getCurrentDevice()->devices()[0]; + const device::Info& info = device->info(); + if (!info.imageSupport_) { + LogPrintfError("Texture not supported on the device %s", info.name_); + HIP_RETURN(hipErrorNotSupported); + } *pTexDesc = hip::getTextureDesc(texObject->texDesc);