HIP: Heterogenous-computing Interface for Portability
texture_functions.h
1 /*
2 Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_TEXTURE_FUNCTIONS_H
24 #define HIP_INCLUDE_HIP_HCC_DETAIL_TEXTURE_FUNCTIONS_H
27 
28 #pragma push_macro("TYPEDEF_VECTOR_VALUE_TYPE")
29 #define TYPEDEF_VECTOR_VALUE_TYPE(SCALAR_TYPE) \
30 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##2_vector_value_type __attribute__((ext_vector_type(2))); \
31 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##3_vector_value_type __attribute__((ext_vector_type(3))); \
32 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##4_vector_value_type __attribute__((ext_vector_type(4))); \
33 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##8_vector_value_type __attribute__((ext_vector_type(8))); \
34 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##16_vector_value_type __attribute__((ext_vector_type(16)));
35 
36 TYPEDEF_VECTOR_VALUE_TYPE(float);
37 TYPEDEF_VECTOR_VALUE_TYPE(int);
38 TYPEDEF_VECTOR_VALUE_TYPE(uint);
39 
40 #undef TYPEDEF_VECTOR_VALUE_TYPE
41 #pragma pop_macro("TYPEDEF_VECTOR_VALUE_TYPE")
42 
43 union TData {
44  __hip_float4_vector_value_type f;
45  __hip_int4_vector_value_type i;
46  __hip_uint4_vector_value_type u;
47 };
48 
49 #define __TEXTURE_FUNCTIONS_DECL__ static inline __device__
50 
51 
52 #if (__hcc_workweek__ >= 18114) || __clang__
53 #define ADDRESS_SPACE_CONSTANT __attribute__((address_space(4)))
54 #else
55 #define ADDRESS_SPACE_CONSTANT __attribute__((address_space(2)))
56 #endif
57 
58 #define TEXTURE_PARAMETERS_INIT \
59  unsigned int ADDRESS_SPACE_CONSTANT* i = (unsigned int ADDRESS_SPACE_CONSTANT*)textureObject; \
60  unsigned int ADDRESS_SPACE_CONSTANT* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \
61  TData texel;
62 #define TEXTURE_REF_PARAMETERS_INIT \
63  unsigned int ADDRESS_SPACE_CONSTANT* i = (unsigned int ADDRESS_SPACE_CONSTANT*)texRef.textureObject; \
64  unsigned int ADDRESS_SPACE_CONSTANT* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \
65  TData texel;
66 #define TEXTURE_SET_FLOAT *retVal = texel.f.x;
67 
68 #define TEXTURE_SET_SIGNED *retVal = texel.i.x;
69 
70 #define TEXTURE_SET_UNSIGNED *retVal = texel.u.x;
71 
72 #define TEXTURE_SET_FLOAT_X retVal->x = texel.f.x;
73 
74 #define TEXTURE_SET_SIGNED_X retVal->x = texel.i.x;
75 
76 #define TEXTURE_SET_UNSIGNED_X retVal->x = texel.u.x;
77 
78 #define TEXTURE_SET_FLOAT_XY \
79  retVal->x = texel.f.x; \
80  retVal->y = texel.f.y;
81 
82 #define TEXTURE_SET_SIGNED_XY \
83  retVal->x = texel.i.x; \
84  retVal->y = texel.i.y;
85 
86 #define TEXTURE_SET_UNSIGNED_XY \
87  retVal->x = texel.u.x; \
88  retVal->y = texel.u.y;
89 
90 #define TEXTURE_SET_FLOAT_XYZW \
91  retVal->x = texel.f.x; \
92  retVal->y = texel.f.y; \
93  retVal->z = texel.f.z; \
94  retVal->w = texel.f.w;
95 
96 #define TEXTURE_SET_SIGNED_XYZW \
97  retVal->x = texel.i.x; \
98  retVal->y = texel.i.y; \
99  retVal->z = texel.i.z; \
100  retVal->w = texel.i.w;
101 
102 #define TEXTURE_SET_UNSIGNED_XYZW \
103  retVal->x = texel.u.x; \
104  retVal->y = texel.u.y; \
105  retVal->z = texel.u.z; \
106  retVal->w = texel.u.w;
107 
108 #define TEXTURE_RETURN_CHAR return texel.i.x;
109 
110 #define TEXTURE_RETURN_UCHAR return texel.u.x;
111 
112 #define TEXTURE_RETURN_SHORT return texel.i.x;
113 
114 #define TEXTURE_RETURN_USHORT return texel.u.x;
115 
116 #define TEXTURE_RETURN_INT return texel.i.x;
117 
118 #define TEXTURE_RETURN_UINT return texel.u.x;
119 
120 #define TEXTURE_RETURN_SIGNED return texel.i.x;
121 
122 #define TEXTURE_RETURN_UNSIGNED return texel.u.x;
123 
124 #define TEXTURE_RETURN_CHAR_X return make_char1(texel.i.x);
125 
126 #define TEXTURE_RETURN_UCHAR_X return make_uchar1(texel.u.x);
127 
128 #define TEXTURE_RETURN_SHORT_X return make_short1(texel.i.x);
129 
130 #define TEXTURE_RETURN_USHORT_X return make_ushort1(texel.u.x);
131 
132 #define TEXTURE_RETURN_INT_X return make_int1(texel.i.x);
133 
134 #define TEXTURE_RETURN_UINT_X return make_uint1(texel.u.x);
135 
136 #define TEXTURE_RETURN_CHAR_XY return make_char2(texel.i.x, texel.i.y);
137 
138 #define TEXTURE_RETURN_UCHAR_XY return make_uchar2(texel.u.x, texel.u.y);
139 
140 #define TEXTURE_RETURN_SHORT_XY return make_short2(texel.i.x, texel.i.y);
141 
142 #define TEXTURE_RETURN_USHORT_XY return make_ushort2(texel.u.x, texel.u.y);
143 
144 #define TEXTURE_RETURN_INT_XY return make_int2(texel.i.x, texel.i.y);
145 
146 #define TEXTURE_RETURN_UINT_XY return make_uint2(texel.u.x, texel.u.y);
147 
148 #define TEXTURE_RETURN_CHAR_XYZW return make_char4(texel.i.x, texel.i.y, texel.i.z, texel.i.w);
149 
150 #define TEXTURE_RETURN_UCHAR_XYZW return make_uchar4(texel.u.x, texel.u.y, texel.u.z, texel.u.w);
151 
152 #define TEXTURE_RETURN_SHORT_XYZW return make_short4(texel.i.x, texel.i.y, texel.i.z, texel.i.w);
153 
154 #define TEXTURE_RETURN_USHORT_XYZW return make_ushort4(texel.u.x, texel.u.y, texel.u.z, texel.u.w);
155 
156 #define TEXTURE_RETURN_INT_XYZW return make_int4(texel.i.x, texel.i.y, texel.i.z, texel.i.w);
157 
158 #define TEXTURE_RETURN_UINT_XYZW return make_uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w);
159 
160 #define HIP_AD_FORMAT_NOT_INITIALIZED 0
161 
162 #define TEXTURE_RETURN_FLOAT return (texFormatToSize[texRef.format] == 1)? texel.f.x : (float)texel.u.x/texFormatToSize[texRef.format];
163 
164 #define TEXTURE_RETURN_FLOAT_X return (texFormatToSize[texRef.format] == 1)? make_float1(texel.f.x) : make_float1((float)texel.u.x/texFormatToSize[texRef.format]);
165 
166 #define TEXTURE_RETURN_FLOAT_XY return (texFormatToSize[texRef.format] == 1)? make_float2(texel.f.x, texel.f.y) : make_float2((float)texel.u.x/texFormatToSize[texRef.format], (float)texel.u.y/texFormatToSize[texRef.format]);
167 
168 #define TEXTURE_RETURN_FLOAT_XYZW return (texFormatToSize[texRef.format] == 1)? make_float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w) : make_float4((float)texel.u.x/texFormatToSize[texRef.format], (float)texel.u.y/texFormatToSize[texRef.format], (float)texel.u.z/texFormatToSize[texRef.format], (float)texel.u.w/texFormatToSize[texRef.format]) ;
169 
170 extern "C" {
171 
172  __device__ __constant__ static int texFormatToSize[] = {
173  [HIP_AD_FORMAT_NOT_INITIALIZED] = 1 ,
174  [HIP_AD_FORMAT_UNSIGNED_INT8] = UCHAR_MAX ,
175  [HIP_AD_FORMAT_UNSIGNED_INT16]= USHRT_MAX,
176  [HIP_AD_FORMAT_UNSIGNED_INT32]= 1 ,
177  [HIP_AD_FORMAT_SIGNED_INT8] = SCHAR_MAX,
178  [HIP_AD_FORMAT_SIGNED_INT16] = SHRT_MAX,
179  [HIP_AD_FORMAT_SIGNED_INT32] = 1 ,
180  [HIP_AD_FORMAT_HALF] = 1 ,
181  [HIP_AD_FORMAT_FLOAT] = 1
182 };
183 
184 __device__
185 __hip_float4_vector_value_type __ockl_image_sample_1D(
186  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
187  float c);
188 
189 __device__
190 __hip_float4_vector_value_type __ockl_image_sample_1Da(
191  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
192  __hip_float2_vector_value_type c);
193 
194 __device__
195 __hip_float4_vector_value_type __ockl_image_sample_2D(
196  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
197  __hip_float2_vector_value_type c);
198 
199 
200 __device__
201 __hip_float4_vector_value_type __ockl_image_sample_2Da(
202  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
203  __hip_float4_vector_value_type c);
204 
205 __device__
206 float __ockl_image_sample_2Dad(
207  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
208  __hip_float4_vector_value_type c);
209 
210 __device__
211 float __ockl_image_sample_2Dd(
212  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
213  __hip_float2_vector_value_type c);
214 
215 __device__
216 __hip_float4_vector_value_type __ockl_image_sample_3D(
217  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
218  __hip_float4_vector_value_type c);
219 
220 __device__
221 __hip_float4_vector_value_type __ockl_image_sample_grad_1D(
222  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
223  float c, float dx, float dy);
224 
225 __device__
226 __hip_float4_vector_value_type __ockl_image_sample_grad_1Da(
227  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
228  __hip_float2_vector_value_type c, float dx, float dy);
229 
230 __device__
231 __hip_float4_vector_value_type __ockl_image_sample_grad_2D(
232  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
233  __hip_float2_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
234 
235 __device__
236 __hip_float4_vector_value_type __ockl_image_sample_grad_2Da(
237  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
238  __hip_float4_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
239 
240 __device__
241 float __ockl_image_sample_grad_2Dad(
242  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
243  __hip_float4_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
244 
245 __device__
246 float __ockl_image_sample_grad_2Dd(
247  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
248  __hip_float2_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
249 
250 __device__
251 __hip_float4_vector_value_type __ockl_image_sample_grad_3D(
252  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
253  __hip_float4_vector_value_type c, __hip_float4_vector_value_type dx, __hip_float4_vector_value_type dy);
254 
255 __device__
256 __hip_float4_vector_value_type __ockl_image_sample_lod_1D(
257  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
258  float c, float l);
259 
260 __device__
261 __hip_float4_vector_value_type __ockl_image_sample_lod_1Da(
262  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
263  __hip_float2_vector_value_type c, float l);
264 
265 __device__
266 __hip_float4_vector_value_type __ockl_image_sample_lod_2D(
267  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
268  __hip_float2_vector_value_type c, float l);
269 
270 __device__
271 __hip_float4_vector_value_type __ockl_image_sample_lod_2Da(
272  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
273  __hip_float4_vector_value_type c, float l);
274 
275 __device__
276 float __ockl_image_sample_lod_2Dad(
277  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
278  __hip_float4_vector_value_type c, float l);
279 
280 __device__
281 float __ockl_image_sample_lod_2Dd(
282  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
283  __hip_float2_vector_value_type c, float l);
284 
285 __device__
286 __hip_float4_vector_value_type __ockl_image_sample_lod_3D(
287  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
288  __hip_float4_vector_value_type c, float l);
289 }
290 
292 // Texture object APIs
294 
295 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char* retVal, hipTextureObject_t textureObject, int x) {
296  TEXTURE_PARAMETERS_INIT;
297  texel.f = __ockl_image_sample_1D(i, s, x);
298  TEXTURE_SET_SIGNED;
299 }
300 
301 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char1* retVal, hipTextureObject_t textureObject, int x) {
302  TEXTURE_PARAMETERS_INIT;
303  texel.f = __ockl_image_sample_1D(i, s, x);
304  TEXTURE_SET_SIGNED_X;
305 }
306 
307 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char2* retVal, hipTextureObject_t textureObject, int x) {
308  TEXTURE_PARAMETERS_INIT;
309  texel.f = __ockl_image_sample_1D(i, s, x);
310  TEXTURE_SET_SIGNED_XY;
311 }
312 
313 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char4* retVal, hipTextureObject_t textureObject, int x) {
314  TEXTURE_PARAMETERS_INIT;
315  texel.f = __ockl_image_sample_1D(i, s, x);
316  TEXTURE_SET_SIGNED_XYZW;
317 }
318 
319 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned char* retVal, hipTextureObject_t textureObject,
320  int x) {
321  TEXTURE_PARAMETERS_INIT;
322  texel.f = __ockl_image_sample_1D(i, s, x);
323  TEXTURE_SET_UNSIGNED;
324 }
325 
326 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar1* retVal, hipTextureObject_t textureObject,
327  int x) {
328  TEXTURE_PARAMETERS_INIT;
329  texel.f = __ockl_image_sample_1D(i, s, x);
330  TEXTURE_SET_UNSIGNED_X;
331 }
332 
333 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar2* retVal, hipTextureObject_t textureObject,
334  int x) {
335  TEXTURE_PARAMETERS_INIT;
336  texel.f = __ockl_image_sample_1D(i, s, x);
337  TEXTURE_SET_UNSIGNED_XY;
338 }
339 
340 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar4* retVal, hipTextureObject_t textureObject,
341  int x) {
342  TEXTURE_PARAMETERS_INIT;
343  texel.f = __ockl_image_sample_1D(i, s, x);
344  TEXTURE_SET_UNSIGNED_XYZW;
345 }
346 
347 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short* retVal, hipTextureObject_t textureObject, int x) {
348  TEXTURE_PARAMETERS_INIT;
349  texel.f = __ockl_image_sample_1D(i, s, x);
350  TEXTURE_SET_SIGNED;
351 }
352 
353 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short1* retVal, hipTextureObject_t textureObject,
354  int x) {
355  TEXTURE_PARAMETERS_INIT;
356  texel.f = __ockl_image_sample_1D(i, s, x);
357  TEXTURE_SET_SIGNED_X;
358 }
359 
360 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short2* retVal, hipTextureObject_t textureObject,
361  int x) {
362  TEXTURE_PARAMETERS_INIT;
363  texel.f = __ockl_image_sample_1D(i, s, x);
364  TEXTURE_SET_SIGNED_XY;
365 }
366 
367 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short4* retVal, hipTextureObject_t textureObject,
368  int x) {
369  TEXTURE_PARAMETERS_INIT;
370  texel.f = __ockl_image_sample_1D(i, s, x);
371  TEXTURE_SET_SIGNED_XYZW;
372 }
373 
374 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned short* retVal, hipTextureObject_t textureObject,
375  int x) {
376  TEXTURE_PARAMETERS_INIT;
377  texel.f = __ockl_image_sample_1D(i, s, x);
378  TEXTURE_SET_SIGNED;
379 }
380 
381 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort1* retVal, hipTextureObject_t textureObject,
382  int x) {
383  TEXTURE_PARAMETERS_INIT;
384  texel.f = __ockl_image_sample_1D(i, s, x);
385  TEXTURE_SET_UNSIGNED_X;
386 }
387 
388 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort2* retVal, hipTextureObject_t textureObject,
389  int x) {
390  TEXTURE_PARAMETERS_INIT;
391  texel.f = __ockl_image_sample_1D(i, s, x);
392  TEXTURE_SET_UNSIGNED_XY;
393 }
394 
395 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort4* retVal, hipTextureObject_t textureObject,
396  int x) {
397  TEXTURE_PARAMETERS_INIT;
398  texel.f = __ockl_image_sample_1D(i, s, x);
399  TEXTURE_SET_UNSIGNED_XYZW;
400 }
401 
402 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int* retVal, hipTextureObject_t textureObject, int x) {
403  TEXTURE_PARAMETERS_INIT;
404  texel.f = __ockl_image_sample_1D(i, s, x);
405  TEXTURE_SET_SIGNED;
406 }
407 
408 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int1* retVal, hipTextureObject_t textureObject, int x) {
409  TEXTURE_PARAMETERS_INIT;
410  texel.f = __ockl_image_sample_1D(i, s, x);
411  TEXTURE_SET_SIGNED_X;
412 }
413 
414 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int2* retVal, hipTextureObject_t textureObject, int x) {
415  TEXTURE_PARAMETERS_INIT;
416  texel.f = __ockl_image_sample_1D(i, s, x);
417  TEXTURE_SET_SIGNED_XY;
418 }
419 
420 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int4* retVal, hipTextureObject_t textureObject, int x) {
421  TEXTURE_PARAMETERS_INIT;
422  texel.f = __ockl_image_sample_1D(i, s, x);
423  TEXTURE_SET_SIGNED_XYZW;
424 }
425 
426 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned int* retVal, hipTextureObject_t textureObject,
427  int x) {
428  TEXTURE_PARAMETERS_INIT;
429  texel.f = __ockl_image_sample_1D(i, s, x);
430  TEXTURE_SET_UNSIGNED;
431 }
432 
433 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint1* retVal, hipTextureObject_t textureObject, int x) {
434  TEXTURE_PARAMETERS_INIT;
435  texel.f = __ockl_image_sample_1D(i, s, x);
436  TEXTURE_SET_UNSIGNED_X;
437 }
438 
439 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint2* retVal, hipTextureObject_t textureObject, int x) {
440  TEXTURE_PARAMETERS_INIT;
441  texel.f = __ockl_image_sample_1D(i, s, x);
442  TEXTURE_SET_UNSIGNED_XY;
443 }
444 
445 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint4* retVal, hipTextureObject_t textureObject, int x) {
446  TEXTURE_PARAMETERS_INIT;
447  texel.f = __ockl_image_sample_1D(i, s, x);
448  TEXTURE_SET_UNSIGNED_XYZW;
449 }
450 
451 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float* retVal, hipTextureObject_t textureObject, int x) {
452  TEXTURE_PARAMETERS_INIT;
453  texel.f = __ockl_image_sample_1D(i, s, x);
454  TEXTURE_SET_FLOAT;
455 }
456 
457 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float1* retVal, hipTextureObject_t textureObject,
458  int x) {
459  TEXTURE_PARAMETERS_INIT;
460  texel.f = __ockl_image_sample_1D(i, s, x);
461  TEXTURE_SET_FLOAT_X;
462 }
463 
464 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float2* retVal, hipTextureObject_t textureObject,
465  int x) {
466  TEXTURE_PARAMETERS_INIT;
467  texel.f = __ockl_image_sample_1D(i, s, x);
468  TEXTURE_SET_FLOAT_XY;
469 }
470 
471 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float4* retVal, hipTextureObject_t textureObject,
472  int x) {
473  TEXTURE_PARAMETERS_INIT;
474  texel.f = __ockl_image_sample_1D(i, s, x);
475  TEXTURE_SET_FLOAT_XYZW;
476 }
477 
478 template <class T>
479 __TEXTURE_FUNCTIONS_DECL__ T tex1Dfetch(hipTextureObject_t textureObject, int x) {
480  T ret;
481  tex1Dfetch(&ret, textureObject, x);
482  return ret;
483 }
484 
486 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char* retVal, hipTextureObject_t textureObject, float x) {
487  TEXTURE_PARAMETERS_INIT;
488  texel.f = __ockl_image_sample_1D(i, s, x);
489  TEXTURE_SET_SIGNED;
490 }
491 
492 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char1* retVal, hipTextureObject_t textureObject, float x) {
493  TEXTURE_PARAMETERS_INIT;
494  texel.f = __ockl_image_sample_1D(i, s, x);
495  TEXTURE_SET_SIGNED_X;
496 }
497 
498 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char2* retVal, hipTextureObject_t textureObject, float x) {
499  TEXTURE_PARAMETERS_INIT;
500  texel.f = __ockl_image_sample_1D(i, s, x);
501  TEXTURE_SET_SIGNED_XY;
502 }
503 
504 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char4* retVal, hipTextureObject_t textureObject, float x) {
505  TEXTURE_PARAMETERS_INIT;
506  texel.f = __ockl_image_sample_1D(i, s, x);
507  TEXTURE_SET_SIGNED_XYZW;
508 }
509 
510 __TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned char* retVal, hipTextureObject_t textureObject,
511  float x) {
512  TEXTURE_PARAMETERS_INIT;
513  texel.f = __ockl_image_sample_1D(i, s, x);
514  TEXTURE_SET_UNSIGNED;
515 }
516 
517 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar1* retVal, hipTextureObject_t textureObject, float x) {
518  TEXTURE_PARAMETERS_INIT;
519  texel.f = __ockl_image_sample_1D(i, s, x);
520  TEXTURE_SET_UNSIGNED_X;
521 }
522 
523 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar2* retVal, hipTextureObject_t textureObject, float x) {
524  TEXTURE_PARAMETERS_INIT;
525  texel.f = __ockl_image_sample_1D(i, s, x);
526  TEXTURE_SET_UNSIGNED_XY;
527 }
528 
529 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar4* retVal, hipTextureObject_t textureObject, float x) {
530  TEXTURE_PARAMETERS_INIT;
531  texel.f = __ockl_image_sample_1D(i, s, x);
532  TEXTURE_SET_UNSIGNED_XYZW;
533 }
534 
535 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short* retVal, hipTextureObject_t textureObject, float x) {
536  TEXTURE_PARAMETERS_INIT;
537  texel.f = __ockl_image_sample_1D(i, s, x);
538  TEXTURE_SET_SIGNED;
539 }
540 
541 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short1* retVal, hipTextureObject_t textureObject, float x) {
542  TEXTURE_PARAMETERS_INIT;
543  texel.f = __ockl_image_sample_1D(i, s, x);
544  TEXTURE_SET_SIGNED_X;
545 }
546 
547 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short2* retVal, hipTextureObject_t textureObject, float x) {
548  TEXTURE_PARAMETERS_INIT;
549  texel.f = __ockl_image_sample_1D(i, s, x);
550  TEXTURE_SET_SIGNED_XY;
551 }
552 
553 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short4* retVal, hipTextureObject_t textureObject, float x) {
554  TEXTURE_PARAMETERS_INIT;
555  texel.f = __ockl_image_sample_1D(i, s, x);
556  TEXTURE_SET_SIGNED_XYZW;
557 }
558 
559 __TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned short* retVal, hipTextureObject_t textureObject,
560  float x) {
561  TEXTURE_PARAMETERS_INIT;
562  texel.f = __ockl_image_sample_1D(i, s, x);
563  TEXTURE_SET_UNSIGNED;
564 }
565 
566 __TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort1* retVal, hipTextureObject_t textureObject, float x) {
567  TEXTURE_PARAMETERS_INIT;
568  texel.f = __ockl_image_sample_1D(i, s, x);
569  TEXTURE_SET_UNSIGNED_X;
570 }
571 
572 __TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort2* retVal, hipTextureObject_t textureObject, float x) {
573  TEXTURE_PARAMETERS_INIT;
574  texel.f = __ockl_image_sample_1D(i, s, x);
575  TEXTURE_SET_UNSIGNED_XY;
576 }
577 
578 __TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort4* retVal, hipTextureObject_t textureObject, float x) {
579  TEXTURE_PARAMETERS_INIT;
580  texel.f = __ockl_image_sample_1D(i, s, x);
581  TEXTURE_SET_UNSIGNED_XYZW;
582 }
583 
584 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int* retVal, hipTextureObject_t textureObject, float x) {
585  TEXTURE_PARAMETERS_INIT;
586  texel.f = __ockl_image_sample_1D(i, s, x);
587  TEXTURE_SET_SIGNED;
588 }
589 
590 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int1* retVal, hipTextureObject_t textureObject, float x) {
591  TEXTURE_PARAMETERS_INIT;
592  texel.f = __ockl_image_sample_1D(i, s, x);
593  TEXTURE_SET_SIGNED_X;
594 }
595 
596 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int2* retVal, hipTextureObject_t textureObject, float x) {
597  TEXTURE_PARAMETERS_INIT;
598  texel.f = __ockl_image_sample_1D(i, s, x);
599  TEXTURE_SET_SIGNED_XY;
600 }
601 
602 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int4* retVal, hipTextureObject_t textureObject, float x) {
603  TEXTURE_PARAMETERS_INIT;
604  texel.f = __ockl_image_sample_1D(i, s, x);
605  TEXTURE_SET_SIGNED_XYZW;
606 }
607 
608 __TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned int* retVal, hipTextureObject_t textureObject,
609  float x) {
610  TEXTURE_PARAMETERS_INIT;
611  texel.f = __ockl_image_sample_1D(i, s, x);
612  TEXTURE_SET_UNSIGNED;
613 }
614 
615 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uint1* retVal, hipTextureObject_t textureObject, float x) {
616  TEXTURE_PARAMETERS_INIT;
617  texel.f = __ockl_image_sample_1D(i, s, x);
618  TEXTURE_SET_UNSIGNED_X;
619 }
620 
621 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uint2* retVal, hipTextureObject_t textureObject, float x) {
622  TEXTURE_PARAMETERS_INIT;
623  texel.f = __ockl_image_sample_1D(i, s, x);
624  TEXTURE_SET_UNSIGNED_XY;
625 }
626 
627 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uint4* retVal, hipTextureObject_t textureObject, float x) {
628  TEXTURE_PARAMETERS_INIT;
629  texel.f = __ockl_image_sample_1D(i, s, x);
630  TEXTURE_SET_UNSIGNED_XYZW;
631 }
632 
633 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float* retVal, hipTextureObject_t textureObject, float x) {
634  TEXTURE_PARAMETERS_INIT;
635  texel.f = __ockl_image_sample_1D(i, s, x);
636  TEXTURE_SET_FLOAT;
637 }
638 
639 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float1* retVal, hipTextureObject_t textureObject, float x) {
640  TEXTURE_PARAMETERS_INIT;
641  texel.f = __ockl_image_sample_1D(i, s, x);
642  TEXTURE_SET_FLOAT_X;
643 }
644 
645 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float2* retVal, hipTextureObject_t textureObject, float x) {
646  TEXTURE_PARAMETERS_INIT;
647  texel.f = __ockl_image_sample_1D(i, s, x);
648  TEXTURE_SET_FLOAT_XY;
649 }
650 
651 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float4* retVal, hipTextureObject_t textureObject, float x) {
652  TEXTURE_PARAMETERS_INIT;
653  texel.f = __ockl_image_sample_1D(i, s, x);
654  TEXTURE_SET_FLOAT_XYZW;
655 }
656 template <class T>
657 __TEXTURE_FUNCTIONS_DECL__ T tex1D(hipTextureObject_t textureObject, float x) {
658  T ret;
659  tex1D(&ret, textureObject, x);
660  return ret;
661 }
662 
664 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char* retVal, hipTextureObject_t textureObject, float x,
665  float level) {
666  TEXTURE_PARAMETERS_INIT;
667  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
668  TEXTURE_SET_SIGNED;
669 }
670 
671 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char1* retVal, hipTextureObject_t textureObject, float x,
672  float level) {
673  TEXTURE_PARAMETERS_INIT;
674  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
675  TEXTURE_SET_SIGNED_X;
676 }
677 
678 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char2* retVal, hipTextureObject_t textureObject, float x,
679  float level) {
680  TEXTURE_PARAMETERS_INIT;
681  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
682  TEXTURE_SET_SIGNED_XY;
683 }
684 
685 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char4* retVal, hipTextureObject_t textureObject, float x,
686  float level) {
687  TEXTURE_PARAMETERS_INIT;
688  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
689  TEXTURE_SET_SIGNED_XYZW;
690 }
691 
692 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned char* retVal, hipTextureObject_t textureObject,
693  float x, float level) {
694  TEXTURE_PARAMETERS_INIT;
695  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
696  TEXTURE_SET_UNSIGNED;
697 }
698 
699 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar1* retVal, hipTextureObject_t textureObject, float x,
700  float level) {
701  TEXTURE_PARAMETERS_INIT;
702  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
703  TEXTURE_SET_UNSIGNED_X;
704 }
705 
706 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar2* retVal, hipTextureObject_t textureObject, float x,
707  float level) {
708  TEXTURE_PARAMETERS_INIT;
709  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
710  TEXTURE_SET_UNSIGNED_XY;
711 }
712 
713 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar4* retVal, hipTextureObject_t textureObject, float x,
714  float level) {
715  TEXTURE_PARAMETERS_INIT;
716  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
717  TEXTURE_SET_UNSIGNED_XYZW;
718 }
719 
720 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short* retVal, hipTextureObject_t textureObject, float x,
721  float level) {
722  TEXTURE_PARAMETERS_INIT;
723  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
724  TEXTURE_SET_SIGNED;
725 }
726 
727 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short1* retVal, hipTextureObject_t textureObject, float x,
728  float level) {
729  TEXTURE_PARAMETERS_INIT;
730  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
731  TEXTURE_SET_SIGNED_X;
732 }
733 
734 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short2* retVal, hipTextureObject_t textureObject, float x,
735  float level) {
736  TEXTURE_PARAMETERS_INIT;
737  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
738  TEXTURE_SET_SIGNED_XY;
739 }
740 
741 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short4* retVal, hipTextureObject_t textureObject, float x,
742  float level) {
743  TEXTURE_PARAMETERS_INIT;
744  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
745  TEXTURE_SET_SIGNED_XYZW;
746 }
747 
748 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned short* retVal, hipTextureObject_t textureObject,
749  float x, float level) {
750  TEXTURE_PARAMETERS_INIT;
751  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
752  TEXTURE_SET_UNSIGNED;
753 }
754 
755 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort1* retVal, hipTextureObject_t textureObject, float x,
756  float level) {
757  TEXTURE_PARAMETERS_INIT;
758  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
759  TEXTURE_SET_UNSIGNED_X;
760 }
761 
762 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort2* retVal, hipTextureObject_t textureObject, float x,
763  float level) {
764  TEXTURE_PARAMETERS_INIT;
765  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
766  TEXTURE_SET_UNSIGNED_XY;
767 }
768 
769 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort4* retVal, hipTextureObject_t textureObject, float x,
770  float level) {
771  TEXTURE_PARAMETERS_INIT;
772  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
773  TEXTURE_SET_UNSIGNED_XYZW;
774 }
775 
776 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int* retVal, hipTextureObject_t textureObject, float x,
777  float level) {
778  TEXTURE_PARAMETERS_INIT;
779  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
780  TEXTURE_SET_SIGNED;
781 }
782 
783 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int1* retVal, hipTextureObject_t textureObject, float x,
784  float level) {
785  TEXTURE_PARAMETERS_INIT;
786  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
787  TEXTURE_SET_SIGNED_X;
788 }
789 
790 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int2* retVal, hipTextureObject_t textureObject, float x,
791  float level) {
792  TEXTURE_PARAMETERS_INIT;
793  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
794  TEXTURE_SET_SIGNED_XY;
795 }
796 
797 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int4* retVal, hipTextureObject_t textureObject, float x,
798  float level) {
799  TEXTURE_PARAMETERS_INIT;
800  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
801  TEXTURE_SET_SIGNED_XYZW;
802 }
803 
804 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned int* retVal, hipTextureObject_t textureObject,
805  float x, float level) {
806  TEXTURE_PARAMETERS_INIT;
807  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
808  TEXTURE_SET_UNSIGNED;
809 }
810 
811 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint1* retVal, hipTextureObject_t textureObject, float x,
812  float level) {
813  TEXTURE_PARAMETERS_INIT;
814  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
815  TEXTURE_SET_UNSIGNED_X;
816 }
817 
818 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint2* retVal, hipTextureObject_t textureObject, float x,
819  float level) {
820  TEXTURE_PARAMETERS_INIT;
821  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
822  TEXTURE_SET_UNSIGNED_XY;
823 }
824 
825 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint4* retVal, hipTextureObject_t textureObject, float x,
826  float level) {
827  TEXTURE_PARAMETERS_INIT;
828  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
829  TEXTURE_SET_UNSIGNED_XYZW;
830 }
831 
832 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float* retVal, hipTextureObject_t textureObject, float x,
833  float level) {
834  TEXTURE_PARAMETERS_INIT;
835  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
836  TEXTURE_SET_FLOAT;
837 }
838 
839 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float1* retVal, hipTextureObject_t textureObject, float x,
840  float level) {
841  TEXTURE_PARAMETERS_INIT;
842  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
843  TEXTURE_SET_FLOAT_X;
844 }
845 
846 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float2* retVal, hipTextureObject_t textureObject, float x,
847  float level) {
848  TEXTURE_PARAMETERS_INIT;
849  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
850  TEXTURE_SET_FLOAT_XY;
851 }
852 
853 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float4* retVal, hipTextureObject_t textureObject, float x,
854  float level) {
855  TEXTURE_PARAMETERS_INIT;
856  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
857  TEXTURE_SET_FLOAT_XYZW;
858 }
859 
860 template <class T>
861 __TEXTURE_FUNCTIONS_DECL__ T tex1DLod(hipTextureObject_t textureObject, float x, float level) {
862  T ret;
863  tex1DLod(&ret, textureObject, x, level);
864  return ret;
865 }
866 
868 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char* retVal, hipTextureObject_t textureObject, float x,
869  float dx, float dy) {
870  TEXTURE_PARAMETERS_INIT;
871  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
872  TEXTURE_SET_SIGNED;
873 }
874 
875 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char1* retVal, hipTextureObject_t textureObject, float x,
876  float dx, float dy) {
877  TEXTURE_PARAMETERS_INIT;
878  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
879  TEXTURE_SET_SIGNED_X;
880 }
881 
882 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char2* retVal, hipTextureObject_t textureObject, float x,
883  float dx, float dy) {
884  TEXTURE_PARAMETERS_INIT;
885  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
886  TEXTURE_SET_SIGNED_XY;
887 }
888 
889 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char4* retVal, hipTextureObject_t textureObject, float x,
890  float dx, float dy) {
891  TEXTURE_PARAMETERS_INIT;
892  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
893  TEXTURE_SET_SIGNED_XYZW;
894 }
895 
896 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned char* retVal, hipTextureObject_t textureObject,
897  float x, float dx, float dy) {
898  TEXTURE_PARAMETERS_INIT;
899  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
900  TEXTURE_SET_UNSIGNED;
901 }
902 
903 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar1* retVal, hipTextureObject_t textureObject, float x,
904  float dx, float dy) {
905  TEXTURE_PARAMETERS_INIT;
906  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
907  TEXTURE_SET_UNSIGNED_X;
908 }
909 
910 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar2* retVal, hipTextureObject_t textureObject, float x,
911  float dx, float dy) {
912  TEXTURE_PARAMETERS_INIT;
913  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
914  TEXTURE_SET_UNSIGNED_XY;
915 }
916 
917 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar4* retVal, hipTextureObject_t textureObject, float x,
918  float dx, float dy) {
919  TEXTURE_PARAMETERS_INIT;
920  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
921  TEXTURE_SET_UNSIGNED_XYZW;
922 }
923 
924 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short* retVal, hipTextureObject_t textureObject, float x,
925  float dx, float dy) {
926  TEXTURE_PARAMETERS_INIT;
927  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
928  TEXTURE_SET_SIGNED;
929 }
930 
931 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short1* retVal, hipTextureObject_t textureObject, float x,
932  float dx, float dy) {
933  TEXTURE_PARAMETERS_INIT;
934  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
935  TEXTURE_SET_SIGNED_X;
936 }
937 
938 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short2* retVal, hipTextureObject_t textureObject, float x,
939  float dx, float dy) {
940  TEXTURE_PARAMETERS_INIT;
941  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
942  TEXTURE_SET_SIGNED_XY;
943 }
944 
945 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short4* retVal, hipTextureObject_t textureObject, float x,
946  float dx, float dy) {
947  TEXTURE_PARAMETERS_INIT;
948  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
949  TEXTURE_SET_SIGNED_XYZW;
950 }
951 
952 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned short* retVal, hipTextureObject_t textureObject,
953  float x, float dx, float dy) {
954  TEXTURE_PARAMETERS_INIT;
955  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
956  TEXTURE_SET_UNSIGNED;
957 }
958 
959 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort1* retVal, hipTextureObject_t textureObject,
960  float x, float dx, float dy) {
961  TEXTURE_PARAMETERS_INIT;
962  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
963  TEXTURE_SET_UNSIGNED_X;
964 }
965 
966 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort2* retVal, hipTextureObject_t textureObject,
967  float x, float dx, float dy) {
968  TEXTURE_PARAMETERS_INIT;
969  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
970  TEXTURE_SET_UNSIGNED_XY;
971 }
972 
973 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort4* retVal, hipTextureObject_t textureObject,
974  float x, float dx, float dy) {
975  TEXTURE_PARAMETERS_INIT;
976  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
977  TEXTURE_SET_UNSIGNED_XYZW;
978 }
979 
980 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int* retVal, hipTextureObject_t textureObject, float x,
981  float dx, float dy) {
982  TEXTURE_PARAMETERS_INIT;
983  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
984  TEXTURE_SET_SIGNED;
985 }
986 
987 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int1* retVal, hipTextureObject_t textureObject, float x,
988  float dx, float dy) {
989  TEXTURE_PARAMETERS_INIT;
990  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
991  TEXTURE_SET_SIGNED_X;
992 }
993 
994 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int2* retVal, hipTextureObject_t textureObject, float x,
995  float dx, float dy) {
996  TEXTURE_PARAMETERS_INIT;
997  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
998  TEXTURE_SET_SIGNED_XY;
999 }
1000 
1001 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int4* retVal, hipTextureObject_t textureObject, float x,
1002  float dx, float dy) {
1003  TEXTURE_PARAMETERS_INIT;
1004  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1005  TEXTURE_SET_SIGNED_XYZW;
1006 }
1007 
1008 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned int* retVal, hipTextureObject_t textureObject,
1009  float x, float dx, float dy) {
1010  TEXTURE_PARAMETERS_INIT;
1011  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1012  TEXTURE_SET_UNSIGNED;
1013 }
1014 
1015 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint1* retVal, hipTextureObject_t textureObject, float x,
1016  float dx, float dy) {
1017  TEXTURE_PARAMETERS_INIT;
1018  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1019  TEXTURE_SET_UNSIGNED_X;
1020 }
1021 
1022 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint2* retVal, hipTextureObject_t textureObject, float x,
1023  float dx, float dy) {
1024  TEXTURE_PARAMETERS_INIT;
1025  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1026  TEXTURE_SET_UNSIGNED_XY;
1027 }
1028 
1029 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint4* retVal, hipTextureObject_t textureObject, float x,
1030  float dx, float dy) {
1031  TEXTURE_PARAMETERS_INIT;
1032  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1033  TEXTURE_SET_UNSIGNED_XYZW;
1034 }
1035 
1036 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float* retVal, hipTextureObject_t textureObject, float x,
1037  float dx, float dy) {
1038  TEXTURE_PARAMETERS_INIT;
1039  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1040  TEXTURE_SET_FLOAT;
1041 }
1042 
1043 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float1* retVal, hipTextureObject_t textureObject, float x,
1044  float dx, float dy) {
1045  TEXTURE_PARAMETERS_INIT;
1046  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1047  TEXTURE_SET_FLOAT_X;
1048 }
1049 
1050 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float2* retVal, hipTextureObject_t textureObject, float x,
1051  float dx, float dy) {
1052  TEXTURE_PARAMETERS_INIT;
1053  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1054  TEXTURE_SET_FLOAT_XY;
1055 }
1056 
1057 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float4* retVal, hipTextureObject_t textureObject, float x,
1058  float dx, float dy) {
1059  TEXTURE_PARAMETERS_INIT;
1060  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1061  TEXTURE_SET_FLOAT_XYZW;
1062 }
1063 
1064 template <class T>
1065 __TEXTURE_FUNCTIONS_DECL__ T tex1DGrad(hipTextureObject_t textureObject, float x, float dx,
1066  float dy) {
1067  T ret;
1068  tex1DLod(&ret, textureObject, x, dx, dy);
1069  return ret;
1070 }
1071 
1073 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char* retVal, hipTextureObject_t textureObject, float x,
1074  float y) {
1075  TEXTURE_PARAMETERS_INIT;
1076  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1077  TEXTURE_SET_SIGNED;
1078 }
1079 
1080 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char1* retVal, hipTextureObject_t textureObject, float x,
1081  float y) {
1082  TEXTURE_PARAMETERS_INIT;
1083  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1084  TEXTURE_SET_SIGNED_X;
1085 }
1086 
1087 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char2* retVal, hipTextureObject_t textureObject, float x,
1088  float y) {
1089  TEXTURE_PARAMETERS_INIT;
1090  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1091  TEXTURE_SET_SIGNED_XY;
1092 }
1093 
1094 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char4* retVal, hipTextureObject_t textureObject, float x,
1095  float y) {
1096  TEXTURE_PARAMETERS_INIT;
1097  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1098  TEXTURE_SET_SIGNED_XYZW;
1099 }
1100 
1101 __TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned char* retVal, hipTextureObject_t textureObject,
1102  float x, float y) {
1103  TEXTURE_PARAMETERS_INIT;
1104  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1105  TEXTURE_SET_UNSIGNED;
1106 }
1107 
1108 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar1* retVal, hipTextureObject_t textureObject, float x,
1109  float y) {
1110  TEXTURE_PARAMETERS_INIT;
1111  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1112  TEXTURE_SET_UNSIGNED_X;
1113 }
1114 
1115 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar2* retVal, hipTextureObject_t textureObject, float x,
1116  float y) {
1117  TEXTURE_PARAMETERS_INIT;
1118  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1119  TEXTURE_SET_UNSIGNED_XY;
1120 }
1121 
1122 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar4* retVal, hipTextureObject_t textureObject, float x,
1123  float y) {
1124  TEXTURE_PARAMETERS_INIT;
1125  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1126  TEXTURE_SET_UNSIGNED_XYZW;
1127 }
1128 
1129 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short* retVal, hipTextureObject_t textureObject, float x,
1130  float y) {
1131  TEXTURE_PARAMETERS_INIT;
1132  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1133  TEXTURE_SET_SIGNED;
1134 }
1135 
1136 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short1* retVal, hipTextureObject_t textureObject, float x,
1137  float y) {
1138  TEXTURE_PARAMETERS_INIT;
1139  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1140  TEXTURE_SET_SIGNED_X;
1141 }
1142 
1143 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short2* retVal, hipTextureObject_t textureObject, float x,
1144  float y) {
1145  TEXTURE_PARAMETERS_INIT;
1146  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1147  TEXTURE_SET_SIGNED_XY;
1148 }
1149 
1150 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short4* retVal, hipTextureObject_t textureObject, float x,
1151  float y) {
1152  TEXTURE_PARAMETERS_INIT;
1153  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1154  TEXTURE_SET_SIGNED_XYZW;
1155 }
1156 
1157 __TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned short* retVal, hipTextureObject_t textureObject,
1158  float x, float y) {
1159  TEXTURE_PARAMETERS_INIT;
1160  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1161  TEXTURE_SET_UNSIGNED;
1162 }
1163 
1164 __TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort1* retVal, hipTextureObject_t textureObject, float x,
1165  float y) {
1166  TEXTURE_PARAMETERS_INIT;
1167  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1168  TEXTURE_SET_UNSIGNED_X;
1169 }
1170 
1171 __TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort2* retVal, hipTextureObject_t textureObject, float x,
1172  float y) {
1173  TEXTURE_PARAMETERS_INIT;
1174  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1175  TEXTURE_SET_UNSIGNED_XY;
1176 }
1177 
1178 __TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort4* retVal, hipTextureObject_t textureObject, float x,
1179  float y) {
1180  TEXTURE_PARAMETERS_INIT;
1181  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1182  TEXTURE_SET_UNSIGNED_XYZW;
1183 }
1184 
1185 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int* retVal, hipTextureObject_t textureObject, float x,
1186  float y) {
1187  TEXTURE_PARAMETERS_INIT;
1188  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1189  TEXTURE_SET_SIGNED;
1190 }
1191 
1192 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int1* retVal, hipTextureObject_t textureObject, float x,
1193  float y) {
1194  TEXTURE_PARAMETERS_INIT;
1195  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1196  TEXTURE_SET_SIGNED_X;
1197 }
1198 
1199 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int2* retVal, hipTextureObject_t textureObject, float x,
1200  float y) {
1201  TEXTURE_PARAMETERS_INIT;
1202  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1203  TEXTURE_SET_SIGNED_XY;
1204 }
1205 
1206 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int4* retVal, hipTextureObject_t textureObject, float x,
1207  float y) {
1208  TEXTURE_PARAMETERS_INIT;
1209  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1210  TEXTURE_SET_SIGNED_XYZW;
1211 }
1212 
1213 __TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned int* retVal, hipTextureObject_t textureObject,
1214  float x, float y) {
1215  TEXTURE_PARAMETERS_INIT;
1216  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1217  TEXTURE_SET_UNSIGNED;
1218 }
1219 
1220 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uint1* retVal, hipTextureObject_t textureObject, float x,
1221  float y) {
1222  TEXTURE_PARAMETERS_INIT;
1223  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1224  TEXTURE_SET_UNSIGNED_X;
1225 }
1226 
1227 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uint2* retVal, hipTextureObject_t textureObject, float x,
1228  float y) {
1229  TEXTURE_PARAMETERS_INIT;
1230  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1231  TEXTURE_SET_UNSIGNED_XY;
1232 }
1233 
1234 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uint4* retVal, hipTextureObject_t textureObject, float x,
1235  float y) {
1236  TEXTURE_PARAMETERS_INIT;
1237  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1238  TEXTURE_SET_UNSIGNED_XYZW;
1239 }
1240 
1241 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float* retVal, hipTextureObject_t textureObject, float x,
1242  float y) {
1243  TEXTURE_PARAMETERS_INIT;
1244  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1245  TEXTURE_SET_FLOAT;
1246 }
1247 
1248 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float1* retVal, hipTextureObject_t textureObject, float x,
1249  float y) {
1250  TEXTURE_PARAMETERS_INIT;
1251  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1252  TEXTURE_SET_FLOAT_X;
1253 }
1254 
1255 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float2* retVal, hipTextureObject_t textureObject, float x,
1256  float y) {
1257  TEXTURE_PARAMETERS_INIT;
1258  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1259  TEXTURE_SET_FLOAT_XY;
1260 }
1261 
1262 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float4* retVal, hipTextureObject_t textureObject, float x,
1263  float y) {
1264  TEXTURE_PARAMETERS_INIT;
1265  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1266  TEXTURE_SET_FLOAT_XYZW;
1267 }
1268 
1269 template <class T>
1270 __TEXTURE_FUNCTIONS_DECL__ T tex2D(hipTextureObject_t textureObject, float x, float y) {
1271  T ret;
1272  tex2D(&ret, textureObject, x, y);
1273  return ret;
1274 }
1275 
1277 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char* retVal, hipTextureObject_t textureObject, float x,
1278  float y, float level) {
1279  TEXTURE_PARAMETERS_INIT;
1280  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1281  TEXTURE_SET_SIGNED;
1282 }
1283 
1284 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char1* retVal, hipTextureObject_t textureObject, float x,
1285  float y, float level) {
1286  TEXTURE_PARAMETERS_INIT;
1287  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1288  TEXTURE_SET_SIGNED_X;
1289 }
1290 
1291 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char2* retVal, hipTextureObject_t textureObject, float x,
1292  float y, float level) {
1293  TEXTURE_PARAMETERS_INIT;
1294  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1295  TEXTURE_SET_SIGNED_XY;
1296 }
1297 
1298 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char4* retVal, hipTextureObject_t textureObject, float x,
1299  float y, float level) {
1300  TEXTURE_PARAMETERS_INIT;
1301  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1302  TEXTURE_SET_SIGNED_XYZW;
1303 }
1304 
1305 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned char* retVal, hipTextureObject_t textureObject,
1306  float x, float y, float level) {
1307  TEXTURE_PARAMETERS_INIT;
1308  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1309  TEXTURE_SET_UNSIGNED;
1310 }
1311 
1312 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar1* retVal, hipTextureObject_t textureObject, float x,
1313  float y, float level) {
1314  TEXTURE_PARAMETERS_INIT;
1315  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1316  TEXTURE_SET_UNSIGNED_X;
1317 }
1318 
1319 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar2* retVal, hipTextureObject_t textureObject, float x,
1320  float y, float level) {
1321  TEXTURE_PARAMETERS_INIT;
1322  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1323  TEXTURE_SET_UNSIGNED_XY;
1324 }
1325 
1326 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar4* retVal, hipTextureObject_t textureObject, float x,
1327  float y, float level) {
1328  TEXTURE_PARAMETERS_INIT;
1329  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1330  TEXTURE_SET_UNSIGNED_XYZW;
1331 }
1332 
1333 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short* retVal, hipTextureObject_t textureObject, float x,
1334  float y, float level) {
1335  TEXTURE_PARAMETERS_INIT;
1336  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1337  TEXTURE_SET_SIGNED;
1338 }
1339 
1340 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short1* retVal, hipTextureObject_t textureObject, float x,
1341  float y, float level) {
1342  TEXTURE_PARAMETERS_INIT;
1343  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1344  TEXTURE_SET_SIGNED_X;
1345 }
1346 
1347 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short2* retVal, hipTextureObject_t textureObject, float x,
1348  float y, float level) {
1349  TEXTURE_PARAMETERS_INIT;
1350  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1351  TEXTURE_SET_SIGNED_XY;
1352 }
1353 
1354 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short4* retVal, hipTextureObject_t textureObject, float x,
1355  float y, float level) {
1356  TEXTURE_PARAMETERS_INIT;
1357  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1358  TEXTURE_SET_SIGNED_XYZW;
1359 }
1360 
1361 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned short* retVal, hipTextureObject_t textureObject,
1362  float x, float y, float level) {
1363  TEXTURE_PARAMETERS_INIT;
1364  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1365  TEXTURE_SET_UNSIGNED;
1366 }
1367 
1368 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort1* retVal, hipTextureObject_t textureObject, float x,
1369  float y, float level) {
1370  TEXTURE_PARAMETERS_INIT;
1371  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1372  TEXTURE_SET_UNSIGNED_X;
1373 }
1374 
1375 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort2* retVal, hipTextureObject_t textureObject, float x,
1376  float y, float level) {
1377  TEXTURE_PARAMETERS_INIT;
1378  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1379  TEXTURE_SET_UNSIGNED_XY;
1380 }
1381 
1382 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort4* retVal, hipTextureObject_t textureObject, float x,
1383  float y, float level) {
1384  TEXTURE_PARAMETERS_INIT;
1385  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1386  TEXTURE_SET_UNSIGNED_XYZW;
1387 }
1388 
1389 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int* retVal, hipTextureObject_t textureObject, float x,
1390  float y, float level) {
1391  TEXTURE_PARAMETERS_INIT;
1392  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1393  TEXTURE_SET_SIGNED;
1394 }
1395 
1396 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int1* retVal, hipTextureObject_t textureObject, float x,
1397  float y, float level) {
1398  TEXTURE_PARAMETERS_INIT;
1399  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1400  TEXTURE_SET_SIGNED_X;
1401 }
1402 
1403 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int2* retVal, hipTextureObject_t textureObject, float x,
1404  float y, float level) {
1405  TEXTURE_PARAMETERS_INIT;
1406  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1407  TEXTURE_SET_SIGNED_XY;
1408 }
1409 
1410 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int4* retVal, hipTextureObject_t textureObject, float x,
1411  float y, float level) {
1412  TEXTURE_PARAMETERS_INIT;
1413  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1414  TEXTURE_SET_SIGNED_XYZW;
1415 }
1416 
1417 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned int* retVal, hipTextureObject_t textureObject,
1418  float x, float y, float level) {
1419  TEXTURE_PARAMETERS_INIT;
1420  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1421  TEXTURE_SET_UNSIGNED;
1422 }
1423 
1424 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint1* retVal, hipTextureObject_t textureObject, float x,
1425  float y, float level) {
1426  TEXTURE_PARAMETERS_INIT;
1427  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1428  TEXTURE_SET_UNSIGNED_X;
1429 }
1430 
1431 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint2* retVal, hipTextureObject_t textureObject, float x,
1432  float y, float level) {
1433  TEXTURE_PARAMETERS_INIT;
1434  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1435  TEXTURE_SET_UNSIGNED_XY;
1436 }
1437 
1438 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint4* retVal, hipTextureObject_t textureObject, float x,
1439  float y, float level) {
1440  TEXTURE_PARAMETERS_INIT;
1441  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1442  TEXTURE_SET_UNSIGNED_XYZW;
1443 }
1444 
1445 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float* retVal, hipTextureObject_t textureObject, float x,
1446  float y, float level) {
1447  TEXTURE_PARAMETERS_INIT;
1448  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1449  TEXTURE_SET_FLOAT;
1450 }
1451 
1452 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float1* retVal, hipTextureObject_t textureObject, float x,
1453  float y, float level) {
1454  TEXTURE_PARAMETERS_INIT;
1455  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1456  TEXTURE_SET_FLOAT_X;
1457 }
1458 
1459 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float2* retVal, hipTextureObject_t textureObject, float x,
1460  float y, float level) {
1461  TEXTURE_PARAMETERS_INIT;
1462  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1463  TEXTURE_SET_FLOAT_XY;
1464 }
1465 
1466 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float4* retVal, hipTextureObject_t textureObject, float x,
1467  float y, float level) {
1468  TEXTURE_PARAMETERS_INIT;
1469  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1470  TEXTURE_SET_FLOAT_XYZW;
1471 }
1472 
1473 template <class T>
1474 __TEXTURE_FUNCTIONS_DECL__ T tex2DLod(hipTextureObject_t textureObject, float x, float y,
1475  float level) {
1476  T ret;
1477  tex2DLod(&ret, textureObject, x, y, level);
1478  return ret;
1479 }
1480 
1482 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char* retVal, hipTextureObject_t textureObject, float x,
1483  float y, float z) {
1484  TEXTURE_PARAMETERS_INIT;
1485  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1486  TEXTURE_SET_SIGNED;
1487 }
1488 
1489 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char1* retVal, hipTextureObject_t textureObject, float x,
1490  float y, float z) {
1491  TEXTURE_PARAMETERS_INIT;
1492  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1493  TEXTURE_SET_SIGNED_X;
1494 }
1495 
1496 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char2* retVal, hipTextureObject_t textureObject, float x,
1497  float y, float z) {
1498  TEXTURE_PARAMETERS_INIT;
1499  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1500  TEXTURE_SET_SIGNED_XY;
1501 }
1502 
1503 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char4* retVal, hipTextureObject_t textureObject, float x,
1504  float y, float z) {
1505  TEXTURE_PARAMETERS_INIT;
1506  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1507  TEXTURE_SET_SIGNED_XYZW;
1508 }
1509 
1510 __TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned char* retVal, hipTextureObject_t textureObject,
1511  float x, float y, float z) {
1512  TEXTURE_PARAMETERS_INIT;
1513  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1514  TEXTURE_SET_UNSIGNED;
1515 }
1516 
1517 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar1* retVal, hipTextureObject_t textureObject, float x,
1518  float y, float z) {
1519  TEXTURE_PARAMETERS_INIT;
1520  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1521  TEXTURE_SET_UNSIGNED_X;
1522 }
1523 
1524 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar2* retVal, hipTextureObject_t textureObject, float x,
1525  float y, float z) {
1526  TEXTURE_PARAMETERS_INIT;
1527  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1528  TEXTURE_SET_UNSIGNED_XY;
1529 }
1530 
1531 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar4* retVal, hipTextureObject_t textureObject, float x,
1532  float y, float z) {
1533  TEXTURE_PARAMETERS_INIT;
1534  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1535  TEXTURE_SET_UNSIGNED_XYZW;
1536 }
1537 
1538 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short* retVal, hipTextureObject_t textureObject, float x,
1539  float y, float z) {
1540  TEXTURE_PARAMETERS_INIT;
1541  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1542  TEXTURE_SET_SIGNED;
1543 }
1544 
1545 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short1* retVal, hipTextureObject_t textureObject, float x,
1546  float y, float z) {
1547  TEXTURE_PARAMETERS_INIT;
1548  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1549  TEXTURE_SET_SIGNED_X;
1550 }
1551 
1552 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short2* retVal, hipTextureObject_t textureObject, float x,
1553  float y, float z) {
1554  TEXTURE_PARAMETERS_INIT;
1555  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1556  TEXTURE_SET_SIGNED_XY;
1557 }
1558 
1559 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short4* retVal, hipTextureObject_t textureObject, float x,
1560  float y, float z) {
1561  TEXTURE_PARAMETERS_INIT;
1562  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1563  TEXTURE_SET_SIGNED_XYZW;
1564 }
1565 
1566 __TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned short* retVal, hipTextureObject_t textureObject,
1567  float x, float y, float z) {
1568  TEXTURE_PARAMETERS_INIT;
1569  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1570  TEXTURE_SET_UNSIGNED;
1571 }
1572 
1573 __TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort1* retVal, hipTextureObject_t textureObject, float x,
1574  float y, float z) {
1575  TEXTURE_PARAMETERS_INIT;
1576  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1577  TEXTURE_SET_UNSIGNED_X;
1578 }
1579 
1580 __TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort2* retVal, hipTextureObject_t textureObject, float x,
1581  float y, float z) {
1582  TEXTURE_PARAMETERS_INIT;
1583  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1584  TEXTURE_SET_UNSIGNED_XY;
1585 }
1586 
1587 __TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort4* retVal, hipTextureObject_t textureObject, float x,
1588  float y, float z) {
1589  TEXTURE_PARAMETERS_INIT;
1590  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1591  TEXTURE_SET_UNSIGNED_XYZW;
1592 }
1593 
1594 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int* retVal, hipTextureObject_t textureObject, float x,
1595  float y, float z) {
1596  TEXTURE_PARAMETERS_INIT;
1597  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1598  TEXTURE_SET_SIGNED;
1599 }
1600 
1601 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int1* retVal, hipTextureObject_t textureObject, float x,
1602  float y, float z) {
1603  TEXTURE_PARAMETERS_INIT;
1604  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1605  TEXTURE_SET_SIGNED_X;
1606 }
1607 
1608 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int2* retVal, hipTextureObject_t textureObject, float x,
1609  float y, float z) {
1610  TEXTURE_PARAMETERS_INIT;
1611  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1612  TEXTURE_SET_SIGNED_XY;
1613 }
1614 
1615 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int4* retVal, hipTextureObject_t textureObject, float x,
1616  float y, float z) {
1617  TEXTURE_PARAMETERS_INIT;
1618  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1619  TEXTURE_SET_SIGNED_XYZW;
1620 }
1621 
1622 __TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned int* retVal, hipTextureObject_t textureObject,
1623  float x, float y, float z) {
1624  TEXTURE_PARAMETERS_INIT;
1625  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1626  TEXTURE_SET_UNSIGNED;
1627 }
1628 
1629 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uint1* retVal, hipTextureObject_t textureObject, float x,
1630  float y, float z) {
1631  TEXTURE_PARAMETERS_INIT;
1632  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1633  TEXTURE_SET_UNSIGNED_X;
1634 }
1635 
1636 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uint2* retVal, hipTextureObject_t textureObject, float x,
1637  float y, float z) {
1638  TEXTURE_PARAMETERS_INIT;
1639  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1640  TEXTURE_SET_UNSIGNED_XY;
1641 }
1642 
1643 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uint4* retVal, hipTextureObject_t textureObject, float x,
1644  float y, float z) {
1645  TEXTURE_PARAMETERS_INIT;
1646  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1647  TEXTURE_SET_UNSIGNED_XYZW;
1648 }
1649 
1650 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float* retVal, hipTextureObject_t textureObject, float x,
1651  float y, float z) {
1652  TEXTURE_PARAMETERS_INIT;
1653  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1654  TEXTURE_SET_FLOAT;
1655 }
1656 
1657 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float1* retVal, hipTextureObject_t textureObject, float x,
1658  float y, float z) {
1659  TEXTURE_PARAMETERS_INIT;
1660  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1661  TEXTURE_SET_FLOAT_X;
1662 }
1663 
1664 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float2* retVal, hipTextureObject_t textureObject, float x,
1665  float y, float z) {
1666  TEXTURE_PARAMETERS_INIT;
1667  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1668  TEXTURE_SET_FLOAT_XY;
1669 }
1670 
1671 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float4* retVal, hipTextureObject_t textureObject, float x,
1672  float y, float z) {
1673  TEXTURE_PARAMETERS_INIT;
1674  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1675  TEXTURE_SET_FLOAT_XYZW;
1676 }
1677 
1678 template <class T>
1679 __TEXTURE_FUNCTIONS_DECL__ T tex3D(hipTextureObject_t textureObject, float x, float y, float z) {
1680  T ret;
1681  tex3D(&ret, textureObject, x, y, z);
1682  return ret;
1683 }
1684 
1686 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char* retVal, hipTextureObject_t textureObject, float x,
1687  float y, float z, float level) {
1688  TEXTURE_PARAMETERS_INIT;
1689  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1690  level);
1691  TEXTURE_SET_SIGNED;
1692 }
1693 
1694 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char1* retVal, hipTextureObject_t textureObject, float x,
1695  float y, float z, float level) {
1696  TEXTURE_PARAMETERS_INIT;
1697  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1698  level);
1699  TEXTURE_SET_SIGNED_X;
1700 }
1701 
1702 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char2* retVal, hipTextureObject_t textureObject, float x,
1703  float y, float z, float level) {
1704  TEXTURE_PARAMETERS_INIT;
1705  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1706  level);
1707  TEXTURE_SET_SIGNED_XY;
1708 }
1709 
1710 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char4* retVal, hipTextureObject_t textureObject, float x,
1711  float y, float z, float level) {
1712  TEXTURE_PARAMETERS_INIT;
1713  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1714  level);
1715  TEXTURE_SET_SIGNED_XYZW;
1716 }
1717 
1718 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned char* retVal, hipTextureObject_t textureObject,
1719  float x, float y, float z, float level) {
1720  TEXTURE_PARAMETERS_INIT;
1721  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1722  level);
1723  TEXTURE_SET_UNSIGNED;
1724 }
1725 
1726 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar1* retVal, hipTextureObject_t textureObject, float x,
1727  float y, float z, float level) {
1728  TEXTURE_PARAMETERS_INIT;
1729  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1730  level);
1731  TEXTURE_SET_UNSIGNED_X;
1732 }
1733 
1734 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar2* retVal, hipTextureObject_t textureObject, float x,
1735  float y, float z, float level) {
1736  TEXTURE_PARAMETERS_INIT;
1737  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1738  level);
1739  TEXTURE_SET_UNSIGNED_XY;
1740 }
1741 
1742 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar4* retVal, hipTextureObject_t textureObject, float x,
1743  float y, float z, float level) {
1744  TEXTURE_PARAMETERS_INIT;
1745  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1746  level);
1747  TEXTURE_SET_UNSIGNED_XYZW;
1748 }
1749 
1750 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short* retVal, hipTextureObject_t textureObject, float x,
1751  float y, float z, float level) {
1752  TEXTURE_PARAMETERS_INIT;
1753  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1754  level);
1755  TEXTURE_SET_SIGNED;
1756 }
1757 
1758 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short1* retVal, hipTextureObject_t textureObject, float x,
1759  float y, float z, float level) {
1760  TEXTURE_PARAMETERS_INIT;
1761  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1762  level);
1763  TEXTURE_SET_SIGNED_X;
1764 }
1765 
1766 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short2* retVal, hipTextureObject_t textureObject, float x,
1767  float y, float z, float level) {
1768  TEXTURE_PARAMETERS_INIT;
1769  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1770  level);
1771  TEXTURE_SET_SIGNED_XY;
1772 }
1773 
1774 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short4* retVal, hipTextureObject_t textureObject, float x,
1775  float y, float z, float level) {
1776  TEXTURE_PARAMETERS_INIT;
1777  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1778  level);
1779  TEXTURE_SET_SIGNED_XYZW;
1780 }
1781 
1782 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned short* retVal, hipTextureObject_t textureObject,
1783  float x, float y, float z, float level) {
1784  TEXTURE_PARAMETERS_INIT;
1785  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1786  level);
1787  TEXTURE_SET_UNSIGNED;
1788 }
1789 
1790 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort1* retVal, hipTextureObject_t textureObject, float x,
1791  float y, float z, float level) {
1792  TEXTURE_PARAMETERS_INIT;
1793  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1794  level);
1795  TEXTURE_SET_UNSIGNED_X;
1796 }
1797 
1798 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort2* retVal, hipTextureObject_t textureObject, float x,
1799  float y, float z, float level) {
1800  TEXTURE_PARAMETERS_INIT;
1801  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1802  level);
1803  TEXTURE_SET_UNSIGNED_XY;
1804 }
1805 
1806 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort4* retVal, hipTextureObject_t textureObject, float x,
1807  float y, float z, float level) {
1808  TEXTURE_PARAMETERS_INIT;
1809  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1810  level);
1811  TEXTURE_SET_UNSIGNED_XYZW;
1812 }
1813 
1814 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int* retVal, hipTextureObject_t textureObject, float x,
1815  float y, float z, float level) {
1816  TEXTURE_PARAMETERS_INIT;
1817  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1818  level);
1819  TEXTURE_SET_SIGNED;
1820 }
1821 
1822 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int1* retVal, hipTextureObject_t textureObject, float x,
1823  float y, float z, float level) {
1824  TEXTURE_PARAMETERS_INIT;
1825  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1826  level);
1827  TEXTURE_SET_SIGNED_X;
1828 }
1829 
1830 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int2* retVal, hipTextureObject_t textureObject, float x,
1831  float y, float z, float level) {
1832  TEXTURE_PARAMETERS_INIT;
1833  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1834  level);
1835  TEXTURE_SET_SIGNED_XY;
1836 }
1837 
1838 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int4* retVal, hipTextureObject_t textureObject, float x,
1839  float y, float z, float level) {
1840  TEXTURE_PARAMETERS_INIT;
1841  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1842  level);
1843  TEXTURE_SET_SIGNED_XYZW;
1844 }
1845 
1846 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned int* retVal, hipTextureObject_t textureObject,
1847  float x, float y, float z, float level) {
1848  TEXTURE_PARAMETERS_INIT;
1849  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1850  level);
1851  TEXTURE_SET_UNSIGNED;
1852 }
1853 
1854 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint1* retVal, hipTextureObject_t textureObject, float x,
1855  float y, float z, float level) {
1856  TEXTURE_PARAMETERS_INIT;
1857  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1858  level);
1859  TEXTURE_SET_UNSIGNED_X;
1860 }
1861 
1862 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint2* retVal, hipTextureObject_t textureObject, float x,
1863  float y, float z, float level) {
1864  TEXTURE_PARAMETERS_INIT;
1865  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1866  level);
1867  TEXTURE_SET_UNSIGNED_XY;
1868 }
1869 
1870 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint4* retVal, hipTextureObject_t textureObject, float x,
1871  float y, float z, float level) {
1872  TEXTURE_PARAMETERS_INIT;
1873  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1874  level);
1875  TEXTURE_SET_UNSIGNED_XYZW;
1876 }
1877 
1878 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float* retVal, hipTextureObject_t textureObject, float x,
1879  float y, float z, float level) {
1880  TEXTURE_PARAMETERS_INIT;
1881  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1882  level);
1883  TEXTURE_SET_FLOAT;
1884 }
1885 
1886 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float1* retVal, hipTextureObject_t textureObject, float x,
1887  float y, float z, float level) {
1888  TEXTURE_PARAMETERS_INIT;
1889  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1890  level);
1891  TEXTURE_SET_FLOAT_X;
1892 }
1893 
1894 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float2* retVal, hipTextureObject_t textureObject, float x,
1895  float y, float z, float level) {
1896  TEXTURE_PARAMETERS_INIT;
1897  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1898  level);
1899  TEXTURE_SET_FLOAT_XY;
1900 }
1901 
1902 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float4* retVal, hipTextureObject_t textureObject, float x,
1903  float y, float z, float level) {
1904  TEXTURE_PARAMETERS_INIT;
1905  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1906  level);
1907  TEXTURE_SET_FLOAT_XYZW;
1908 }
1909 
1910 template <class T>
1911 __TEXTURE_FUNCTIONS_DECL__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, float z,
1912  float level) {
1913  T ret;
1914  tex3DLod(&ret, textureObject, x, y, z, level);
1915  return ret;
1916 }
1917 
1919 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char* retVal, hipTextureObject_t textureObject,
1920  float x, int layer) {
1921  TEXTURE_PARAMETERS_INIT;
1922  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1923  TEXTURE_SET_SIGNED;
1924 }
1925 
1926 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char1* retVal, hipTextureObject_t textureObject,
1927  float x, int layer) {
1928  TEXTURE_PARAMETERS_INIT;
1929  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1930  TEXTURE_SET_SIGNED_X;
1931 }
1932 
1933 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char2* retVal, hipTextureObject_t textureObject,
1934  float x, int layer) {
1935  TEXTURE_PARAMETERS_INIT;
1936  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1937  TEXTURE_SET_SIGNED_XY;
1938 }
1939 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char4* retVal, hipTextureObject_t textureObject,
1940  float x, int layer) {
1941  TEXTURE_PARAMETERS_INIT;
1942  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1943  TEXTURE_SET_SIGNED_XYZW;
1944 }
1945 
1946 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned char* retVal,
1947  hipTextureObject_t textureObject, float x, int layer) {
1948  TEXTURE_PARAMETERS_INIT;
1949  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1950  TEXTURE_SET_UNSIGNED;
1951 }
1952 
1953 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar1* retVal, hipTextureObject_t textureObject,
1954  float x, int layer) {
1955  TEXTURE_PARAMETERS_INIT;
1956  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1957  TEXTURE_SET_UNSIGNED_X;
1958 }
1959 
1960 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar2* retVal, hipTextureObject_t textureObject,
1961  float x, int layer) {
1962  TEXTURE_PARAMETERS_INIT;
1963  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1964  TEXTURE_SET_UNSIGNED_XY;
1965 }
1966 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar4* retVal, hipTextureObject_t textureObject,
1967  float x, int layer) {
1968  TEXTURE_PARAMETERS_INIT;
1969  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1970  TEXTURE_SET_UNSIGNED_XYZW;
1971 }
1972 
1973 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short* retVal, hipTextureObject_t textureObject,
1974  float x, int layer) {
1975  TEXTURE_PARAMETERS_INIT;
1976  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1977  TEXTURE_SET_SIGNED;
1978 }
1979 
1980 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short1* retVal, hipTextureObject_t textureObject,
1981  float x, int layer) {
1982  TEXTURE_PARAMETERS_INIT;
1983  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1984  TEXTURE_SET_SIGNED_X;
1985 }
1986 
1987 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short2* retVal, hipTextureObject_t textureObject,
1988  float x, int layer) {
1989  TEXTURE_PARAMETERS_INIT;
1990  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1991  TEXTURE_SET_SIGNED_XY;
1992 }
1993 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short4* retVal, hipTextureObject_t textureObject,
1994  float x, int layer) {
1995  TEXTURE_PARAMETERS_INIT;
1996  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1997  TEXTURE_SET_SIGNED_XYZW;
1998 }
1999 
2000 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned short* retVal,
2001  hipTextureObject_t textureObject, float x, int layer) {
2002  TEXTURE_PARAMETERS_INIT;
2003  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2004  TEXTURE_SET_UNSIGNED;
2005 }
2006 
2007 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort1* retVal, hipTextureObject_t textureObject,
2008  float x, int layer) {
2009  TEXTURE_PARAMETERS_INIT;
2010  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2011  TEXTURE_SET_UNSIGNED_X;
2012 }
2013 
2014 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort2* retVal, hipTextureObject_t textureObject,
2015  float x, int layer) {
2016  TEXTURE_PARAMETERS_INIT;
2017  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2018  TEXTURE_SET_UNSIGNED_XY;
2019 }
2020 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort4* retVal, hipTextureObject_t textureObject,
2021  float x, int layer) {
2022  TEXTURE_PARAMETERS_INIT;
2023  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2024  TEXTURE_SET_UNSIGNED_XYZW;
2025 }
2026 
2027 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int* retVal, hipTextureObject_t textureObject, float x,
2028  int layer) {
2029  TEXTURE_PARAMETERS_INIT;
2030  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2031  TEXTURE_SET_SIGNED;
2032 }
2033 
2034 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int1* retVal, hipTextureObject_t textureObject,
2035  float x, int layer) {
2036  TEXTURE_PARAMETERS_INIT;
2037  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2038  TEXTURE_SET_SIGNED_X;
2039 }
2040 
2041 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int2* retVal, hipTextureObject_t textureObject,
2042  float x, int layer) {
2043  TEXTURE_PARAMETERS_INIT;
2044  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2045  TEXTURE_SET_SIGNED_XY;
2046 }
2047 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int4* retVal, hipTextureObject_t textureObject,
2048  float x, int layer) {
2049  TEXTURE_PARAMETERS_INIT;
2050  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2051  TEXTURE_SET_SIGNED_XYZW;
2052 }
2053 
2054 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned int* retVal, hipTextureObject_t textureObject,
2055  float x, int layer) {
2056  TEXTURE_PARAMETERS_INIT;
2057  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2058  TEXTURE_SET_UNSIGNED;
2059 }
2060 
2061 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint1* retVal, hipTextureObject_t textureObject,
2062  float x, int layer) {
2063  TEXTURE_PARAMETERS_INIT;
2064  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2065  TEXTURE_SET_UNSIGNED_X;
2066 }
2067 
2068 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint2* retVal, hipTextureObject_t textureObject,
2069  float x, int layer) {
2070  TEXTURE_PARAMETERS_INIT;
2071  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2072  TEXTURE_SET_UNSIGNED_XY;
2073 }
2074 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint4* retVal, hipTextureObject_t textureObject,
2075  float x, int layer) {
2076  TEXTURE_PARAMETERS_INIT;
2077  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2078  TEXTURE_SET_UNSIGNED_XYZW;
2079 }
2080 
2081 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float* retVal, hipTextureObject_t textureObject,
2082  float x, int layer) {
2083  TEXTURE_PARAMETERS_INIT;
2084  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2085  TEXTURE_SET_FLOAT;
2086 }
2087 
2088 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float1* retVal, hipTextureObject_t textureObject,
2089  float x, int layer) {
2090  TEXTURE_PARAMETERS_INIT;
2091  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2092  TEXTURE_SET_FLOAT_X;
2093 }
2094 
2095 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float2* retVal, hipTextureObject_t textureObject,
2096  float x, int layer) {
2097  TEXTURE_PARAMETERS_INIT;
2098  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2099  TEXTURE_SET_FLOAT_XY;
2100 }
2101 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float4* retVal, hipTextureObject_t textureObject,
2102  float x, int layer) {
2103  TEXTURE_PARAMETERS_INIT;
2104  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2105  TEXTURE_SET_FLOAT_XYZW;
2106 }
2107 
2108 template <class T>
2109 __TEXTURE_FUNCTIONS_DECL__ T tex1DLayered(hipTextureObject_t textureObject, float x, int layer) {
2110  T ret;
2111  tex1DLayered(&ret, textureObject, x, layer);
2112  return ret;
2113 }
2114 
2116 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char* retVal, hipTextureObject_t textureObject,
2117  float x, int layer, float level) {
2118  TEXTURE_PARAMETERS_INIT;
2119  texel.f =
2120  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2121  TEXTURE_SET_SIGNED;
2122 }
2123 
2124 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char1* retVal, hipTextureObject_t textureObject,
2125  float x, int layer, float level) {
2126  TEXTURE_PARAMETERS_INIT;
2127  texel.f =
2128  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2129  TEXTURE_SET_SIGNED_X;
2130 }
2131 
2132 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char2* retVal, hipTextureObject_t textureObject,
2133  float x, int layer, float level) {
2134  TEXTURE_PARAMETERS_INIT;
2135  texel.f =
2136  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2137  TEXTURE_SET_SIGNED_XY;
2138 }
2139 
2140 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char4* retVal, hipTextureObject_t textureObject,
2141  float x, int layer, float level) {
2142  TEXTURE_PARAMETERS_INIT;
2143  texel.f =
2144  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2145  TEXTURE_SET_SIGNED_XYZW;
2146 }
2147 
2148 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned char* retVal,
2149  hipTextureObject_t textureObject, float x,
2150  int layer, float level) {
2151  TEXTURE_PARAMETERS_INIT;
2152  texel.f =
2153  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2154  TEXTURE_SET_UNSIGNED;
2155 }
2156 
2157 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject,
2158  float x, int layer, float level) {
2159  TEXTURE_PARAMETERS_INIT;
2160  texel.f =
2161  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2162  TEXTURE_SET_UNSIGNED_X;
2163 }
2164 
2165 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject,
2166  float x, int layer, float level) {
2167  TEXTURE_PARAMETERS_INIT;
2168  texel.f =
2169  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2170  TEXTURE_SET_UNSIGNED_XY;
2171 }
2172 
2173 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject,
2174  float x, int layer, float level) {
2175  TEXTURE_PARAMETERS_INIT;
2176  texel.f =
2177  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2178  TEXTURE_SET_UNSIGNED_XYZW;
2179 }
2180 
2181 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short* retVal, hipTextureObject_t textureObject,
2182  float x, int layer, float level) {
2183  TEXTURE_PARAMETERS_INIT;
2184  texel.f =
2185  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2186  TEXTURE_SET_SIGNED;
2187 }
2188 
2189 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short1* retVal, hipTextureObject_t textureObject,
2190  float x, int layer, float level) {
2191  TEXTURE_PARAMETERS_INIT;
2192  texel.f =
2193  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2194  TEXTURE_SET_SIGNED_X;
2195 }
2196 
2197 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short2* retVal, hipTextureObject_t textureObject,
2198  float x, int layer, float level) {
2199  TEXTURE_PARAMETERS_INIT;
2200  texel.f =
2201  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2202  TEXTURE_SET_SIGNED_XY;
2203 }
2204 
2205 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short4* retVal, hipTextureObject_t textureObject,
2206  float x, int layer, float level) {
2207  TEXTURE_PARAMETERS_INIT;
2208  texel.f =
2209  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2210  TEXTURE_SET_SIGNED_XYZW;
2211 }
2212 
2213 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned short* retVal,
2214  hipTextureObject_t textureObject, float x,
2215  int layer, float level) {
2216  TEXTURE_PARAMETERS_INIT;
2217  texel.f =
2218  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2219  TEXTURE_SET_UNSIGNED;
2220 }
2221 
2222 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject,
2223  float x, int layer, float level) {
2224  TEXTURE_PARAMETERS_INIT;
2225  texel.f =
2226  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2227  TEXTURE_SET_UNSIGNED_X;
2228 }
2229 
2230 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject,
2231  float x, int layer, float level) {
2232  TEXTURE_PARAMETERS_INIT;
2233  texel.f =
2234  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2235  TEXTURE_SET_UNSIGNED_XY;
2236 }
2237 
2238 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject,
2239  float x, int layer, float level) {
2240  TEXTURE_PARAMETERS_INIT;
2241  texel.f =
2242  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2243  TEXTURE_SET_UNSIGNED_XYZW;
2244 }
2245 
2246 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int* retVal, hipTextureObject_t textureObject,
2247  float x, int layer, float level) {
2248  TEXTURE_PARAMETERS_INIT;
2249  texel.f =
2250  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2251  TEXTURE_SET_SIGNED;
2252 }
2253 
2254 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int1* retVal, hipTextureObject_t textureObject,
2255  float x, int layer, float level) {
2256  TEXTURE_PARAMETERS_INIT;
2257  texel.f =
2258  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2259  TEXTURE_SET_SIGNED_X;
2260 }
2261 
2262 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int2* retVal, hipTextureObject_t textureObject,
2263  float x, int layer, float level) {
2264  TEXTURE_PARAMETERS_INIT;
2265  texel.f =
2266  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2267  TEXTURE_SET_SIGNED_XY;
2268 }
2269 
2270 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int4* retVal, hipTextureObject_t textureObject,
2271  float x, int layer, float level) {
2272  TEXTURE_PARAMETERS_INIT;
2273  texel.f =
2274  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2275  TEXTURE_SET_SIGNED_XYZW;
2276 }
2277 
2278 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned int* retVal,
2279  hipTextureObject_t textureObject, float x,
2280  int layer, float level) {
2281  TEXTURE_PARAMETERS_INIT;
2282  texel.f =
2283  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2284  TEXTURE_SET_UNSIGNED;
2285 }
2286 
2287 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint1* retVal, hipTextureObject_t textureObject,
2288  float x, int layer, float level) {
2289  TEXTURE_PARAMETERS_INIT;
2290  texel.f =
2291  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2292  TEXTURE_SET_UNSIGNED_X;
2293 }
2294 
2295 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint2* retVal, hipTextureObject_t textureObject,
2296  float x, int layer, float level) {
2297  TEXTURE_PARAMETERS_INIT;
2298  texel.f =
2299  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2300  TEXTURE_SET_UNSIGNED_XY;
2301 }
2302 
2303 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint4* retVal, hipTextureObject_t textureObject,
2304  float x, int layer, float level) {
2305  TEXTURE_PARAMETERS_INIT;
2306  texel.f =
2307  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2308  TEXTURE_SET_UNSIGNED_XYZW;
2309 }
2310 
2311 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float* retVal, hipTextureObject_t textureObject,
2312  float x, int layer, float level) {
2313  TEXTURE_PARAMETERS_INIT;
2314  texel.f =
2315  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2316  TEXTURE_SET_FLOAT;
2317 }
2318 
2319 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float1* retVal, hipTextureObject_t textureObject,
2320  float x, int layer, float level) {
2321  TEXTURE_PARAMETERS_INIT;
2322  texel.f =
2323  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2324  TEXTURE_SET_FLOAT_X;
2325 }
2326 
2327 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float2* retVal, hipTextureObject_t textureObject,
2328  float x, int layer, float level) {
2329  TEXTURE_PARAMETERS_INIT;
2330  texel.f =
2331  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2332  TEXTURE_SET_FLOAT_XY;
2333 }
2334 
2335 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float4* retVal, hipTextureObject_t textureObject,
2336  float x, int layer, float level) {
2337  TEXTURE_PARAMETERS_INIT;
2338  texel.f =
2339  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2340  TEXTURE_SET_FLOAT_XYZW;
2341 }
2342 
2343 template <class T>
2344 __TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, int layer,
2345  float level) {
2346  T ret;
2347  tex1DLayeredLod(&ret, textureObject, x, layer, level);
2348  return ret;
2349 }
2350 
2352 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char* retVal, hipTextureObject_t textureObject,
2353  float x, int layer, float dx, float dy) {
2354  TEXTURE_PARAMETERS_INIT;
2355  texel.f =
2356  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2357  TEXTURE_SET_SIGNED;
2358 }
2359 
2360 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char1* retVal, hipTextureObject_t textureObject,
2361  float x, int layer, float dx, float dy) {
2362  TEXTURE_PARAMETERS_INIT;
2363  texel.f =
2364  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2365  TEXTURE_SET_SIGNED_X;
2366 }
2367 
2368 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char2* retVal, hipTextureObject_t textureObject,
2369  float x, int layer, float dx, float dy) {
2370  TEXTURE_PARAMETERS_INIT;
2371  texel.f =
2372  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2373  TEXTURE_SET_SIGNED_XY;
2374 }
2375 
2376 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char4* retVal, hipTextureObject_t textureObject,
2377  float x, int layer, float dx, float dy) {
2378  TEXTURE_PARAMETERS_INIT;
2379  texel.f =
2380  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2381  TEXTURE_SET_SIGNED_XYZW;
2382 }
2383 
2384 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned char* retVal,
2385  hipTextureObject_t textureObject, float x,
2386  int layer, float dx, float dy) {
2387  TEXTURE_PARAMETERS_INIT;
2388  texel.f =
2389  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2390  TEXTURE_SET_UNSIGNED;
2391 }
2392 
2393 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar1* retVal, hipTextureObject_t textureObject,
2394  float x, int layer, float dx, float dy) {
2395  TEXTURE_PARAMETERS_INIT;
2396  texel.f =
2397  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2398  TEXTURE_SET_UNSIGNED_X;
2399 }
2400 
2401 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar2* retVal, hipTextureObject_t textureObject,
2402  float x, int layer, float dx, float dy) {
2403  TEXTURE_PARAMETERS_INIT;
2404  texel.f =
2405  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2406  TEXTURE_SET_UNSIGNED_XY;
2407 }
2408 
2409 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar4* retVal, hipTextureObject_t textureObject,
2410  float x, int layer, float dx, float dy) {
2411  TEXTURE_PARAMETERS_INIT;
2412  texel.f =
2413  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2414  TEXTURE_SET_UNSIGNED_XYZW;
2415 }
2416 
2417 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short* retVal, hipTextureObject_t textureObject,
2418  float x, int layer, float dx, float dy) {
2419  TEXTURE_PARAMETERS_INIT;
2420  texel.f =
2421  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2422  TEXTURE_SET_SIGNED;
2423 }
2424 
2425 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short1* retVal, hipTextureObject_t textureObject,
2426  float x, int layer, float dx, float dy) {
2427  TEXTURE_PARAMETERS_INIT;
2428  texel.f =
2429  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2430  TEXTURE_SET_SIGNED_X;
2431 }
2432 
2433 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short2* retVal, hipTextureObject_t textureObject,
2434  float x, int layer, float dx, float dy) {
2435  TEXTURE_PARAMETERS_INIT;
2436  texel.f =
2437  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2438  TEXTURE_SET_SIGNED_XY;
2439 }
2440 
2441 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short4* retVal, hipTextureObject_t textureObject,
2442  float x, int layer, float dx, float dy) {
2443  TEXTURE_PARAMETERS_INIT;
2444  texel.f =
2445  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2446  TEXTURE_SET_SIGNED_XYZW;
2447 }
2448 
2449 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned short* retVal,
2450  hipTextureObject_t textureObject, float x,
2451  int layer, float dx, float dy) {
2452  TEXTURE_PARAMETERS_INIT;
2453  texel.f =
2454  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2455  TEXTURE_SET_UNSIGNED;
2456 }
2457 
2458 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort1* retVal, hipTextureObject_t textureObject,
2459  float x, int layer, float dx, float dy) {
2460  TEXTURE_PARAMETERS_INIT;
2461  texel.f =
2462  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2463  TEXTURE_SET_UNSIGNED_X;
2464 }
2465 
2466 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort2* retVal, hipTextureObject_t textureObject,
2467  float x, int layer, float dx, float dy) {
2468  TEXTURE_PARAMETERS_INIT;
2469  texel.f =
2470  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2471  TEXTURE_SET_UNSIGNED_XY;
2472 }
2473 
2474 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort4* retVal, hipTextureObject_t textureObject,
2475  float x, int layer, float dx, float dy) {
2476  TEXTURE_PARAMETERS_INIT;
2477  texel.f =
2478  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2479  TEXTURE_SET_UNSIGNED_XYZW;
2480 }
2481 
2482 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int* retVal, hipTextureObject_t textureObject,
2483  float x, int layer, float dx, float dy) {
2484  TEXTURE_PARAMETERS_INIT;
2485  texel.f =
2486  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2487  TEXTURE_SET_SIGNED;
2488 }
2489 
2490 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int1* retVal, hipTextureObject_t textureObject,
2491  float x, int layer, float dx, float dy) {
2492  TEXTURE_PARAMETERS_INIT;
2493  texel.f =
2494  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2495  TEXTURE_SET_SIGNED_X;
2496 }
2497 
2498 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int2* retVal, hipTextureObject_t textureObject,
2499  float x, int layer, float dx, float dy) {
2500  TEXTURE_PARAMETERS_INIT;
2501  texel.f =
2502  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2503  TEXTURE_SET_SIGNED_XY;
2504 }
2505 
2506 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int4* retVal, hipTextureObject_t textureObject,
2507  float x, int layer, float dx, float dy) {
2508  TEXTURE_PARAMETERS_INIT;
2509  texel.f =
2510  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2511  TEXTURE_SET_SIGNED_XYZW;
2512 }
2513 
2514 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned int* retVal,
2515  hipTextureObject_t textureObject, float x,
2516  int layer, float dx, float dy) {
2517  TEXTURE_PARAMETERS_INIT;
2518  texel.f =
2519  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2520  TEXTURE_SET_UNSIGNED;
2521 }
2522 
2523 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint1* retVal, hipTextureObject_t textureObject,
2524  float x, int layer, float dx, float dy) {
2525  TEXTURE_PARAMETERS_INIT;
2526  texel.f =
2527  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2528  TEXTURE_SET_UNSIGNED_X;
2529 }
2530 
2531 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint2* retVal, hipTextureObject_t textureObject,
2532  float x, int layer, float dx, float dy) {
2533  TEXTURE_PARAMETERS_INIT;
2534  texel.f =
2535  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2536  TEXTURE_SET_UNSIGNED_XY;
2537 }
2538 
2539 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint4* retVal, hipTextureObject_t textureObject,
2540  float x, int layer, float dx, float dy) {
2541  TEXTURE_PARAMETERS_INIT;
2542  texel.f =
2543  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2544  TEXTURE_SET_UNSIGNED_XYZW;
2545 }
2546 
2547 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float* retVal, hipTextureObject_t textureObject,
2548  float x, int layer, float dx, float dy) {
2549  TEXTURE_PARAMETERS_INIT;
2550  texel.f =
2551  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2552  TEXTURE_SET_FLOAT;
2553 }
2554 
2555 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float1* retVal, hipTextureObject_t textureObject,
2556  float x, int layer, float dx, float dy) {
2557  TEXTURE_PARAMETERS_INIT;
2558  texel.f =
2559  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2560  TEXTURE_SET_FLOAT_X;
2561 }
2562 
2563 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float2* retVal, hipTextureObject_t textureObject,
2564  float x, int layer, float dx, float dy) {
2565  TEXTURE_PARAMETERS_INIT;
2566  texel.f =
2567  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2568  TEXTURE_SET_FLOAT_XY;
2569 }
2570 
2571 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float4* retVal, hipTextureObject_t textureObject,
2572  float x, int layer, float dx, float dy) {
2573  TEXTURE_PARAMETERS_INIT;
2574  texel.f =
2575  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2576  TEXTURE_SET_FLOAT_XYZW;
2577 }
2578 
2579 template <class T>
2580 __TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, int layer,
2581  float dx, float dy) {
2582  T ret;
2583  tex1DLayeredGrad(&ret, textureObject, x, layer, dx, dy);
2584  return ret;
2585 }
2586 
2588 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char* retVal, hipTextureObject_t textureObject,
2589  float x, float y, int layer) {
2590  TEXTURE_PARAMETERS_INIT;
2591  texel.f =
2592  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2593  TEXTURE_SET_SIGNED;
2594 }
2595 
2596 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char1* retVal, hipTextureObject_t textureObject,
2597  float x, float y, int layer) {
2598  TEXTURE_PARAMETERS_INIT;
2599  texel.f =
2600  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2601  TEXTURE_SET_SIGNED_X;
2602 }
2603 
2604 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char2* retVal, hipTextureObject_t textureObject,
2605  float x, float y, int layer) {
2606  TEXTURE_PARAMETERS_INIT;
2607  texel.f =
2608  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2609  TEXTURE_SET_SIGNED_XY;
2610 }
2611 
2612 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char4* retVal, hipTextureObject_t textureObject,
2613  float x, float y, int layer) {
2614  TEXTURE_PARAMETERS_INIT;
2615  texel.f =
2616  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2617  TEXTURE_SET_SIGNED_XYZW;
2618 }
2619 
2620 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned char* retVal,
2621  hipTextureObject_t textureObject, float x, float y,
2622  int layer) {
2623  TEXTURE_PARAMETERS_INIT;
2624  texel.f =
2625  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2626  TEXTURE_SET_UNSIGNED;
2627 }
2628 
2629 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar1* retVal, hipTextureObject_t textureObject,
2630  float x, float y, int layer) {
2631  TEXTURE_PARAMETERS_INIT;
2632  texel.f =
2633  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2634  TEXTURE_SET_UNSIGNED_X;
2635 }
2636 
2637 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar2* retVal, hipTextureObject_t textureObject,
2638  float x, float y, int layer) {
2639  TEXTURE_PARAMETERS_INIT;
2640  texel.f =
2641  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2642  TEXTURE_SET_UNSIGNED_XY;
2643 }
2644 
2645 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar4* retVal, hipTextureObject_t textureObject,
2646  float x, float y, int layer) {
2647  TEXTURE_PARAMETERS_INIT;
2648  texel.f =
2649  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2650  TEXTURE_SET_UNSIGNED_XYZW;
2651 }
2652 
2653 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short* retVal, hipTextureObject_t textureObject,
2654  float x, float y, int layer) {
2655  TEXTURE_PARAMETERS_INIT;
2656  texel.f =
2657  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2658  TEXTURE_SET_SIGNED;
2659 }
2660 
2661 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short1* retVal, hipTextureObject_t textureObject,
2662  float x, float y, int layer) {
2663  TEXTURE_PARAMETERS_INIT;
2664  texel.f =
2665  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2666  TEXTURE_SET_SIGNED_X;
2667 }
2668 
2669 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short2* retVal, hipTextureObject_t textureObject,
2670  float x, float y, int layer) {
2671  TEXTURE_PARAMETERS_INIT;
2672  texel.f =
2673  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2674  TEXTURE_SET_SIGNED_XY;
2675 }
2676 
2677 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short4* retVal, hipTextureObject_t textureObject,
2678  float x, float y, int layer) {
2679  TEXTURE_PARAMETERS_INIT;
2680  texel.f =
2681  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2682  TEXTURE_SET_SIGNED_XYZW;
2683 }
2684 
2685 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned short* retVal,
2686  hipTextureObject_t textureObject, float x, float y,
2687  int layer) {
2688  TEXTURE_PARAMETERS_INIT;
2689  texel.f =
2690  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2691  TEXTURE_SET_UNSIGNED;
2692 }
2693 
2694 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort1* retVal, hipTextureObject_t textureObject,
2695  float x, float y, int layer) {
2696  TEXTURE_PARAMETERS_INIT;
2697  texel.f =
2698  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2699  TEXTURE_SET_UNSIGNED_X;
2700 }
2701 
2702 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort2* retVal, hipTextureObject_t textureObject,
2703  float x, float y, int layer) {
2704  TEXTURE_PARAMETERS_INIT;
2705  texel.f =
2706  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2707  TEXTURE_SET_UNSIGNED_XY;
2708 }
2709 
2710 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort4* retVal, hipTextureObject_t textureObject,
2711  float x, float y, int layer) {
2712  TEXTURE_PARAMETERS_INIT;
2713  texel.f =
2714  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2715  TEXTURE_SET_UNSIGNED_XYZW;
2716 }
2717 
2718 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int* retVal, hipTextureObject_t textureObject, float x,
2719  float y, int layer) {
2720  TEXTURE_PARAMETERS_INIT;
2721  texel.f =
2722  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2723  TEXTURE_SET_SIGNED;
2724 }
2725 
2726 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int1* retVal, hipTextureObject_t textureObject,
2727  float x, float y, int layer) {
2728  TEXTURE_PARAMETERS_INIT;
2729  texel.f =
2730  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2731  TEXTURE_SET_SIGNED_X;
2732 }
2733 
2734 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int2* retVal, hipTextureObject_t textureObject,
2735  float x, float y, int layer) {
2736  TEXTURE_PARAMETERS_INIT;
2737  texel.f =
2738  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2739  TEXTURE_SET_SIGNED_XY;
2740 }
2741 
2742 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int4* retVal, hipTextureObject_t textureObject,
2743  float x, float y, int layer) {
2744  TEXTURE_PARAMETERS_INIT;
2745  texel.f =
2746  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2747  TEXTURE_SET_SIGNED_XYZW;
2748 }
2749 
2750 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned int* retVal, hipTextureObject_t textureObject,
2751  float x, float y, int layer) {
2752  TEXTURE_PARAMETERS_INIT;
2753  texel.f =
2754  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2755  TEXTURE_SET_UNSIGNED;
2756 }
2757 
2758 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint1* retVal, hipTextureObject_t textureObject,
2759  float x, float y, int layer) {
2760  TEXTURE_PARAMETERS_INIT;
2761  texel.f =
2762  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2763  TEXTURE_SET_UNSIGNED_X;
2764 }
2765 
2766 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint2* retVal, hipTextureObject_t textureObject,
2767  float x, float y, int layer) {
2768  TEXTURE_PARAMETERS_INIT;
2769  texel.f =
2770  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2771  TEXTURE_SET_UNSIGNED_XY;
2772 }
2773 
2774 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint4* retVal, hipTextureObject_t textureObject,
2775  float x, float y, int layer) {
2776  TEXTURE_PARAMETERS_INIT;
2777  texel.f =
2778  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2779  TEXTURE_SET_UNSIGNED_XYZW;
2780 }
2781 
2782 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float* retVal, hipTextureObject_t textureObject,
2783  float x, float y, int layer) {
2784  TEXTURE_PARAMETERS_INIT;
2785  texel.f =
2786  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2787  TEXTURE_SET_FLOAT;
2788 }
2789 
2790 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float1* retVal, hipTextureObject_t textureObject,
2791  float x, float y, int layer) {
2792  TEXTURE_PARAMETERS_INIT;
2793  texel.f =
2794  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2795  TEXTURE_SET_FLOAT_X;
2796 }
2797 
2798 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float2* retVal, hipTextureObject_t textureObject,
2799  float x, float y, int layer) {
2800  TEXTURE_PARAMETERS_INIT;
2801  texel.f =
2802  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2803  TEXTURE_SET_FLOAT_XY;
2804 }
2805 
2806 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float4* retVal, hipTextureObject_t textureObject,
2807  float x, float y, int layer) {
2808  TEXTURE_PARAMETERS_INIT;
2809  texel.f =
2810  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2811  TEXTURE_SET_FLOAT_XYZW;
2812 }
2813 
2814 template <class T>
2815 __TEXTURE_FUNCTIONS_DECL__ T tex2DLayered(hipTextureObject_t textureObject, float x, float y,
2816  int layer) {
2817  T ret;
2818  tex2DLayered(&ret, textureObject, x, y, layer);
2819  return ret;
2820 }
2821 
2823 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char* retVal, hipTextureObject_t textureObject,
2824  float x, float y, int layer, float level) {
2825  TEXTURE_PARAMETERS_INIT;
2826  texel.f = __ockl_image_sample_lod_2Da(
2827  i, s, float4(x, y, layer, 0.0f).data, level);
2828  TEXTURE_SET_SIGNED;
2829 }
2830 
2831 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char1* retVal, hipTextureObject_t textureObject,
2832  float x, float y, int layer, float level) {
2833  TEXTURE_PARAMETERS_INIT;
2834  texel.f = __ockl_image_sample_lod_2Da(
2835  i, s, float4(x, y, layer, 0.0f).data, level);
2836  TEXTURE_SET_SIGNED_X;
2837 }
2838 
2839 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char2* retVal, hipTextureObject_t textureObject,
2840  float x, float y, int layer, float level) {
2841  TEXTURE_PARAMETERS_INIT;
2842  texel.f = __ockl_image_sample_lod_2Da(
2843  i, s, float4(x, y, layer, 0.0f).data, level);
2844  TEXTURE_SET_SIGNED_XY;
2845 }
2846 
2847 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char4* retVal, hipTextureObject_t textureObject,
2848  float x, float y, int layer, float level) {
2849  TEXTURE_PARAMETERS_INIT;
2850  texel.f = __ockl_image_sample_lod_2Da(
2851  i, s, float4(x, y, layer, 0.0f).data, level);
2852  TEXTURE_SET_SIGNED_XYZW;
2853 }
2854 
2855 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned char* retVal,
2856  hipTextureObject_t textureObject, float x, float y,
2857  int layer, float level) {
2858  TEXTURE_PARAMETERS_INIT;
2859  texel.f = __ockl_image_sample_lod_2Da(
2860  i, s, float4(x, y, layer, 0.0f).data, level);
2861  TEXTURE_SET_UNSIGNED;
2862 }
2863 
2864 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject,
2865  float x, float y, int layer, float level) {
2866  TEXTURE_PARAMETERS_INIT;
2867  texel.f = __ockl_image_sample_lod_2Da(
2868  i, s, float4(x, y, layer, 0.0f).data, level);
2869  TEXTURE_SET_UNSIGNED_X;
2870 }
2871 
2872 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject,
2873  float x, float y, int layer, float level) {
2874  TEXTURE_PARAMETERS_INIT;
2875  texel.f = __ockl_image_sample_lod_2Da(
2876  i, s, float4(x, y, layer, 0.0f).data, level);
2877  TEXTURE_SET_UNSIGNED_XY;
2878 }
2879 
2880 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject,
2881  float x, float y, int layer, float level) {
2882  TEXTURE_PARAMETERS_INIT;
2883  texel.f = __ockl_image_sample_lod_2Da(
2884  i, s, float4(x, y, layer, 0.0f).data, level);
2885  TEXTURE_SET_UNSIGNED_XYZW;
2886 }
2887 
2888 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short* retVal, hipTextureObject_t textureObject,
2889  float x, float y, int layer, float level) {
2890  TEXTURE_PARAMETERS_INIT;
2891  texel.f = __ockl_image_sample_lod_2Da(
2892  i, s, float4(x, y, layer, 0.0f).data, level);
2893  TEXTURE_SET_SIGNED;
2894 }
2895 
2896 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short1* retVal, hipTextureObject_t textureObject,
2897  float x, float y, int layer, float level) {
2898  TEXTURE_PARAMETERS_INIT;
2899  texel.f = __ockl_image_sample_lod_2Da(
2900  i, s, float4(x, y, layer, 0.0f).data, level);
2901  TEXTURE_SET_SIGNED_X;
2902 }
2903 
2904 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short2* retVal, hipTextureObject_t textureObject,
2905  float x, float y, int layer, float level) {
2906  TEXTURE_PARAMETERS_INIT;
2907  texel.f = __ockl_image_sample_lod_2Da(
2908  i, s, float4(x, y, layer, 0.0f).data, level);
2909  TEXTURE_SET_SIGNED_XY;
2910 }
2911 
2912 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short4* retVal, hipTextureObject_t textureObject,
2913  float x, float y, int layer, float level) {
2914  TEXTURE_PARAMETERS_INIT;
2915  texel.f = __ockl_image_sample_lod_2Da(
2916  i, s, float4(x, y, layer, 0.0f).data, level);
2917  TEXTURE_SET_SIGNED_XYZW;
2918 }
2919 
2920 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned short* retVal,
2921  hipTextureObject_t textureObject, float x, float y,
2922  int layer, float level) {
2923  TEXTURE_PARAMETERS_INIT;
2924  texel.f = __ockl_image_sample_lod_2Da(
2925  i, s, float4(x, y, layer, 0.0f).data, level);
2926  TEXTURE_SET_UNSIGNED;
2927 }
2928 
2929 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject,
2930  float x, float y, int layer, float level) {
2931  TEXTURE_PARAMETERS_INIT;
2932  texel.f = __ockl_image_sample_lod_2Da(
2933  i, s, float4(x, y, layer, 0.0f).data, level);
2934  TEXTURE_SET_UNSIGNED_X;
2935 }
2936 
2937 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject,
2938  float x, float y, int layer, float level) {
2939  TEXTURE_PARAMETERS_INIT;
2940  texel.f = __ockl_image_sample_lod_2Da(
2941  i, s, float4(x, y, layer, 0.0f).data, level);
2942  TEXTURE_SET_UNSIGNED_XY;
2943 }
2944 
2945 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject,
2946  float x, float y, int layer, float level) {
2947  TEXTURE_PARAMETERS_INIT;
2948  texel.f = __ockl_image_sample_lod_2Da(
2949  i, s, float4(x, y, layer, 0.0f).data, level);
2950  TEXTURE_SET_UNSIGNED_XYZW;
2951 }
2952 
2953 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int* retVal, hipTextureObject_t textureObject,
2954  float x, float y, int layer, float level) {
2955  TEXTURE_PARAMETERS_INIT;
2956  texel.f = __ockl_image_sample_lod_2Da(
2957  i, s, float4(x, y, layer, 0.0f).data, level);
2958  TEXTURE_SET_SIGNED;
2959 }
2960 
2961 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int1* retVal, hipTextureObject_t textureObject,
2962  float x, float y, int layer, float level) {
2963  TEXTURE_PARAMETERS_INIT;
2964  texel.f = __ockl_image_sample_lod_2Da(
2965  i, s, float4(x, y, layer, 0.0f).data, level);
2966  TEXTURE_SET_SIGNED_X;
2967 }
2968 
2969 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int2* retVal, hipTextureObject_t textureObject,
2970  float x, float y, int layer, float level) {
2971  TEXTURE_PARAMETERS_INIT;
2972  texel.f = __ockl_image_sample_lod_2Da(
2973  i, s, float4(x, y, layer, 0.0f).data, level);
2974  TEXTURE_SET_SIGNED_XY;
2975 }
2976 
2977 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int4* retVal, hipTextureObject_t textureObject,
2978  float x, float y, int layer, float level) {
2979  TEXTURE_PARAMETERS_INIT;
2980  texel.f = __ockl_image_sample_lod_2Da(
2981  i, s, float4(x, y, layer, 0.0f).data, level);
2982  TEXTURE_SET_SIGNED_XYZW;
2983 }
2984 
2985 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned int* retVal,
2986  hipTextureObject_t textureObject, float x, float y,
2987  int layer, float level) {
2988  TEXTURE_PARAMETERS_INIT;
2989  texel.f = __ockl_image_sample_lod_2Da(
2990  i, s, float4(x, y, layer, 0.0f).data, level);
2991  TEXTURE_SET_UNSIGNED;
2992 }
2993 
2994 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint1* retVal, hipTextureObject_t textureObject,
2995  float x, float y, int layer, float level) {
2996  TEXTURE_PARAMETERS_INIT;
2997  texel.f = __ockl_image_sample_lod_2Da(
2998  i, s, float4(x, y, layer, 0.0f).data, level);
2999  TEXTURE_SET_UNSIGNED_X;
3000 }
3001 
3002 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint2* retVal, hipTextureObject_t textureObject,
3003  float x, float y, int layer, float level) {
3004  TEXTURE_PARAMETERS_INIT;
3005  texel.f = __ockl_image_sample_lod_2Da(
3006  i, s, float4(x, y, layer, 0.0f).data, level);
3007  TEXTURE_SET_UNSIGNED_XY;
3008 }
3009 
3010 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint4* retVal, hipTextureObject_t textureObject,
3011  float x, float y, int layer, float level) {
3012  TEXTURE_PARAMETERS_INIT;
3013  texel.f = __ockl_image_sample_lod_2Da(
3014  i, s, float4(x, y, layer, 0.0f).data, level);
3015  TEXTURE_SET_UNSIGNED_XYZW;
3016 }
3017 
3018 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float* retVal, hipTextureObject_t textureObject,
3019  float x, float y, int layer, float level) {
3020  TEXTURE_PARAMETERS_INIT;
3021  texel.f = __ockl_image_sample_lod_2Da(
3022  i, s, float4(x, y, layer, 0.0f).data, level);
3023  TEXTURE_SET_FLOAT;
3024 }
3025 
3026 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float1* retVal, hipTextureObject_t textureObject,
3027  float x, float y, int layer, float level) {
3028  TEXTURE_PARAMETERS_INIT;
3029  texel.f = __ockl_image_sample_lod_2Da(
3030  i, s, float4(x, y, layer, 0.0f).data, level);
3031  TEXTURE_SET_FLOAT_X;
3032 }
3033 
3034 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float2* retVal, hipTextureObject_t textureObject,
3035  float x, float y, int layer, float level) {
3036  TEXTURE_PARAMETERS_INIT;
3037  texel.f = __ockl_image_sample_lod_2Da(
3038  i, s, float4(x, y, layer, 0.0f).data, level);
3039  TEXTURE_SET_FLOAT_XY;
3040 }
3041 
3042 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float4* retVal, hipTextureObject_t textureObject,
3043  float x, float y, int layer, float level) {
3044  TEXTURE_PARAMETERS_INIT;
3045  texel.f = __ockl_image_sample_lod_2Da(
3046  i, s, float4(x, y, layer, 0.0f).data, level);
3047  TEXTURE_SET_FLOAT_XYZW;
3048 }
3049 
3050 template <class T>
3051 __TEXTURE_FUNCTIONS_DECL__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, float y,
3052  int layer, float level) {
3053  T ret;
3054  tex2DLayeredLod(&ret, textureObject, x, y, layer, level);
3055  return ret;
3056 }
3057 
3059 // Texture Reference APIs
3061 template <int texType, enum hipTextureReadMode mode>
3062 __TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture<char, texType, mode> texRef, int x) {
3063  TEXTURE_REF_PARAMETERS_INIT;
3064  texel.f = __ockl_image_sample_1D(i, s, x);
3065  TEXTURE_RETURN_CHAR;
3066 }
3067 
3068 template <int texType, enum hipTextureReadMode mode>
3069 __TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture<char1, texType, mode> texRef, int x) {
3070  TEXTURE_REF_PARAMETERS_INIT;
3071  texel.f = __ockl_image_sample_1D(i, s, x);
3072  TEXTURE_RETURN_CHAR_X;
3073 }
3074 
3075 template <int texType, enum hipTextureReadMode mode>
3076 __TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture<char2, texType, mode> texRef, int x) {
3077  TEXTURE_REF_PARAMETERS_INIT;
3078  texel.f = __ockl_image_sample_1D(i, s, x);
3079  TEXTURE_RETURN_CHAR_XY;
3080 }
3081 
3082 template <int texType, enum hipTextureReadMode mode>
3083 __TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture<char4, texType, mode> texRef, int x) {
3084  TEXTURE_REF_PARAMETERS_INIT;
3085  texel.f = __ockl_image_sample_1D(i, s, x);
3086  TEXTURE_RETURN_CHAR_XYZW;
3087 }
3088 
3089 template <int texType, enum hipTextureReadMode mode>
3090 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture<unsigned char, texType, mode> texRef,
3091  int x) {
3092  TEXTURE_REF_PARAMETERS_INIT;
3093  texel.f = __ockl_image_sample_1D(i, s, x);
3094  TEXTURE_RETURN_UCHAR;
3095 }
3096 
3097 template <int texType, enum hipTextureReadMode mode>
3098 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture<uchar1, texType, mode> texRef, int x) {
3099  TEXTURE_REF_PARAMETERS_INIT;
3100  texel.f = __ockl_image_sample_1D(i, s, x);
3101  TEXTURE_RETURN_UCHAR_X;
3102 }
3103 
3104 template <int texType, enum hipTextureReadMode mode>
3105 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture<uchar2, texType, mode> texRef, int x) {
3106  TEXTURE_REF_PARAMETERS_INIT;
3107  texel.f = __ockl_image_sample_1D(i, s, x);
3108  TEXTURE_RETURN_UCHAR_XY;
3109 }
3110 
3111 template <int texType, enum hipTextureReadMode mode>
3112 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture<uchar4, texType, mode> texRef, int x) {
3113  TEXTURE_REF_PARAMETERS_INIT;
3114  texel.f = __ockl_image_sample_1D(i, s, x);
3115  TEXTURE_RETURN_UCHAR_XYZW;
3116 }
3117 
3118 template <int texType, enum hipTextureReadMode mode>
3119 __TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture<short, texType, mode> texRef, int x) {
3120  TEXTURE_REF_PARAMETERS_INIT;
3121  texel.f = __ockl_image_sample_1D(i, s, x);
3122  TEXTURE_RETURN_SHORT;
3123 }
3124 
3125 template <int texType, enum hipTextureReadMode mode>
3126 __TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture<short1, texType, mode> texRef, int x) {
3127  TEXTURE_REF_PARAMETERS_INIT;
3128  texel.f = __ockl_image_sample_1D(i, s, x);
3129  TEXTURE_RETURN_SHORT_X;
3130 }
3131 
3132 template <int texType, enum hipTextureReadMode mode>
3133 __TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture<short2, texType, mode> texRef, int x) {
3134  TEXTURE_REF_PARAMETERS_INIT;
3135  texel.f = __ockl_image_sample_1D(i, s, x);
3136  TEXTURE_RETURN_SHORT_XY;
3137 }
3138 
3139 template <int texType, enum hipTextureReadMode mode>
3140 __TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture<short4, texType, mode> texRef, int x) {
3141  TEXTURE_REF_PARAMETERS_INIT;
3142  texel.f = __ockl_image_sample_1D(i, s, x);
3143  TEXTURE_RETURN_SHORT_XYZW;
3144 }
3145 
3146 template <int texType, enum hipTextureReadMode mode>
3147 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture<ushort1, texType, mode> texRef, int x) {
3148  TEXTURE_REF_PARAMETERS_INIT;
3149  texel.f = __ockl_image_sample_1D(i, s, x);
3150  TEXTURE_RETURN_USHORT_X;
3151 }
3152 
3153 template <int texType, enum hipTextureReadMode mode>
3154 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture<unsigned short, texType, mode> texRef,
3155  int x) {
3156  TEXTURE_REF_PARAMETERS_INIT;
3157  texel.f = __ockl_image_sample_1D(i, s, x);
3158  TEXTURE_RETURN_USHORT;
3159 }
3160 
3161 template <int texType, enum hipTextureReadMode mode>
3162 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture<ushort2, texType, mode> texRef, int x) {
3163  TEXTURE_REF_PARAMETERS_INIT;
3164  texel.f = __ockl_image_sample_1D(i, s, x);
3165  TEXTURE_RETURN_USHORT_XY;
3166 }
3167 
3168 template <int texType, enum hipTextureReadMode mode>
3169 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture<ushort4, texType, mode> texRef, int x) {
3170  TEXTURE_REF_PARAMETERS_INIT;
3171  texel.f = __ockl_image_sample_1D(i, s, x);
3172  TEXTURE_RETURN_USHORT_XYZW;
3173 }
3174 
3175 template <int texType, enum hipTextureReadMode mode>
3176 __TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture<int1, texType, mode> texRef, int x) {
3177  TEXTURE_REF_PARAMETERS_INIT;
3178  texel.f = __ockl_image_sample_1D(i, s, x);
3179  TEXTURE_RETURN_INT_X;
3180 }
3181 
3182 template <int texType, enum hipTextureReadMode mode>
3183 __TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture<int, texType, mode> texRef, int x) {
3184  TEXTURE_REF_PARAMETERS_INIT;
3185  texel.f = __ockl_image_sample_1D(i, s, x);
3186  TEXTURE_RETURN_INT;
3187 }
3188 
3189 template <int texType, enum hipTextureReadMode mode>
3190 __TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture<int2, texType, mode> texRef, int x) {
3191  TEXTURE_REF_PARAMETERS_INIT;
3192  texel.f = __ockl_image_sample_1D(i, s, x);
3193  TEXTURE_RETURN_INT_XY;
3194 }
3195 
3196 template <int texType, enum hipTextureReadMode mode>
3197 __TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture<int4, texType, mode> texRef, int x) {
3198  TEXTURE_REF_PARAMETERS_INIT;
3199  texel.f = __ockl_image_sample_1D(i, s, x);
3200  TEXTURE_RETURN_INT_XYZW;
3201 }
3202 
3203 template <int texType, enum hipTextureReadMode mode>
3204 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture<unsigned int, texType, mode> texRef,
3205  int x) {
3206  TEXTURE_REF_PARAMETERS_INIT;
3207  texel.f = __ockl_image_sample_1D(i, s, x);
3208  TEXTURE_RETURN_UINT;
3209 }
3210 
3211 template <int texType, enum hipTextureReadMode mode>
3212 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture<uint1, texType, mode> texRef, int x) {
3213  TEXTURE_REF_PARAMETERS_INIT;
3214  texel.f = __ockl_image_sample_1D(i, s, x);
3215  TEXTURE_RETURN_UINT_X;
3216 }
3217 
3218 template <int texType, enum hipTextureReadMode mode>
3219 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture<uint2, texType, mode> texRef, int x) {
3220  TEXTURE_REF_PARAMETERS_INIT;
3221  texel.f = __ockl_image_sample_1D(i, s, x);
3222  TEXTURE_RETURN_UINT_XY;
3223 }
3224 
3225 template <int texType, enum hipTextureReadMode mode>
3226 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture<uint4, texType, mode> texRef, int x) {
3227  TEXTURE_REF_PARAMETERS_INIT;
3228  texel.f = __ockl_image_sample_1D(i, s, x);
3229  TEXTURE_RETURN_UINT_XYZW;
3230 }
3231 
3232 template <int texType, enum hipTextureReadMode mode>
3233 __TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture<float, texType, mode> texRef, int x) {
3234  TEXTURE_REF_PARAMETERS_INIT;
3235  texel.f = __ockl_image_sample_1D(i, s, x);
3236  TEXTURE_RETURN_FLOAT;
3237 }
3238 
3239 template <int texType, enum hipTextureReadMode mode>
3240 __TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture<float1, texType, mode> texRef, int x) {
3241  TEXTURE_REF_PARAMETERS_INIT;
3242  texel.f = __ockl_image_sample_1D(i, s, x);
3243  TEXTURE_RETURN_FLOAT_X;
3244 }
3245 
3246 template <int texType, enum hipTextureReadMode mode>
3247 __TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture<float2, texType, mode> texRef, int x) {
3248  TEXTURE_REF_PARAMETERS_INIT;
3249  texel.f = __ockl_image_sample_1D(i, s, x);
3250  TEXTURE_RETURN_FLOAT_XY;
3251 }
3252 
3253 template <int texType, enum hipTextureReadMode mode>
3254 __TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture<float4, texType, mode> texRef, int x) {
3255  TEXTURE_REF_PARAMETERS_INIT;
3256  texel.f = __ockl_image_sample_1D(i, s, x);
3257  TEXTURE_RETURN_FLOAT_XYZW;
3258 }
3259 
3261 
3262 template <int texType, enum hipTextureReadMode mode>
3263 __TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture<char, texType, mode> texRef,
3264  hipTextureObject_t textureObject, int x) {
3265  TEXTURE_PARAMETERS_INIT;
3266  texel.f = __ockl_image_sample_1D(i, s, x);
3267  TEXTURE_RETURN_CHAR;
3268 }
3269 
3270 template <int texType, enum hipTextureReadMode mode>
3271 __TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture<char1, texType, mode> texRef,
3272  hipTextureObject_t textureObject, int x) {
3273  TEXTURE_PARAMETERS_INIT;
3274  texel.f = __ockl_image_sample_1D(i, s, x);
3275  TEXTURE_RETURN_CHAR_X;
3276 }
3277 
3278 template <int texType, enum hipTextureReadMode mode>
3279 __TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture<char2, texType, mode> texRef,
3280  hipTextureObject_t textureObject, int x) {
3281  TEXTURE_PARAMETERS_INIT;
3282  texel.f = __ockl_image_sample_1D(i, s, x);
3283  TEXTURE_RETURN_CHAR_XY;
3284 }
3285 
3286 template <int texType, enum hipTextureReadMode mode>
3287 __TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture<char4, texType, mode> texRef,
3288  hipTextureObject_t textureObject, int x) {
3289  TEXTURE_PARAMETERS_INIT;
3290  texel.f = __ockl_image_sample_1D(i, s, x);
3291  TEXTURE_RETURN_CHAR_XYZW;
3292 }
3293 
3294 template <int texType, enum hipTextureReadMode mode>
3295 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture<unsigned char, texType, mode> texRef,
3296  hipTextureObject_t textureObject, int x) {
3297  TEXTURE_PARAMETERS_INIT;
3298  texel.f = __ockl_image_sample_1D(i, s, x);
3299  TEXTURE_RETURN_UCHAR;
3300 }
3301 
3302 template <int texType, enum hipTextureReadMode mode>
3303 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture<uchar1, texType, mode> texRef,
3304  hipTextureObject_t textureObject, int x) {
3305  TEXTURE_PARAMETERS_INIT;
3306  texel.f = __ockl_image_sample_1D(i, s, x);
3307  TEXTURE_RETURN_UCHAR_X;
3308 }
3309 
3310 template <int texType, enum hipTextureReadMode mode>
3311 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture<uchar2, texType, mode> texRef,
3312  hipTextureObject_t textureObject, int x) {
3313  TEXTURE_PARAMETERS_INIT;
3314  texel.f = __ockl_image_sample_1D(i, s, x);
3315  TEXTURE_RETURN_UCHAR_XY;
3316 }
3317 
3318 template <int texType, enum hipTextureReadMode mode>
3319 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture<uchar4, texType, mode> texRef,
3320  hipTextureObject_t textureObject, int x) {
3321  TEXTURE_PARAMETERS_INIT;
3322  texel.f = __ockl_image_sample_1D(i, s, x);
3323  TEXTURE_RETURN_UCHAR_XYZW;
3324 }
3325 
3326 template <int texType, enum hipTextureReadMode mode>
3327 __TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture<short, texType, mode> texRef,
3328  hipTextureObject_t textureObject, int x) {
3329  TEXTURE_PARAMETERS_INIT;
3330  texel.f = __ockl_image_sample_1D(i, s, x);
3331  TEXTURE_RETURN_SHORT;
3332 }
3333 
3334 template <int texType, enum hipTextureReadMode mode>
3335 __TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture<short1, texType, mode> texRef,
3336  hipTextureObject_t textureObject, int x) {
3337  TEXTURE_PARAMETERS_INIT;
3338  texel.f = __ockl_image_sample_1D(i, s, x);
3339  TEXTURE_RETURN_SHORT_X;
3340 }
3341 
3342 template <int texType, enum hipTextureReadMode mode>
3343 __TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture<short2, texType, mode> texRef,
3344  hipTextureObject_t textureObject, int x) {
3345  TEXTURE_PARAMETERS_INIT;
3346  texel.f = __ockl_image_sample_1D(i, s, x);
3347  TEXTURE_RETURN_SHORT_XY;
3348 }
3349 
3350 template <int texType, enum hipTextureReadMode mode>
3351 __TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture<short4, texType, mode> texRef,
3352  hipTextureObject_t textureObject, int x) {
3353  TEXTURE_PARAMETERS_INIT;
3354  texel.f = __ockl_image_sample_1D(i, s, x);
3355  TEXTURE_RETURN_SHORT_XYZW;
3356 }
3357 
3358 template <int texType, enum hipTextureReadMode mode>
3359 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture<ushort1, texType, mode> texRef,
3360  hipTextureObject_t textureObject, int x) {
3361  TEXTURE_PARAMETERS_INIT;
3362  texel.f = __ockl_image_sample_1D(i, s, x);
3363  TEXTURE_RETURN_USHORT_X;
3364 }
3365 
3366 template <int texType, enum hipTextureReadMode mode>
3367 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture<unsigned short, texType, mode> texRef,
3368  hipTextureObject_t textureObject, int x) {
3369  TEXTURE_PARAMETERS_INIT;
3370  texel.f = __ockl_image_sample_1D(i, s, x);
3371  TEXTURE_RETURN_USHORT;
3372 }
3373 
3374 template <int texType, enum hipTextureReadMode mode>
3375 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture<ushort2, texType, mode> texRef,
3376  hipTextureObject_t textureObject, int x) {
3377  TEXTURE_PARAMETERS_INIT;
3378  texel.f = __ockl_image_sample_1D(i, s, x);
3379  TEXTURE_RETURN_USHORT_XY;
3380 }
3381 
3382 template <int texType, enum hipTextureReadMode mode>
3383 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture<ushort4, texType, mode> texRef,
3384  hipTextureObject_t textureObject, int x) {
3385  TEXTURE_PARAMETERS_INIT;
3386  texel.f = __ockl_image_sample_1D(i, s, x);
3387  TEXTURE_RETURN_USHORT_XYZW;
3388 }
3389 
3390 template <int texType, enum hipTextureReadMode mode>
3391 __TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture<int1, texType, mode> texRef,
3392  hipTextureObject_t textureObject, int x) {
3393  TEXTURE_PARAMETERS_INIT;
3394  texel.f = __ockl_image_sample_1D(i, s, x);
3395  TEXTURE_RETURN_INT_X;
3396 }
3397 
3398 template <int texType, enum hipTextureReadMode mode>
3399 __TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture<int, texType, mode> texRef,
3400  hipTextureObject_t textureObject, int x) {
3401  TEXTURE_PARAMETERS_INIT;
3402  texel.f = __ockl_image_sample_1D(i, s, x);
3403  TEXTURE_RETURN_INT;
3404 }
3405 
3406 template <int texType, enum hipTextureReadMode mode>
3407 __TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture<int2, texType, mode> texRef,
3408  hipTextureObject_t textureObject, int x) {
3409  TEXTURE_PARAMETERS_INIT;
3410  texel.f = __ockl_image_sample_1D(i, s, x);
3411  TEXTURE_RETURN_INT_XY;
3412 }
3413 
3414 template <int texType, enum hipTextureReadMode mode>
3415 __TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture<int4, texType, mode> texRef,
3416  hipTextureObject_t textureObject, int x) {
3417  TEXTURE_PARAMETERS_INIT;
3418  texel.f = __ockl_image_sample_1D(i, s, x);
3419  TEXTURE_RETURN_INT_XYZW;
3420 }
3421 
3422 template <int texType, enum hipTextureReadMode mode>
3423 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture<unsigned int, texType, mode> texRef,
3424  hipTextureObject_t textureObject, int x) {
3425  TEXTURE_PARAMETERS_INIT;
3426  texel.f = __ockl_image_sample_1D(i, s, x);
3427  TEXTURE_RETURN_UINT;
3428 }
3429 
3430 template <int texType, enum hipTextureReadMode mode>
3431 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture<uint1, texType, mode> texRef,
3432  hipTextureObject_t textureObject, int x) {
3433  TEXTURE_PARAMETERS_INIT;
3434  texel.f = __ockl_image_sample_1D(i, s, x);
3435  TEXTURE_RETURN_UINT_X;
3436 }
3437 
3438 template <int texType, enum hipTextureReadMode mode>
3439 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture<uint2, texType, mode> texRef,
3440  hipTextureObject_t textureObject, int x) {
3441  TEXTURE_PARAMETERS_INIT;
3442  texel.f = __ockl_image_sample_1D(i, s, x);
3443  TEXTURE_RETURN_UINT_XY;
3444 }
3445 
3446 template <int texType, enum hipTextureReadMode mode>
3447 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture<uint4, texType, mode> texRef,
3448  hipTextureObject_t textureObject, int x) {
3449  TEXTURE_PARAMETERS_INIT;
3450  texel.f = __ockl_image_sample_1D(i, s, x);
3451  TEXTURE_RETURN_UINT_XYZW;
3452 }
3453 
3454 template <int texType, enum hipTextureReadMode mode>
3455 __TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture<float, texType, mode> texRef,
3456  hipTextureObject_t textureObject, int x) {
3457  TEXTURE_PARAMETERS_INIT;
3458  texel.f = __ockl_image_sample_1D(i, s, x);
3459  TEXTURE_RETURN_FLOAT;
3460 }
3461 
3462 template <int texType, enum hipTextureReadMode mode>
3463 __TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture<float1, texType, mode> texRef,
3464  hipTextureObject_t textureObject, int x) {
3465  TEXTURE_PARAMETERS_INIT;
3466  texel.f = __ockl_image_sample_1D(i, s, x);
3467  TEXTURE_RETURN_FLOAT_X;
3468 }
3469 
3470 template <int texType, enum hipTextureReadMode mode>
3471 __TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture<float2, texType, mode> texRef,
3472  hipTextureObject_t textureObject, int x) {
3473  TEXTURE_PARAMETERS_INIT;
3474  texel.f = __ockl_image_sample_1D(i, s, x);
3475  TEXTURE_RETURN_FLOAT_XY;
3476 }
3477 
3478 template <int texType, enum hipTextureReadMode mode>
3479 __TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture<float4, texType, mode> texRef,
3480  hipTextureObject_t textureObject, int x) {
3481  TEXTURE_PARAMETERS_INIT;
3482  texel.f = __ockl_image_sample_1D(i, s, x);
3483  TEXTURE_RETURN_FLOAT_XYZW;
3484 }
3485 
3487 template <int texType, enum hipTextureReadMode mode>
3488 __TEXTURE_FUNCTIONS_DECL__ char tex1D(texture<char, texType, mode> texRef, float x) {
3489  TEXTURE_REF_PARAMETERS_INIT;
3490  texel.f = __ockl_image_sample_1D(i, s, x);
3491  TEXTURE_RETURN_CHAR;
3492 }
3493 
3494 template <int texType, enum hipTextureReadMode mode>
3495 __TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture<char1, texType, mode> texRef, float x) {
3496  TEXTURE_REF_PARAMETERS_INIT;
3497  texel.f = __ockl_image_sample_1D(i, s, x);
3498  TEXTURE_RETURN_CHAR_X;
3499 }
3500 
3501 template <int texType, enum hipTextureReadMode mode>
3502 __TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture<char2, texType, mode> texRef, float x) {
3503  TEXTURE_REF_PARAMETERS_INIT;
3504  texel.f = __ockl_image_sample_1D(i, s, x);
3505  TEXTURE_RETURN_CHAR_XY;
3506 }
3507 
3508 template <int texType, enum hipTextureReadMode mode>
3509 __TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture<char4, texType, mode> texRef, float x) {
3510  TEXTURE_REF_PARAMETERS_INIT;
3511  texel.f = __ockl_image_sample_1D(i, s, x);
3512  TEXTURE_RETURN_CHAR_XYZW;
3513 }
3514 
3515 template <int texType, enum hipTextureReadMode mode>
3516 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture<unsigned char, texType, mode> texRef,
3517  float x) {
3518  TEXTURE_REF_PARAMETERS_INIT;
3519  texel.f = __ockl_image_sample_1D(i, s, x);
3520  TEXTURE_RETURN_UCHAR;
3521 }
3522 
3523 template <int texType, enum hipTextureReadMode mode>
3524 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture<uchar1, texType, mode> texRef, float x) {
3525  TEXTURE_REF_PARAMETERS_INIT;
3526  texel.f = __ockl_image_sample_1D(i, s, x);
3527  TEXTURE_RETURN_UCHAR_X;
3528 }
3529 
3530 template <int texType, enum hipTextureReadMode mode>
3531 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture<uchar2, texType, mode> texRef, float x) {
3532  TEXTURE_REF_PARAMETERS_INIT;
3533  texel.f = __ockl_image_sample_1D(i, s, x);
3534  TEXTURE_RETURN_UCHAR_XY;
3535 }
3536 
3537 template <int texType, enum hipTextureReadMode mode>
3538 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture<uchar4, texType, mode> texRef, float x) {
3539  TEXTURE_REF_PARAMETERS_INIT;
3540  texel.f = __ockl_image_sample_1D(i, s, x);
3541  TEXTURE_RETURN_UCHAR_XYZW;
3542 }
3543 
3544 template <int texType, enum hipTextureReadMode mode>
3545 __TEXTURE_FUNCTIONS_DECL__ short tex1D(texture<short, texType, mode> texRef, float x) {
3546  TEXTURE_REF_PARAMETERS_INIT;
3547  texel.f = __ockl_image_sample_1D(i, s, x);
3548  TEXTURE_RETURN_SHORT;
3549 }
3550 
3551 template <int texType, enum hipTextureReadMode mode>
3552 __TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture<short1, texType, mode> texRef, float x) {
3553  TEXTURE_REF_PARAMETERS_INIT;
3554  texel.f = __ockl_image_sample_1D(i, s, x);
3555  TEXTURE_RETURN_SHORT_X;
3556 }
3557 
3558 template <int texType, enum hipTextureReadMode mode>
3559 __TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture<short2, texType, mode> texRef, float x) {
3560  TEXTURE_REF_PARAMETERS_INIT;
3561  texel.f = __ockl_image_sample_1D(i, s, x);
3562  TEXTURE_RETURN_SHORT_XY;
3563 }
3564 
3565 template <int texType, enum hipTextureReadMode mode>
3566 __TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture<short4, texType, mode> texRef, float x) {
3567  TEXTURE_REF_PARAMETERS_INIT;
3568  texel.f = __ockl_image_sample_1D(i, s, x);
3569  TEXTURE_RETURN_SHORT_XYZW;
3570 }
3571 
3572 template <int texType, enum hipTextureReadMode mode>
3573 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture<unsigned short, texType, mode> texRef,
3574  float x) {
3575  TEXTURE_REF_PARAMETERS_INIT;
3576  texel.f = __ockl_image_sample_1D(i, s, x);
3577  TEXTURE_RETURN_USHORT;
3578 }
3579 
3580 template <int texType, enum hipTextureReadMode mode>
3581 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture<ushort1, texType, mode> texRef, float x) {
3582  TEXTURE_REF_PARAMETERS_INIT;
3583  texel.f = __ockl_image_sample_1D(i, s, x);
3584  TEXTURE_RETURN_USHORT_X;
3585 }
3586 
3587 template <int texType, enum hipTextureReadMode mode>
3588 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture<ushort2, texType, mode> texRef, float x) {
3589  TEXTURE_REF_PARAMETERS_INIT;
3590  texel.f = __ockl_image_sample_1D(i, s, x);
3591  TEXTURE_RETURN_USHORT_XY;
3592 }
3593 
3594 template <int texType, enum hipTextureReadMode mode>
3595 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture<ushort4, texType, mode> texRef, float x) {
3596  TEXTURE_REF_PARAMETERS_INIT;
3597  texel.f = __ockl_image_sample_1D(i, s, x);
3598  TEXTURE_RETURN_USHORT_XYZW;
3599 }
3600 
3601 template <int texType, enum hipTextureReadMode mode>
3602 __TEXTURE_FUNCTIONS_DECL__ int tex1D(texture<int, texType, mode> texRef, float x) {
3603  TEXTURE_REF_PARAMETERS_INIT;
3604  texel.f = __ockl_image_sample_1D(i, s, x);
3605  TEXTURE_RETURN_INT;
3606 }
3607 
3608 template <int texType, enum hipTextureReadMode mode>
3609 __TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture<int1, texType, mode> texRef, float x) {
3610  TEXTURE_REF_PARAMETERS_INIT;
3611  texel.f = __ockl_image_sample_1D(i, s, x);
3612  TEXTURE_RETURN_INT_X;
3613 }
3614 
3615 template <int texType, enum hipTextureReadMode mode>
3616 __TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture<int2, texType, mode> texRef, float x) {
3617  TEXTURE_REF_PARAMETERS_INIT;
3618  texel.f = __ockl_image_sample_1D(i, s, x);
3619  TEXTURE_RETURN_INT_XY;
3620 }
3621 
3622 template <int texType, enum hipTextureReadMode mode>
3623 __TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture<int4, texType, mode> texRef, float x) {
3624  TEXTURE_REF_PARAMETERS_INIT;
3625  texel.f = __ockl_image_sample_1D(i, s, x);
3626  TEXTURE_RETURN_INT_XYZW;
3627 }
3628 
3629 template <int texType, enum hipTextureReadMode mode>
3630 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture<unsigned int, texType, mode> texRef, float x) {
3631  TEXTURE_REF_PARAMETERS_INIT;
3632  texel.f = __ockl_image_sample_1D(i, s, x);
3633  TEXTURE_RETURN_UINT;
3634 }
3635 
3636 template <int texType, enum hipTextureReadMode mode>
3637 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture<uint1, texType, mode> texRef, float x) {
3638  TEXTURE_REF_PARAMETERS_INIT;
3639  texel.f = __ockl_image_sample_1D(i, s, x);
3640  TEXTURE_RETURN_UINT_X;
3641 }
3642 
3643 template <int texType, enum hipTextureReadMode mode>
3644 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture<uint2, texType, mode> texRef, float x) {
3645  TEXTURE_REF_PARAMETERS_INIT;
3646  texel.f = __ockl_image_sample_1D(i, s, x);
3647  TEXTURE_RETURN_UINT_XY;
3648 }
3649 
3650 template <int texType, enum hipTextureReadMode mode>
3651 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture<uint4, texType, mode> texRef, float x) {
3652  TEXTURE_REF_PARAMETERS_INIT;
3653  texel.f = __ockl_image_sample_1D(i, s, x);
3654  TEXTURE_RETURN_UINT_XYZW;
3655 }
3656 
3657 template <int texType, enum hipTextureReadMode mode>
3658 __TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture<float1, texType, mode> texRef, float x) {
3659  TEXTURE_REF_PARAMETERS_INIT;
3660  texel.f = __ockl_image_sample_1D(i, s, x);
3661  TEXTURE_RETURN_FLOAT_X;
3662 }
3663 
3664 template <int texType, enum hipTextureReadMode mode>
3665 __TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture<float2, texType, mode> texRef, float x) {
3666  TEXTURE_REF_PARAMETERS_INIT;
3667  texel.f = __ockl_image_sample_1D(i, s, x);
3668  TEXTURE_RETURN_FLOAT_XY;
3669 }
3670 
3671 template <int texType, enum hipTextureReadMode mode>
3672 __TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture<float4, texType, mode> texRef, float x) {
3673  TEXTURE_REF_PARAMETERS_INIT;
3674  texel.f = __ockl_image_sample_1D(i, s, x);
3675  TEXTURE_RETURN_FLOAT_XYZW;
3676 }
3677 
3679 template <int texType, enum hipTextureReadMode mode>
3680 __TEXTURE_FUNCTIONS_DECL__ char tex1D(texture<char, texType, mode> texRef,
3681  hipTextureObject_t textureObject, float x) {
3682  TEXTURE_PARAMETERS_INIT;
3683  texel.f = __ockl_image_sample_1D(i, s, x);
3684  TEXTURE_RETURN_CHAR;
3685 }
3686 
3687 template <int texType, enum hipTextureReadMode mode>
3688 __TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture<char1, texType, mode> texRef,
3689  hipTextureObject_t textureObject, float x) {
3690  TEXTURE_PARAMETERS_INIT;
3691  texel.f = __ockl_image_sample_1D(i, s, x);
3692  TEXTURE_RETURN_CHAR_X;
3693 }
3694 
3695 template <int texType, enum hipTextureReadMode mode>
3696 __TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture<char2, texType, mode> texRef,
3697  hipTextureObject_t textureObject, float x) {
3698  TEXTURE_PARAMETERS_INIT;
3699  texel.f = __ockl_image_sample_1D(i, s, x);
3700  TEXTURE_RETURN_CHAR_XY;
3701 }
3702 
3703 template <int texType, enum hipTextureReadMode mode>
3704 __TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture<char4, texType, mode> texRef,
3705  hipTextureObject_t textureObject, float x) {
3706  TEXTURE_PARAMETERS_INIT;
3707  texel.f = __ockl_image_sample_1D(i, s, x);
3708  TEXTURE_RETURN_CHAR_XYZW;
3709 }
3710 
3711 template <int texType, enum hipTextureReadMode mode>
3712 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture<unsigned char, texType, mode> texRef,
3713  hipTextureObject_t textureObject, float x) {
3714  TEXTURE_PARAMETERS_INIT;
3715  texel.f = __ockl_image_sample_1D(i, s, x);
3716  TEXTURE_RETURN_UCHAR;
3717 }
3718 
3719 template <int texType, enum hipTextureReadMode mode>
3720 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture<uchar1, texType, mode> texRef,
3721  hipTextureObject_t textureObject, float x) {
3722  TEXTURE_PARAMETERS_INIT;
3723  texel.f = __ockl_image_sample_1D(i, s, x);
3724  TEXTURE_RETURN_UCHAR_X;
3725 }
3726 
3727 template <int texType, enum hipTextureReadMode mode>
3728 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture<uchar2, texType, mode> texRef,
3729  hipTextureObject_t textureObject, float x) {
3730  TEXTURE_PARAMETERS_INIT;
3731  texel.f = __ockl_image_sample_1D(i, s, x);
3732  TEXTURE_RETURN_UCHAR_XY;
3733 }
3734 
3735 template <int texType, enum hipTextureReadMode mode>
3736 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture<uchar4, texType, mode> texRef,
3737  hipTextureObject_t textureObject, float x) {
3738  TEXTURE_PARAMETERS_INIT;
3739  texel.f = __ockl_image_sample_1D(i, s, x);
3740  TEXTURE_RETURN_UCHAR_XYZW;
3741 }
3742 
3743 template <int texType, enum hipTextureReadMode mode>
3744 __TEXTURE_FUNCTIONS_DECL__ short tex1D(texture<short, texType, mode> texRef,
3745  hipTextureObject_t textureObject, float x) {
3746  TEXTURE_PARAMETERS_INIT;
3747  texel.f = __ockl_image_sample_1D(i, s, x);
3748  TEXTURE_RETURN_SHORT;
3749 }
3750 
3751 template <int texType, enum hipTextureReadMode mode>
3752 __TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture<short1, texType, mode> texRef,
3753  hipTextureObject_t textureObject, float x) {
3754  TEXTURE_PARAMETERS_INIT;
3755  texel.f = __ockl_image_sample_1D(i, s, x);
3756  TEXTURE_RETURN_SHORT_X;
3757 }
3758 
3759 template <int texType, enum hipTextureReadMode mode>
3760 __TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture<short2, texType, mode> texRef,
3761  hipTextureObject_t textureObject, float x) {
3762  TEXTURE_PARAMETERS_INIT;
3763  texel.f = __ockl_image_sample_1D(i, s, x);
3764  TEXTURE_RETURN_SHORT_XY;
3765 }
3766 
3767 template <int texType, enum hipTextureReadMode mode>
3768 __TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture<short4, texType, mode> texRef,
3769  hipTextureObject_t textureObject, float x) {
3770  TEXTURE_PARAMETERS_INIT;
3771  texel.f = __ockl_image_sample_1D(i, s, x);
3772  TEXTURE_RETURN_SHORT_XYZW;
3773 }
3774 
3775 template <int texType, enum hipTextureReadMode mode>
3776 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture<unsigned short, texType, mode> texRef,
3777  hipTextureObject_t textureObject, float x) {
3778  TEXTURE_PARAMETERS_INIT;
3779  texel.f = __ockl_image_sample_1D(i, s, x);
3780  TEXTURE_RETURN_USHORT;
3781 }
3782 
3783 template <int texType, enum hipTextureReadMode mode>
3784 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture<ushort1, texType, mode> texRef,
3785  hipTextureObject_t textureObject, float x) {
3786  TEXTURE_PARAMETERS_INIT;
3787  texel.f = __ockl_image_sample_1D(i, s, x);
3788  TEXTURE_RETURN_USHORT_X;
3789 }
3790 
3791 template <int texType, enum hipTextureReadMode mode>
3792 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture<ushort2, texType, mode> texRef,
3793  hipTextureObject_t textureObject, float x) {
3794  TEXTURE_PARAMETERS_INIT;
3795  texel.f = __ockl_image_sample_1D(i, s, x);
3796  TEXTURE_RETURN_USHORT_XY;
3797 }
3798 
3799 template <int texType, enum hipTextureReadMode mode>
3800 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture<ushort4, texType, mode> texRef,
3801  hipTextureObject_t textureObject, float x) {
3802  TEXTURE_PARAMETERS_INIT;
3803  texel.f = __ockl_image_sample_1D(i, s, x);
3804  TEXTURE_RETURN_USHORT_XYZW;
3805 }
3806 
3807 template <int texType, enum hipTextureReadMode mode>
3808 __TEXTURE_FUNCTIONS_DECL__ int tex1D(texture<int, texType, mode> texRef,
3809  hipTextureObject_t textureObject, float x) {
3810  TEXTURE_PARAMETERS_INIT;
3811  texel.f = __ockl_image_sample_1D(i, s, x);
3812  TEXTURE_RETURN_INT;
3813 }
3814 
3815 template <int texType, enum hipTextureReadMode mode>
3816 __TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture<int1, texType, mode> texRef,
3817  hipTextureObject_t textureObject, float x) {
3818  TEXTURE_PARAMETERS_INIT;
3819  texel.f = __ockl_image_sample_1D(i, s, x);
3820  TEXTURE_RETURN_INT_X;
3821 }
3822 
3823 template <int texType, enum hipTextureReadMode mode>
3824 __TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture<int2, texType, mode> texRef,
3825  hipTextureObject_t textureObject, float x) {
3826  TEXTURE_PARAMETERS_INIT;
3827  texel.f = __ockl_image_sample_1D(i, s, x);
3828  TEXTURE_RETURN_INT_XY;
3829 }
3830 
3831 template <int texType, enum hipTextureReadMode mode>
3832 __TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture<int4, texType, mode> texRef,
3833  hipTextureObject_t textureObject, float x) {
3834  TEXTURE_PARAMETERS_INIT;
3835  texel.f = __ockl_image_sample_1D(i, s, x);
3836  TEXTURE_RETURN_INT_XYZW;
3837 }
3838 
3839 template <int texType, enum hipTextureReadMode mode>
3840 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture<unsigned int, texType, mode> texRef,
3841  hipTextureObject_t textureObject, float x) {
3842  TEXTURE_PARAMETERS_INIT;
3843  texel.f = __ockl_image_sample_1D(i, s, x);
3844  TEXTURE_RETURN_UINT;
3845 }
3846 
3847 template <int texType, enum hipTextureReadMode mode>
3848 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture<uint1, texType, mode> texRef,
3849  hipTextureObject_t textureObject, float x) {
3850  TEXTURE_PARAMETERS_INIT;
3851  texel.f = __ockl_image_sample_1D(i, s, x);
3852  TEXTURE_RETURN_UINT_X;
3853 }
3854 
3855 template <int texType, enum hipTextureReadMode mode>
3856 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture<uint2, texType, mode> texRef,
3857  hipTextureObject_t textureObject, float x) {
3858  TEXTURE_PARAMETERS_INIT;
3859  texel.f = __ockl_image_sample_1D(i, s, x);
3860  TEXTURE_RETURN_UINT_XY;
3861 }
3862 
3863 template <int texType, enum hipTextureReadMode mode>
3864 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture<uint4, texType, mode> texRef,
3865  hipTextureObject_t textureObject, float x) {
3866  TEXTURE_PARAMETERS_INIT;
3867  texel.f = __ockl_image_sample_1D(i, s, x);
3868  TEXTURE_RETURN_UINT_XYZW;
3869 }
3870 
3871 template <int texType, enum hipTextureReadMode mode>
3872 __TEXTURE_FUNCTIONS_DECL__ float tex1D(texture<float, texType, mode> texRef,
3873  hipTextureObject_t textureObject, float x) {
3874  TEXTURE_PARAMETERS_INIT;
3875  texel.f = __ockl_image_sample_1D(i, s, x);
3876  TEXTURE_RETURN_FLOAT;
3877 }
3879 
3880 template <int texType, enum hipTextureReadMode mode>
3881 __TEXTURE_FUNCTIONS_DECL__ float tex1D(texture<float, texType, mode> texRef, float x) {
3882  TEXTURE_REF_PARAMETERS_INIT;
3883  texel.f = __ockl_image_sample_1D(i, s, x);
3884  TEXTURE_RETURN_FLOAT;
3885 }
3886 
3887 template <int texType, enum hipTextureReadMode mode>
3888 __TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture<float1, texType, mode> texRef,
3889  hipTextureObject_t textureObject, float x) {
3890  TEXTURE_PARAMETERS_INIT;
3891  texel.f = __ockl_image_sample_1D(i, s, x);
3892  TEXTURE_RETURN_FLOAT_X;
3893 }
3894 
3895 template <int texType, enum hipTextureReadMode mode>
3896 __TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture<float2, texType, mode> texRef,
3897  hipTextureObject_t textureObject, float x) {
3898  TEXTURE_PARAMETERS_INIT;
3899  texel.f = __ockl_image_sample_1D(i, s, x);
3900  TEXTURE_RETURN_FLOAT_XY;
3901 }
3902 
3903 template <int texType, enum hipTextureReadMode mode>
3904 __TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture<float4, texType, mode> texRef,
3905  hipTextureObject_t textureObject, float x) {
3906  TEXTURE_PARAMETERS_INIT;
3907  texel.f = __ockl_image_sample_1D(i, s, x);
3908  TEXTURE_RETURN_FLOAT_XYZW;
3909 }
3910 
3912 
3913 template <int texType, enum hipTextureReadMode mode>
3914 __TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture<char, texType, mode> texRef, float x,
3915  float level) {
3916  TEXTURE_REF_PARAMETERS_INIT;
3917  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3918  TEXTURE_RETURN_CHAR;
3919 }
3920 
3921 template <int texType, enum hipTextureReadMode mode>
3922 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture<char1, texType, mode> texRef, float x,
3923  float level) {
3924  TEXTURE_REF_PARAMETERS_INIT;
3925  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3926  TEXTURE_RETURN_CHAR_X;
3927 }
3928 template <int texType, enum hipTextureReadMode mode>
3929 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture<char2, texType, mode> texRef, float x,
3930  float level) {
3931  TEXTURE_REF_PARAMETERS_INIT;
3932  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3933  TEXTURE_RETURN_CHAR_XY;
3934 }
3935 
3936 template <int texType, enum hipTextureReadMode mode>
3937 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture<char4, texType, mode> texRef, float x,
3938  float level) {
3939  TEXTURE_REF_PARAMETERS_INIT;
3940  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3941  TEXTURE_RETURN_CHAR_XYZW;
3942 }
3943 
3944 template <int texType, enum hipTextureReadMode mode>
3945 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture<unsigned char, texType, mode> texRef,
3946  float x, float level) {
3947  TEXTURE_REF_PARAMETERS_INIT;
3948  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3949  TEXTURE_RETURN_UCHAR;
3950 }
3951 
3952 template <int texType, enum hipTextureReadMode mode>
3953 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture<uchar1, texType, mode> texRef, float x,
3954  float level) {
3955  TEXTURE_REF_PARAMETERS_INIT;
3956  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3957  TEXTURE_RETURN_UCHAR_X;
3958 }
3959 
3960 template <int texType, enum hipTextureReadMode mode>
3961 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture<uchar2, texType, mode> texRef, float x,
3962  float level) {
3963  TEXTURE_REF_PARAMETERS_INIT;
3964  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3965  TEXTURE_RETURN_UCHAR_XY;
3966 }
3967 
3968 template <int texType, enum hipTextureReadMode mode>
3969 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture<uchar4, texType, mode> texRef, float x,
3970  float level) {
3971  TEXTURE_REF_PARAMETERS_INIT;
3972  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3973  TEXTURE_RETURN_UCHAR_XYZW;
3974 }
3975 
3976 template <int texType, enum hipTextureReadMode mode>
3977 __TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture<short, texType, mode> texRef, float x,
3978  float level) {
3979  TEXTURE_REF_PARAMETERS_INIT;
3980  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3981  TEXTURE_RETURN_SHORT;
3982 }
3983 
3984 template <int texType, enum hipTextureReadMode mode>
3985 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture<short1, texType, mode> texRef, float x,
3986  float level) {
3987  TEXTURE_REF_PARAMETERS_INIT;
3988  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3989  TEXTURE_RETURN_SHORT_X;
3990 }
3991 
3992 template <int texType, enum hipTextureReadMode mode>
3993 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture<short2, texType, mode> texRef, float x,
3994  float level) {
3995  TEXTURE_REF_PARAMETERS_INIT;
3996  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
3997  TEXTURE_RETURN_SHORT_XY;
3998 }
3999 
4000 template <int texType, enum hipTextureReadMode mode>
4001 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture<short4, texType, mode> texRef, float x,
4002  float level) {
4003  TEXTURE_REF_PARAMETERS_INIT;
4004  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4005  TEXTURE_RETURN_SHORT_XYZW;
4006 }
4007 
4008 template <int texType, enum hipTextureReadMode mode>
4009 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture<unsigned short, texType, mode> texRef,
4010  float x, float level) {
4011  TEXTURE_REF_PARAMETERS_INIT;
4012  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4013  TEXTURE_RETURN_USHORT;
4014 }
4015 
4016 template <int texType, enum hipTextureReadMode mode>
4017 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture<ushort1, texType, mode> texRef, float x,
4018  float level) {
4019  TEXTURE_REF_PARAMETERS_INIT;
4020  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4021  TEXTURE_RETURN_USHORT_X;
4022 }
4023 
4024 template <int texType, enum hipTextureReadMode mode>
4025 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture<ushort2, texType, mode> texRef, float x,
4026  float level) {
4027  TEXTURE_REF_PARAMETERS_INIT;
4028  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4029  TEXTURE_RETURN_USHORT_XY;
4030 }
4031 
4032 template <int texType, enum hipTextureReadMode mode>
4033 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture<ushort4, texType, mode> texRef, float x,
4034  float level) {
4035  TEXTURE_REF_PARAMETERS_INIT;
4036  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4037  TEXTURE_RETURN_USHORT_XYZW;
4038 }
4039 
4040 template <int texType, enum hipTextureReadMode mode>
4041 __TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture<int, texType, mode> texRef, float x, float level) {
4042  TEXTURE_REF_PARAMETERS_INIT;
4043  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4044  TEXTURE_RETURN_INT;
4045 }
4046 
4047 template <int texType, enum hipTextureReadMode mode>
4048 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture<int1, texType, mode> texRef, float x,
4049  float level) {
4050  TEXTURE_REF_PARAMETERS_INIT;
4051  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4052  TEXTURE_RETURN_INT_X;
4053 }
4054 
4055 template <int texType, enum hipTextureReadMode mode>
4056 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture<int2, texType, mode> texRef, float x,
4057  float level) {
4058  TEXTURE_REF_PARAMETERS_INIT;
4059  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4060  TEXTURE_RETURN_INT_XY;
4061 }
4062 
4063 template <int texType, enum hipTextureReadMode mode>
4064 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture<int4, texType, mode> texRef, float x,
4065  float level) {
4066  TEXTURE_REF_PARAMETERS_INIT;
4067  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4068  TEXTURE_RETURN_INT_XYZW;
4069 }
4070 
4071 template <int texType, enum hipTextureReadMode mode>
4072 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture<unsigned int, texType, mode> texRef,
4073  float x, float level) {
4074  TEXTURE_REF_PARAMETERS_INIT;
4075  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4076  TEXTURE_RETURN_UINT;
4077 }
4078 
4079 template <int texType, enum hipTextureReadMode mode>
4080 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture<uint1, texType, mode> texRef, float x,
4081  float level) {
4082  TEXTURE_REF_PARAMETERS_INIT;
4083  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4084  TEXTURE_RETURN_UINT_X;
4085 }
4086 
4087 template <int texType, enum hipTextureReadMode mode>
4088 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture<uint2, texType, mode> texRef, float x,
4089  float level) {
4090  TEXTURE_REF_PARAMETERS_INIT;
4091  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4092  TEXTURE_RETURN_UINT_XY;
4093 }
4094 
4095 template <int texType, enum hipTextureReadMode mode>
4096 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture<uint4, texType, mode> texRef, float x,
4097  float level) {
4098  TEXTURE_REF_PARAMETERS_INIT;
4099  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4100  TEXTURE_RETURN_UINT_XYZW;
4101 }
4102 
4103 template <int texType, enum hipTextureReadMode mode>
4104 __TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture<float, texType, mode> texRef, float x,
4105  float level) {
4106  TEXTURE_REF_PARAMETERS_INIT;
4107  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4108  TEXTURE_RETURN_FLOAT;
4109 }
4110 
4111 template <int texType, enum hipTextureReadMode mode>
4112 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture<float1, texType, mode> texRef, float x,
4113  float level) {
4114  TEXTURE_REF_PARAMETERS_INIT;
4115  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4116  TEXTURE_RETURN_FLOAT_X;
4117 }
4118 
4119 template <int texType, enum hipTextureReadMode mode>
4120 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture<float2, texType, mode> texRef, float x,
4121  float level) {
4122  TEXTURE_REF_PARAMETERS_INIT;
4123  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4124  TEXTURE_RETURN_FLOAT_XY;
4125 }
4126 
4127 template <int texType, enum hipTextureReadMode mode>
4128 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture<float4, texType, mode> texRef, float x,
4129  float level) {
4130  TEXTURE_REF_PARAMETERS_INIT;
4131  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4132  TEXTURE_RETURN_FLOAT_XYZW;
4133 }
4134 
4136 
4137 template <int texType, enum hipTextureReadMode mode>
4138 __TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture<char, texType, mode> texRef,
4139  hipTextureObject_t textureObject, float x, float level) {
4140  TEXTURE_PARAMETERS_INIT;
4141  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4142  TEXTURE_RETURN_CHAR;
4143 }
4144 
4145 template <int texType, enum hipTextureReadMode mode>
4146 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture<char1, texType, mode> texRef,
4147  hipTextureObject_t textureObject, float x, float level) {
4148  TEXTURE_PARAMETERS_INIT;
4149  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4150  TEXTURE_RETURN_CHAR_X;
4151 }
4152 template <int texType, enum hipTextureReadMode mode>
4153 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture<char2, texType, mode> texRef,
4154  hipTextureObject_t textureObject, float x, float level) {
4155  TEXTURE_PARAMETERS_INIT;
4156  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4157  TEXTURE_RETURN_CHAR_XY;
4158 }
4159 
4160 template <int texType, enum hipTextureReadMode mode>
4161 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture<char4, texType, mode> texRef,
4162  hipTextureObject_t textureObject, float x, float level) {
4163  TEXTURE_PARAMETERS_INIT;
4164  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4165  TEXTURE_RETURN_CHAR_XYZW;
4166 }
4167 
4168 template <int texType, enum hipTextureReadMode mode>
4169 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture<unsigned char, texType, mode> texRef,
4170  hipTextureObject_t textureObject, float x,
4171  float level) {
4172  TEXTURE_PARAMETERS_INIT;
4173  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4174  TEXTURE_RETURN_UCHAR;
4175 }
4176 
4177 template <int texType, enum hipTextureReadMode mode>
4178 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture<uchar1, texType, mode> texRef,
4179  hipTextureObject_t textureObject, float x, float level) {
4180  TEXTURE_PARAMETERS_INIT;
4181  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4182  TEXTURE_RETURN_UCHAR_X;
4183 }
4184 
4185 template <int texType, enum hipTextureReadMode mode>
4186 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture<uchar2, texType, mode> texRef,
4187  hipTextureObject_t textureObject, float x, float level) {
4188  TEXTURE_PARAMETERS_INIT;
4189  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4190  TEXTURE_RETURN_UCHAR_XY;
4191 }
4192 
4193 template <int texType, enum hipTextureReadMode mode>
4194 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture<uchar4, texType, mode> texRef,
4195  hipTextureObject_t textureObject, float x, float level) {
4196  TEXTURE_PARAMETERS_INIT;
4197  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4198  TEXTURE_RETURN_UCHAR_XYZW;
4199 }
4200 
4201 template <int texType, enum hipTextureReadMode mode>
4202 __TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture<short, texType, mode> texRef,
4203  hipTextureObject_t textureObject, float x, float level) {
4204  TEXTURE_PARAMETERS_INIT;
4205  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4206  TEXTURE_RETURN_SHORT;
4207 }
4208 
4209 template <int texType, enum hipTextureReadMode mode>
4210 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture<short1, texType, mode> texRef,
4211  hipTextureObject_t textureObject, float x, float level) {
4212  TEXTURE_PARAMETERS_INIT;
4213  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4214  TEXTURE_RETURN_SHORT_X;
4215 }
4216 
4217 template <int texType, enum hipTextureReadMode mode>
4218 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture<short2, texType, mode> texRef,
4219  hipTextureObject_t textureObject, float x, float level) {
4220  TEXTURE_PARAMETERS_INIT;
4221  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4222  TEXTURE_RETURN_SHORT_XY;
4223 }
4224 
4225 template <int texType, enum hipTextureReadMode mode>
4226 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture<short4, texType, mode> texRef,
4227  hipTextureObject_t textureObject, float x, float level) {
4228  TEXTURE_PARAMETERS_INIT;
4229  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4230  TEXTURE_RETURN_SHORT_XYZW;
4231 }
4232 
4233 template <int texType, enum hipTextureReadMode mode>
4234 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture<unsigned short, texType, mode> texRef,
4235  hipTextureObject_t textureObject, float x,
4236  float level) {
4237  TEXTURE_PARAMETERS_INIT;
4238  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4239  TEXTURE_RETURN_USHORT;
4240 }
4241 
4242 template <int texType, enum hipTextureReadMode mode>
4243 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture<ushort1, texType, mode> texRef,
4244  hipTextureObject_t textureObject, float x,
4245  float level) {
4246  TEXTURE_PARAMETERS_INIT;
4247  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4248  TEXTURE_RETURN_USHORT_X;
4249 }
4250 
4251 template <int texType, enum hipTextureReadMode mode>
4252 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture<ushort2, texType, mode> texRef,
4253  hipTextureObject_t textureObject, float x,
4254  float level) {
4255  TEXTURE_PARAMETERS_INIT;
4256  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4257  TEXTURE_RETURN_USHORT_XY;
4258 }
4259 
4260 template <int texType, enum hipTextureReadMode mode>
4261 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture<ushort4, texType, mode> texRef,
4262  hipTextureObject_t textureObject, float x,
4263  float level) {
4264  TEXTURE_PARAMETERS_INIT;
4265  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4266  TEXTURE_RETURN_USHORT_XYZW;
4267 }
4268 
4269 template <int texType, enum hipTextureReadMode mode>
4270 __TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture<int, texType, mode> texRef,
4271  hipTextureObject_t textureObject, float x, float level) {
4272  TEXTURE_PARAMETERS_INIT;
4273  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4274  TEXTURE_RETURN_INT;
4275 }
4276 
4277 template <int texType, enum hipTextureReadMode mode>
4278 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture<int1, texType, mode> texRef,
4279  hipTextureObject_t textureObject, float x, float level) {
4280  TEXTURE_PARAMETERS_INIT;
4281  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4282  TEXTURE_RETURN_INT_X;
4283 }
4284 
4285 template <int texType, enum hipTextureReadMode mode>
4286 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture<int2, texType, mode> texRef,
4287  hipTextureObject_t textureObject, float x, float level) {
4288  TEXTURE_PARAMETERS_INIT;
4289  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4290  TEXTURE_RETURN_INT_XY;
4291 }
4292 
4293 template <int texType, enum hipTextureReadMode mode>
4294 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture<int4, texType, mode> texRef,
4295  hipTextureObject_t textureObject, float x, float level) {
4296  TEXTURE_PARAMETERS_INIT;
4297  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4298  TEXTURE_RETURN_INT_XYZW;
4299 }
4300 
4301 template <int texType, enum hipTextureReadMode mode>
4302 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture<unsigned int, texType, mode> texRef,
4303  hipTextureObject_t textureObject, float x,
4304  float level) {
4305  TEXTURE_PARAMETERS_INIT;
4306  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4307  TEXTURE_RETURN_UINT;
4308 }
4309 
4310 template <int texType, enum hipTextureReadMode mode>
4311 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture<uint1, texType, mode> texRef,
4312  hipTextureObject_t textureObject, float x, float level) {
4313  TEXTURE_PARAMETERS_INIT;
4314  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4315  TEXTURE_RETURN_UINT_X;
4316 }
4317 
4318 template <int texType, enum hipTextureReadMode mode>
4319 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture<uint2, texType, mode> texRef,
4320  hipTextureObject_t textureObject, float x, float level) {
4321  TEXTURE_PARAMETERS_INIT;
4322  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4323  TEXTURE_RETURN_UINT_XY;
4324 }
4325 
4326 template <int texType, enum hipTextureReadMode mode>
4327 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture<uint4, texType, mode> texRef,
4328  hipTextureObject_t textureObject, float x, float level) {
4329  TEXTURE_PARAMETERS_INIT;
4330  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4331  TEXTURE_RETURN_UINT_XYZW;
4332 }
4333 
4334 template <int texType, enum hipTextureReadMode mode>
4335 __TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture<float, texType, mode> texRef,
4336  hipTextureObject_t textureObject, float x, float level) {
4337  TEXTURE_PARAMETERS_INIT;
4338  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4339  TEXTURE_RETURN_FLOAT;
4340 }
4341 
4342 template <int texType, enum hipTextureReadMode mode>
4343 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture<float1, texType, mode> texRef,
4344  hipTextureObject_t textureObject, float x, float level) {
4345  TEXTURE_PARAMETERS_INIT;
4346  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4347  TEXTURE_RETURN_FLOAT_X;
4348 }
4349 
4350 template <int texType, enum hipTextureReadMode mode>
4351 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture<float2, texType, mode> texRef,
4352  hipTextureObject_t textureObject, float x, float level) {
4353  TEXTURE_PARAMETERS_INIT;
4354  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4355  TEXTURE_RETURN_FLOAT_XY;
4356 }
4357 
4358 template <int texType, enum hipTextureReadMode mode>
4359 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture<float4, texType, mode> texRef,
4360  hipTextureObject_t textureObject, float x, float level) {
4361  TEXTURE_PARAMETERS_INIT;
4362  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
4363  TEXTURE_RETURN_FLOAT_XYZW;
4364 }
4365 
4367 
4368 template <int texType, enum hipTextureReadMode mode>
4369 __TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture<char, texType, mode> texRef, float x, float dx,
4370  float dy) {
4371  TEXTURE_REF_PARAMETERS_INIT;
4372  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4373  TEXTURE_RETURN_CHAR;
4374 }
4375 
4376 template <int texType, enum hipTextureReadMode mode>
4377 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture<char1, texType, mode> texRef, float x, float dx,
4378  float dy) {
4379  TEXTURE_REF_PARAMETERS_INIT;
4380  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4381  TEXTURE_RETURN_CHAR_X;
4382 }
4383 
4384 template <int texType, enum hipTextureReadMode mode>
4385 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture<char2, texType, mode> texRef, float x, float dx,
4386  float dy) {
4387  TEXTURE_REF_PARAMETERS_INIT;
4388  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4389  TEXTURE_RETURN_CHAR_XY;
4390 }
4391 
4392 template <int texType, enum hipTextureReadMode mode>
4393 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture<char4, texType, mode> texRef, float x, float dx,
4394  float dy) {
4395  TEXTURE_REF_PARAMETERS_INIT;
4396  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4397  TEXTURE_RETURN_CHAR_XYZW;
4398 }
4399 
4400 template <int texType, enum hipTextureReadMode mode>
4401 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture<unsigned char, texType, mode> texRef,
4402  float x, float dx, float dy) {
4403  TEXTURE_REF_PARAMETERS_INIT;
4404  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4405  TEXTURE_RETURN_UCHAR;
4406 }
4407 
4408 template <int texType, enum hipTextureReadMode mode>
4409 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture<uchar1, texType, mode> texRef, float x,
4410  float dx, float dy) {
4411  TEXTURE_REF_PARAMETERS_INIT;
4412  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4413  TEXTURE_RETURN_UCHAR_X;
4414 }
4415 
4416 template <int texType, enum hipTextureReadMode mode>
4417 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture<uchar2, texType, mode> texRef, float x,
4418  float dx, float dy) {
4419  TEXTURE_REF_PARAMETERS_INIT;
4420  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4421  TEXTURE_RETURN_UCHAR_XY;
4422 }
4423 
4424 template <int texType, enum hipTextureReadMode mode>
4425 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture<uchar4, texType, mode> texRef, float x,
4426  float dx, float dy) {
4427  TEXTURE_REF_PARAMETERS_INIT;
4428  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4429  TEXTURE_RETURN_UCHAR_XYZW;
4430 }
4431 
4432 template <int texType, enum hipTextureReadMode mode>
4433 __TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture<short, texType, mode> texRef, float x, float dx,
4434  float dy) {
4435  TEXTURE_REF_PARAMETERS_INIT;
4436  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4437  TEXTURE_RETURN_SHORT;
4438 }
4439 
4440 template <int texType, enum hipTextureReadMode mode>
4441 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture<short1, texType, mode> texRef, float x,
4442  float dx, float dy) {
4443  TEXTURE_REF_PARAMETERS_INIT;
4444  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4445  TEXTURE_RETURN_SHORT_X;
4446 }
4447 
4448 template <int texType, enum hipTextureReadMode mode>
4449 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture<short2, texType, mode> texRef, float x,
4450  float dx, float dy) {
4451  TEXTURE_REF_PARAMETERS_INIT;
4452  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4453  TEXTURE_RETURN_SHORT_XY;
4454 }
4455 
4456 template <int texType, enum hipTextureReadMode mode>
4457 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture<short4, texType, mode> texRef, float x,
4458  float dx, float dy) {
4459  TEXTURE_REF_PARAMETERS_INIT;
4460  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4461  TEXTURE_RETURN_SHORT_XYZW;
4462 }
4463 
4464 template <int texType, enum hipTextureReadMode mode>
4465 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture<unsigned short, texType, mode> texRef,
4466  float x, float dx, float dy) {
4467  TEXTURE_REF_PARAMETERS_INIT;
4468  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4469  TEXTURE_RETURN_USHORT;
4470 }
4471 
4472 template <int texType, enum hipTextureReadMode mode>
4473 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture<ushort1, texType, mode> texRef, float x,
4474  float dx, float dy) {
4475  TEXTURE_REF_PARAMETERS_INIT;
4476  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4477  TEXTURE_RETURN_USHORT_X;
4478 }
4479 
4480 template <int texType, enum hipTextureReadMode mode>
4481 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture<ushort2, texType, mode> texRef, float x,
4482  float dx, float dy) {
4483  TEXTURE_REF_PARAMETERS_INIT;
4484  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4485  TEXTURE_RETURN_USHORT_XY;
4486 }
4487 
4488 template <int texType, enum hipTextureReadMode mode>
4489 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture<ushort4, texType, mode> texRef, float x,
4490  float dx, float dy) {
4491  TEXTURE_REF_PARAMETERS_INIT;
4492  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4493  TEXTURE_RETURN_USHORT_XYZW;
4494 }
4495 
4496 template <int texType, enum hipTextureReadMode mode>
4497 __TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture<int, texType, mode> texRef, float x, float dx,
4498  float dy) {
4499  TEXTURE_REF_PARAMETERS_INIT;
4500  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4501  TEXTURE_RETURN_INT;
4502 }
4503 
4504 template <int texType, enum hipTextureReadMode mode>
4505 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture<int1, texType, mode> texRef, float x, float dx,
4506  float dy) {
4507  TEXTURE_REF_PARAMETERS_INIT;
4508  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4509  TEXTURE_RETURN_INT_X;
4510 }
4511 
4512 template <int texType, enum hipTextureReadMode mode>
4513 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture<int2, texType, mode> texRef, float x, float dx,
4514  float dy) {
4515  TEXTURE_REF_PARAMETERS_INIT;
4516  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4517  TEXTURE_RETURN_INT_XY;
4518 }
4519 
4520 template <int texType, enum hipTextureReadMode mode>
4521 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture<int4, texType, mode> texRef, float x, float dx,
4522  float dy) {
4523  TEXTURE_REF_PARAMETERS_INIT;
4524  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4525  TEXTURE_RETURN_INT_XYZW;
4526 }
4527 
4528 template <int texType, enum hipTextureReadMode mode>
4529 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture<unsigned int, texType, mode> texRef,
4530  float x, float dx, float dy) {
4531  TEXTURE_REF_PARAMETERS_INIT;
4532  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4533  TEXTURE_RETURN_UINT;
4534 }
4535 
4536 template <int texType, enum hipTextureReadMode mode>
4537 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture<uint1, texType, mode> texRef, float x, float dx,
4538  float dy) {
4539  TEXTURE_REF_PARAMETERS_INIT;
4540  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4541  TEXTURE_RETURN_UINT_X;
4542 }
4543 
4544 template <int texType, enum hipTextureReadMode mode>
4545 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture<uint2, texType, mode> texRef, float x, float dx,
4546  float dy) {
4547  TEXTURE_REF_PARAMETERS_INIT;
4548  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4549  TEXTURE_RETURN_UINT_XY;
4550 }
4551 
4552 template <int texType, enum hipTextureReadMode mode>
4553 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture<uint4, texType, mode> texRef, float x, float dx,
4554  float dy) {
4555  TEXTURE_REF_PARAMETERS_INIT;
4556  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4557  TEXTURE_RETURN_UINT_XYZW;
4558 }
4559 
4560 template <int texType, enum hipTextureReadMode mode>
4561 __TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture<float, texType, mode> texRef, float x, float dx,
4562  float dy) {
4563  TEXTURE_REF_PARAMETERS_INIT;
4564  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4565  TEXTURE_RETURN_FLOAT;
4566 }
4567 
4568 template <int texType, enum hipTextureReadMode mode>
4569 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture<float1, texType, mode> texRef, float x,
4570  float dx, float dy) {
4571  TEXTURE_REF_PARAMETERS_INIT;
4572  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4573  TEXTURE_RETURN_FLOAT_X;
4574 }
4575 
4576 template <int texType, enum hipTextureReadMode mode>
4577 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture<float2, texType, mode> texRef, float x,
4578  float dx, float dy) {
4579  TEXTURE_REF_PARAMETERS_INIT;
4580  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4581  TEXTURE_RETURN_FLOAT_XY;
4582 }
4583 
4584 template <int texType, enum hipTextureReadMode mode>
4585 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture<float4, texType, mode> texRef, float x,
4586  float dx, float dy) {
4587  TEXTURE_REF_PARAMETERS_INIT;
4588  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4589  TEXTURE_RETURN_FLOAT_XYZW;
4590 }
4591 
4593 
4594 template <int texType, enum hipTextureReadMode mode>
4595 __TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture<char, texType, mode> texRef,
4596  hipTextureObject_t textureObject, float x, float dx,
4597  float dy) {
4598  TEXTURE_PARAMETERS_INIT;
4599  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4600  TEXTURE_RETURN_CHAR;
4601 }
4602 
4603 template <int texType, enum hipTextureReadMode mode>
4604 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture<char1, texType, mode> texRef,
4605  hipTextureObject_t textureObject, float x, float dx,
4606  float dy) {
4607  TEXTURE_PARAMETERS_INIT;
4608  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4609  TEXTURE_RETURN_CHAR_X;
4610 }
4611 
4612 template <int texType, enum hipTextureReadMode mode>
4613 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture<char2, texType, mode> texRef,
4614  hipTextureObject_t textureObject, float x, float dx,
4615  float dy) {
4616  TEXTURE_PARAMETERS_INIT;
4617  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4618  TEXTURE_RETURN_CHAR_XY;
4619 }
4620 
4621 template <int texType, enum hipTextureReadMode mode>
4622 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture<char4, texType, mode> texRef,
4623  hipTextureObject_t textureObject, float x, float dx,
4624  float dy) {
4625  TEXTURE_PARAMETERS_INIT;
4626  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4627  TEXTURE_RETURN_CHAR_XYZW;
4628 }
4629 
4630 template <int texType, enum hipTextureReadMode mode>
4631 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture<unsigned char, texType, mode> texRef,
4632  hipTextureObject_t textureObject, float x,
4633  float dx, float dy) {
4634  TEXTURE_PARAMETERS_INIT;
4635  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4636  TEXTURE_RETURN_UCHAR;
4637 }
4638 
4639 template <int texType, enum hipTextureReadMode mode>
4640 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture<uchar1, texType, mode> texRef,
4641  hipTextureObject_t textureObject, float x, float dx,
4642  float dy) {
4643  TEXTURE_PARAMETERS_INIT;
4644  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4645  TEXTURE_RETURN_UCHAR_X;
4646 }
4647 
4648 template <int texType, enum hipTextureReadMode mode>
4649 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture<uchar2, texType, mode> texRef,
4650  hipTextureObject_t textureObject, float x, float dx,
4651  float dy) {
4652  TEXTURE_PARAMETERS_INIT;
4653  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4654  TEXTURE_RETURN_UCHAR_XY;
4655 }
4656 
4657 template <int texType, enum hipTextureReadMode mode>
4658 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture<uchar4, texType, mode> texRef,
4659  hipTextureObject_t textureObject, float x, float dx,
4660  float dy) {
4661  TEXTURE_PARAMETERS_INIT;
4662  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4663  TEXTURE_RETURN_UCHAR_XYZW;
4664 }
4665 
4666 template <int texType, enum hipTextureReadMode mode>
4667 __TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture<short, texType, mode> texRef,
4668  hipTextureObject_t textureObject, float x, float dx,
4669  float dy) {
4670  TEXTURE_PARAMETERS_INIT;
4671  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4672  TEXTURE_RETURN_SHORT;
4673 }
4674 
4675 template <int texType, enum hipTextureReadMode mode>
4676 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture<short1, texType, mode> texRef,
4677  hipTextureObject_t textureObject, float x, float dx,
4678  float dy) {
4679  TEXTURE_PARAMETERS_INIT;
4680  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4681  TEXTURE_RETURN_SHORT_X;
4682 }
4683 
4684 template <int texType, enum hipTextureReadMode mode>
4685 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture<short2, texType, mode> texRef,
4686  hipTextureObject_t textureObject, float x, float dx,
4687  float dy) {
4688  TEXTURE_PARAMETERS_INIT;
4689  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4690  TEXTURE_RETURN_SHORT_XY;
4691 }
4692 
4693 template <int texType, enum hipTextureReadMode mode>
4694 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture<short4, texType, mode> texRef,
4695  hipTextureObject_t textureObject, float x, float dx,
4696  float dy) {
4697  TEXTURE_PARAMETERS_INIT;
4698  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4699  TEXTURE_RETURN_SHORT_XYZW;
4700 }
4701 
4702 template <int texType, enum hipTextureReadMode mode>
4703 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture<unsigned short, texType, mode> texRef,
4704  hipTextureObject_t textureObject, float x,
4705  float dx, float dy) {
4706  TEXTURE_PARAMETERS_INIT;
4707  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4708  TEXTURE_RETURN_USHORT;
4709 }
4710 
4711 template <int texType, enum hipTextureReadMode mode>
4712 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture<ushort1, texType, mode> texRef,
4713  hipTextureObject_t textureObject, float x, float dx,
4714  float dy) {
4715  TEXTURE_PARAMETERS_INIT;
4716  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4717  TEXTURE_RETURN_USHORT_X;
4718 }
4719 
4720 template <int texType, enum hipTextureReadMode mode>
4721 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture<ushort2, texType, mode> texRef,
4722  hipTextureObject_t textureObject, float x, float dx,
4723  float dy) {
4724  TEXTURE_PARAMETERS_INIT;
4725  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4726  TEXTURE_RETURN_USHORT_XY;
4727 }
4728 
4729 template <int texType, enum hipTextureReadMode mode>
4730 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture<ushort4, texType, mode> texRef,
4731  hipTextureObject_t textureObject, float x, float dx,
4732  float dy) {
4733  TEXTURE_PARAMETERS_INIT;
4734  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4735  TEXTURE_RETURN_USHORT_XYZW;
4736 }
4737 
4738 template <int texType, enum hipTextureReadMode mode>
4739 __TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture<int, texType, mode> texRef,
4740  hipTextureObject_t textureObject, float x, float dx,
4741  float dy) {
4742  TEXTURE_PARAMETERS_INIT;
4743  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4744  TEXTURE_RETURN_INT;
4745 }
4746 
4747 template <int texType, enum hipTextureReadMode mode>
4748 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture<int1, texType, mode> texRef,
4749  hipTextureObject_t textureObject, float x, float dx,
4750  float dy) {
4751  TEXTURE_PARAMETERS_INIT;
4752  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4753  TEXTURE_RETURN_INT_X;
4754 }
4755 
4756 template <int texType, enum hipTextureReadMode mode>
4757 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture<int2, texType, mode> texRef,
4758  hipTextureObject_t textureObject, float x, float dx,
4759  float dy) {
4760  TEXTURE_PARAMETERS_INIT;
4761  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4762  TEXTURE_RETURN_INT_XY;
4763 }
4764 
4765 template <int texType, enum hipTextureReadMode mode>
4766 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture<int4, texType, mode> texRef,
4767  hipTextureObject_t textureObject, float x, float dx,
4768  float dy) {
4769  TEXTURE_PARAMETERS_INIT;
4770  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4771  TEXTURE_RETURN_INT_XYZW;
4772 }
4773 
4774 template <int texType, enum hipTextureReadMode mode>
4775 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture<unsigned int, texType, mode> texRef,
4776  hipTextureObject_t textureObject, float x,
4777  float dx, float dy) {
4778  TEXTURE_PARAMETERS_INIT;
4779  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4780  TEXTURE_RETURN_UINT;
4781 }
4782 
4783 template <int texType, enum hipTextureReadMode mode>
4784 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture<uint1, texType, mode> texRef,
4785  hipTextureObject_t textureObject, float x, float dx,
4786  float dy) {
4787  TEXTURE_PARAMETERS_INIT;
4788  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4789  TEXTURE_RETURN_UINT_X;
4790 }
4791 
4792 template <int texType, enum hipTextureReadMode mode>
4793 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture<uint2, texType, mode> texRef,
4794  hipTextureObject_t textureObject, float x, float dx,
4795  float dy) {
4796  TEXTURE_PARAMETERS_INIT;
4797  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4798  TEXTURE_RETURN_UINT_XY;
4799 }
4800 
4801 template <int texType, enum hipTextureReadMode mode>
4802 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture<uint4, texType, mode> texRef,
4803  hipTextureObject_t textureObject, float x, float dx,
4804  float dy) {
4805  TEXTURE_PARAMETERS_INIT;
4806  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4807  TEXTURE_RETURN_UINT_XYZW;
4808 }
4809 
4810 template <int texType, enum hipTextureReadMode mode>
4811 __TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture<float, texType, mode> texRef,
4812  hipTextureObject_t textureObject, float x, float dx,
4813  float dy) {
4814  TEXTURE_PARAMETERS_INIT;
4815  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4816  TEXTURE_RETURN_FLOAT;
4817 }
4818 
4819 template <int texType, enum hipTextureReadMode mode>
4820 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture<float1, texType, mode> texRef,
4821  hipTextureObject_t textureObject, float x, float dx,
4822  float dy) {
4823  TEXTURE_PARAMETERS_INIT;
4824  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4825  TEXTURE_RETURN_FLOAT_X;
4826 }
4827 
4828 template <int texType, enum hipTextureReadMode mode>
4829 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture<float2, texType, mode> texRef,
4830  hipTextureObject_t textureObject, float x, float dx,
4831  float dy) {
4832  TEXTURE_PARAMETERS_INIT;
4833  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4834  TEXTURE_RETURN_FLOAT_XY;
4835 }
4836 
4837 template <int texType, enum hipTextureReadMode mode>
4838 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture<float4, texType, mode> texRef,
4839  hipTextureObject_t textureObject, float x, float dx,
4840  float dy) {
4841  TEXTURE_PARAMETERS_INIT;
4842  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
4843  TEXTURE_RETURN_FLOAT_XYZW;
4844 }
4845 
4847 
4848 template <int texType, enum hipTextureReadMode mode>
4849 __TEXTURE_FUNCTIONS_DECL__ char tex2D(texture<char, texType, mode> texRef, float x, float y) {
4850  TEXTURE_REF_PARAMETERS_INIT;
4851  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4852  TEXTURE_RETURN_CHAR;
4853 }
4854 
4855 template <int texType, enum hipTextureReadMode mode>
4856 __TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture<char1, texType, mode> texRef, float x, float y) {
4857  TEXTURE_REF_PARAMETERS_INIT;
4858  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4859  TEXTURE_RETURN_CHAR_X;
4860 }
4861 
4862 template <int texType, enum hipTextureReadMode mode>
4863 __TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture<char2, texType, mode> texRef, float x, float y) {
4864  TEXTURE_REF_PARAMETERS_INIT;
4865  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4866  TEXTURE_RETURN_CHAR_XY;
4867 }
4868 
4869 template <int texType, enum hipTextureReadMode mode>
4870 __TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture<char4, texType, mode> texRef, float x, float y) {
4871  TEXTURE_REF_PARAMETERS_INIT;
4872  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4873  TEXTURE_RETURN_CHAR_XYZW;
4874 }
4875 
4876 template <int texType, enum hipTextureReadMode mode>
4877 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture<unsigned char, texType, mode> texRef,
4878  float x, float y) {
4879  TEXTURE_REF_PARAMETERS_INIT;
4880  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4881  TEXTURE_RETURN_UCHAR;
4882 }
4883 
4884 template <int texType, enum hipTextureReadMode mode>
4885 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture<uchar1, texType, mode> texRef, float x, float y) {
4886  TEXTURE_REF_PARAMETERS_INIT;
4887  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4888  TEXTURE_RETURN_UCHAR_X;
4889 }
4890 
4891 template <int texType, enum hipTextureReadMode mode>
4892 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture<uchar2, texType, mode> texRef, float x, float y) {
4893  TEXTURE_REF_PARAMETERS_INIT;
4894  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4895  TEXTURE_RETURN_UCHAR_XY;
4896 }
4897 
4898 template <int texType, enum hipTextureReadMode mode>
4899 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture<uchar4, texType, mode> texRef, float x, float y) {
4900  TEXTURE_REF_PARAMETERS_INIT;
4901  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4902  TEXTURE_RETURN_UCHAR_XYZW;
4903 }
4904 
4905 template <int texType, enum hipTextureReadMode mode>
4906 __TEXTURE_FUNCTIONS_DECL__ short tex2D(texture<short, texType, mode> texRef, float x, float y) {
4907  TEXTURE_REF_PARAMETERS_INIT;
4908  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4909  TEXTURE_RETURN_SHORT;
4910 }
4911 
4912 template <int texType, enum hipTextureReadMode mode>
4913 __TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture<short1, texType, mode> texRef, float x, float y) {
4914  TEXTURE_REF_PARAMETERS_INIT;
4915  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4916  TEXTURE_RETURN_SHORT_X;
4917 }
4918 
4919 template <int texType, enum hipTextureReadMode mode>
4920 __TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture<short2, texType, mode> texRef, float x, float y) {
4921  TEXTURE_REF_PARAMETERS_INIT;
4922  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4923  TEXTURE_RETURN_SHORT_XY;
4924 }
4925 
4926 template <int texType, enum hipTextureReadMode mode>
4927 __TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture<short4, texType, mode> texRef, float x, float y) {
4928  TEXTURE_REF_PARAMETERS_INIT;
4929  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4930  TEXTURE_RETURN_SHORT_XYZW;
4931 }
4932 
4933 template <int texType, enum hipTextureReadMode mode>
4934 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture<unsigned short, texType, mode> texRef,
4935  float x, float y) {
4936  TEXTURE_REF_PARAMETERS_INIT;
4937  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4938  TEXTURE_RETURN_USHORT;
4939 }
4940 
4941 template <int texType, enum hipTextureReadMode mode>
4942 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture<ushort1, texType, mode> texRef, float x, float y) {
4943  TEXTURE_REF_PARAMETERS_INIT;
4944  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4945  TEXTURE_RETURN_USHORT_X;
4946 }
4947 
4948 template <int texType, enum hipTextureReadMode mode>
4949 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture<ushort2, texType, mode> texRef, float x, float y) {
4950  TEXTURE_REF_PARAMETERS_INIT;
4951  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4952  TEXTURE_RETURN_USHORT_XY;
4953 }
4954 
4955 template <int texType, enum hipTextureReadMode mode>
4956 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture<ushort4, texType, mode> texRef, float x, float y) {
4957  TEXTURE_REF_PARAMETERS_INIT;
4958  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4959  TEXTURE_RETURN_USHORT_XYZW;
4960 }
4961 
4962 template <int texType, enum hipTextureReadMode mode>
4963 __TEXTURE_FUNCTIONS_DECL__ int tex2D(texture<int, texType, mode> texRef, float x, float y) {
4964  TEXTURE_REF_PARAMETERS_INIT;
4965  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4966  TEXTURE_RETURN_INT;
4967 }
4968 
4969 template <int texType, enum hipTextureReadMode mode>
4970 __TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture<int1, texType, mode> texRef, float x, float y) {
4971  TEXTURE_REF_PARAMETERS_INIT;
4972  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4973  TEXTURE_RETURN_INT_X;
4974 }
4975 
4976 template <int texType, enum hipTextureReadMode mode>
4977 __TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture<int2, texType, mode> texRef, float x, float y) {
4978  TEXTURE_REF_PARAMETERS_INIT;
4979  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4980  TEXTURE_RETURN_INT_XY;
4981 }
4982 
4983 template <int texType, enum hipTextureReadMode mode>
4984 __TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture<int4, texType, mode> texRef, float x, float y) {
4985  TEXTURE_REF_PARAMETERS_INIT;
4986  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4987  TEXTURE_RETURN_INT_XYZW;
4988 }
4989 
4990 template <int texType, enum hipTextureReadMode mode>
4991 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture<unsigned int, texType, mode> texRef, float x,
4992  float y) {
4993  TEXTURE_REF_PARAMETERS_INIT;
4994  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
4995  TEXTURE_RETURN_UINT;
4996 }
4997 
4998 template <int texType, enum hipTextureReadMode mode>
4999 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture<uint1, texType, mode> texRef, float x, float y) {
5000  TEXTURE_REF_PARAMETERS_INIT;
5001  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5002  TEXTURE_RETURN_UINT_X;
5003 }
5004 
5005 template <int texType, enum hipTextureReadMode mode>
5006 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture<uint2, texType, mode> texRef, float x, float y) {
5007  TEXTURE_REF_PARAMETERS_INIT;
5008  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5009  TEXTURE_RETURN_UINT_XY;
5010 }
5011 
5012 template <int texType, enum hipTextureReadMode mode>
5013 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture<uint4, texType, mode> texRef, float x, float y) {
5014  TEXTURE_REF_PARAMETERS_INIT;
5015  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5016  TEXTURE_RETURN_UINT_XYZW;
5017 }
5018 
5019 
5021 
5022 template <int texType, enum hipTextureReadMode mode>
5023 __TEXTURE_FUNCTIONS_DECL__ char tex2D(texture<char, texType, mode> texRef,
5024  hipTextureObject_t textureObject, float x, float y) {
5025  TEXTURE_PARAMETERS_INIT;
5026  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5027  TEXTURE_RETURN_CHAR;
5028 }
5029 
5030 template <int texType, enum hipTextureReadMode mode>
5031 __TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture<char1, texType, mode> texRef,
5032  hipTextureObject_t textureObject, float x, float y) {
5033  TEXTURE_PARAMETERS_INIT;
5034  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5035  TEXTURE_RETURN_CHAR_X;
5036 }
5037 
5038 template <int texType, enum hipTextureReadMode mode>
5039 __TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture<char2, texType, mode> texRef,
5040  hipTextureObject_t textureObject, float x, float y) {
5041  TEXTURE_PARAMETERS_INIT;
5042  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5043  TEXTURE_RETURN_CHAR_XY;
5044 }
5045 
5046 template <int texType, enum hipTextureReadMode mode>
5047 __TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture<char4, texType, mode> texRef,
5048  hipTextureObject_t textureObject, float x, float y) {
5049  TEXTURE_PARAMETERS_INIT;
5050  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5051  TEXTURE_RETURN_CHAR_XYZW;
5052 }
5053 
5054 template <int texType, enum hipTextureReadMode mode>
5055 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture<unsigned char, texType, mode> texRef,
5056  hipTextureObject_t textureObject, float x, float y) {
5057  TEXTURE_PARAMETERS_INIT;
5058  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5059  TEXTURE_RETURN_UCHAR;
5060 }
5061 
5062 template <int texType, enum hipTextureReadMode mode>
5063 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture<uchar1, texType, mode> texRef,
5064  hipTextureObject_t textureObject, float x, float y) {
5065  TEXTURE_PARAMETERS_INIT;
5066  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5067  TEXTURE_RETURN_UCHAR_X;
5068 }
5069 
5070 template <int texType, enum hipTextureReadMode mode>
5071 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture<uchar2, texType, mode> texRef,
5072  hipTextureObject_t textureObject, float x, float y) {
5073  TEXTURE_PARAMETERS_INIT;
5074  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5075  TEXTURE_RETURN_UCHAR_XY;
5076 }
5077 
5078 template <int texType, enum hipTextureReadMode mode>
5079 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture<uchar4, texType, mode> texRef,
5080  hipTextureObject_t textureObject, float x, float y) {
5081  TEXTURE_PARAMETERS_INIT;
5082  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5083  TEXTURE_RETURN_UCHAR_XYZW;
5084 }
5085 
5086 template <int texType, enum hipTextureReadMode mode>
5087 __TEXTURE_FUNCTIONS_DECL__ short tex2D(texture<short, texType, mode> texRef,
5088  hipTextureObject_t textureObject, float x, float y) {
5089  TEXTURE_PARAMETERS_INIT;
5090  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5091  TEXTURE_RETURN_SHORT;
5092 }
5093 
5094 template <int texType, enum hipTextureReadMode mode>
5095 __TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture<short1, texType, mode> texRef,
5096  hipTextureObject_t textureObject, float x, float y) {
5097  TEXTURE_PARAMETERS_INIT;
5098  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5099  TEXTURE_RETURN_SHORT_X;
5100 }
5101 
5102 template <int texType, enum hipTextureReadMode mode>
5103 __TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture<short2, texType, mode> texRef,
5104  hipTextureObject_t textureObject, float x, float y) {
5105  TEXTURE_PARAMETERS_INIT;
5106  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5107  TEXTURE_RETURN_SHORT_XY;
5108 }
5109 
5110 template <int texType, enum hipTextureReadMode mode>
5111 __TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture<short4, texType, mode> texRef,
5112  hipTextureObject_t textureObject, float x, float y) {
5113  TEXTURE_PARAMETERS_INIT;
5114  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5115  TEXTURE_RETURN_SHORT_XYZW;
5116 }
5117 
5118 template <int texType, enum hipTextureReadMode mode>
5119 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture<unsigned short, texType, mode> texRef,
5120  hipTextureObject_t textureObject, float x,
5121  float y) {
5122  TEXTURE_PARAMETERS_INIT;
5123  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5124  TEXTURE_RETURN_USHORT;
5125 }
5126 
5127 template <int texType, enum hipTextureReadMode mode>
5128 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture<ushort1, texType, mode> texRef,
5129  hipTextureObject_t textureObject, float x, float y) {
5130  TEXTURE_PARAMETERS_INIT;
5131  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5132  TEXTURE_RETURN_USHORT_X;
5133 }
5134 
5135 template <int texType, enum hipTextureReadMode mode>
5136 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture<ushort2, texType, mode> texRef,
5137  hipTextureObject_t textureObject, float x, float y) {
5138  TEXTURE_PARAMETERS_INIT;
5139  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5140  TEXTURE_RETURN_USHORT_XY;
5141 }
5142 
5143 template <int texType, enum hipTextureReadMode mode>
5144 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture<ushort4, texType, mode> texRef,
5145  hipTextureObject_t textureObject, float x, float y) {
5146  TEXTURE_PARAMETERS_INIT;
5147  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5148  TEXTURE_RETURN_USHORT_XYZW;
5149 }
5150 
5151 template <int texType, enum hipTextureReadMode mode>
5152 __TEXTURE_FUNCTIONS_DECL__ int tex2D(texture<int, texType, mode> texRef,
5153  hipTextureObject_t textureObject, float x, float y) {
5154  TEXTURE_PARAMETERS_INIT;
5155  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5156  TEXTURE_RETURN_INT;
5157 }
5158 
5159 template <int texType, enum hipTextureReadMode mode>
5160 __TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture<int1, texType, mode> texRef,
5161  hipTextureObject_t textureObject, float x, float y) {
5162  TEXTURE_PARAMETERS_INIT;
5163  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5164  TEXTURE_RETURN_INT_X;
5165 }
5166 
5167 template <int texType, enum hipTextureReadMode mode>
5168 __TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture<int2, texType, mode> texRef,
5169  hipTextureObject_t textureObject, float x, float y) {
5170  TEXTURE_PARAMETERS_INIT;
5171  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5172  TEXTURE_RETURN_INT_XY;
5173 }
5174 
5175 template <int texType, enum hipTextureReadMode mode>
5176 __TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture<int4, texType, mode> texRef,
5177  hipTextureObject_t textureObject, float x, float y) {
5178  TEXTURE_PARAMETERS_INIT;
5179  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5180  TEXTURE_RETURN_INT_XYZW;
5181 }
5182 
5183 template <int texType, enum hipTextureReadMode mode>
5184 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture<unsigned int, texType, mode> texRef,
5185  hipTextureObject_t textureObject, float x, float y) {
5186  TEXTURE_PARAMETERS_INIT;
5187  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5188  TEXTURE_RETURN_UINT;
5189 }
5190 
5191 template <int texType, enum hipTextureReadMode mode>
5192 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture<uint1, texType, mode> texRef,
5193  hipTextureObject_t textureObject, float x, float y) {
5194  TEXTURE_PARAMETERS_INIT;
5195  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5196  TEXTURE_RETURN_UINT_X;
5197 }
5198 
5199 template <int texType, enum hipTextureReadMode mode>
5200 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture<uint2, texType, mode> texRef,
5201  hipTextureObject_t textureObject, float x, float y) {
5202  TEXTURE_PARAMETERS_INIT;
5203  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5204  TEXTURE_RETURN_UINT_XY;
5205 }
5206 
5207 template <int texType, enum hipTextureReadMode mode>
5208 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture<uint4, texType, mode> texRef,
5209  hipTextureObject_t textureObject, float x, float y) {
5210  TEXTURE_PARAMETERS_INIT;
5211  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5212  TEXTURE_RETURN_UINT_XYZW;
5213 }
5214 
5215 template <int texType, enum hipTextureReadMode mode>
5216 __TEXTURE_FUNCTIONS_DECL__ float tex2D(texture<float, texType, mode> texRef,
5217  hipTextureObject_t textureObject, float x, float y) {
5218  TEXTURE_PARAMETERS_INIT;
5219  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5220  TEXTURE_RETURN_FLOAT;
5221 }
5222 
5223 template <int texType, enum hipTextureReadMode mode>
5224 __TEXTURE_FUNCTIONS_DECL__ float tex2D(texture<float, texType, mode> texRef, float x, float y) {
5225  TEXTURE_REF_PARAMETERS_INIT;
5226  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5227  TEXTURE_RETURN_FLOAT;
5228 }
5229 
5230 template <int texType, enum hipTextureReadMode mode>
5231 __TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture<float1, texType, mode> texRef, float x, float y) {
5232  TEXTURE_REF_PARAMETERS_INIT;
5233  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5234  TEXTURE_RETURN_FLOAT_X;
5235 }
5236 
5237 template <int texType, enum hipTextureReadMode mode>
5238 __TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture<float1, texType, mode> texRef,
5239  hipTextureObject_t textureObject, float x, float y) {
5240  TEXTURE_PARAMETERS_INIT;
5241  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5242  TEXTURE_RETURN_FLOAT_X;
5243 }
5244 
5245 template <int texType, enum hipTextureReadMode mode>
5246 __TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture<float2, texType, mode> texRef, float x, float y) {
5247  TEXTURE_REF_PARAMETERS_INIT;
5248  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5249  TEXTURE_RETURN_FLOAT_XY;
5250 }
5251 
5252 template <int texType, enum hipTextureReadMode mode>
5253 __TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture<float2, texType, mode> texRef,
5254  hipTextureObject_t textureObject, float x, float y) {
5255  TEXTURE_PARAMETERS_INIT;
5256  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5257  TEXTURE_RETURN_FLOAT_XY;
5258 }
5259 
5260 template <int texType, enum hipTextureReadMode mode>
5261 __TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture<float4, texType, mode> texRef, float x, float y) {
5262  TEXTURE_REF_PARAMETERS_INIT;
5263  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5264  TEXTURE_RETURN_FLOAT_XYZW;
5265 }
5266 
5267 template <int texType, enum hipTextureReadMode mode>
5268 __TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture<float4, texType, mode> texRef,
5269  hipTextureObject_t textureObject, float x, float y) {
5270  TEXTURE_PARAMETERS_INIT;
5271  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
5272  TEXTURE_RETURN_FLOAT_XYZW;
5273 }
5274 
5276 
5277 template <int texType, enum hipTextureReadMode mode>
5278 __TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture<char, texType, mode> texRef, float x, float y,
5279  float level) {
5280  TEXTURE_REF_PARAMETERS_INIT;
5281  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5282  TEXTURE_RETURN_CHAR;
5283 }
5284 
5285 template <int texType, enum hipTextureReadMode mode>
5286 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture<char1, texType, mode> texRef, float x, float y,
5287  float level) {
5288  TEXTURE_REF_PARAMETERS_INIT;
5289  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5290  TEXTURE_RETURN_CHAR_X;
5291 }
5292 
5293 template <int texType, enum hipTextureReadMode mode>
5294 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture<char2, texType, mode> texRef, float x, float y,
5295  float level) {
5296  TEXTURE_REF_PARAMETERS_INIT;
5297  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5298  TEXTURE_RETURN_CHAR_XY;
5299 }
5300 
5301 template <int texType, enum hipTextureReadMode mode>
5302 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture<char4, texType, mode> texRef, float x, float y,
5303  float level) {
5304  TEXTURE_REF_PARAMETERS_INIT;
5305  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5306  TEXTURE_RETURN_CHAR_XYZW;
5307 }
5308 
5309 template <int texType, enum hipTextureReadMode mode>
5310 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture<unsigned char, texType, mode> texRef,
5311  float x, float y, float level) {
5312  TEXTURE_REF_PARAMETERS_INIT;
5313  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5314  TEXTURE_RETURN_UCHAR;
5315 }
5316 
5317 template <int texType, enum hipTextureReadMode mode>
5318 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture<uchar1, texType, mode> texRef, float x, float y,
5319  float level) {
5320  TEXTURE_REF_PARAMETERS_INIT;
5321  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5322  TEXTURE_RETURN_UCHAR_X;
5323 }
5324 
5325 template <int texType, enum hipTextureReadMode mode>
5326 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture<uchar2, texType, mode> texRef, float x, float y,
5327  float level) {
5328  TEXTURE_REF_PARAMETERS_INIT;
5329  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5330  TEXTURE_RETURN_UCHAR_XY;
5331 }
5332 
5333 template <int texType, enum hipTextureReadMode mode>
5334 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture<uchar4, texType, mode> texRef, float x, float y,
5335  float level) {
5336  TEXTURE_REF_PARAMETERS_INIT;
5337  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5338  TEXTURE_RETURN_UCHAR_XYZW;
5339 }
5340 
5341 template <int texType, enum hipTextureReadMode mode>
5342 __TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture<short, texType, mode> texRef, float x, float y,
5343  float level) {
5344  TEXTURE_REF_PARAMETERS_INIT;
5345  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5346  TEXTURE_RETURN_SHORT;
5347 }
5348 
5349 template <int texType, enum hipTextureReadMode mode>
5350 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture<short1, texType, mode> texRef, float x, float y,
5351  float level) {
5352  TEXTURE_REF_PARAMETERS_INIT;
5353  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5354  TEXTURE_RETURN_SHORT_X;
5355 }
5356 
5357 template <int texType, enum hipTextureReadMode mode>
5358 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture<short2, texType, mode> texRef, float x, float y,
5359  float level) {
5360  TEXTURE_REF_PARAMETERS_INIT;
5361  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5362  TEXTURE_RETURN_SHORT_XY;
5363 }
5364 
5365 template <int texType, enum hipTextureReadMode mode>
5366 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture<short4, texType, mode> texRef, float x, float y,
5367  float level) {
5368  TEXTURE_REF_PARAMETERS_INIT;
5369  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5370  TEXTURE_RETURN_SHORT_XYZW;
5371 }
5372 
5373 template <int texType, enum hipTextureReadMode mode>
5374 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture<unsigned short, texType, mode> texRef,
5375  float x, float y, float level) {
5376  TEXTURE_REF_PARAMETERS_INIT;
5377  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5378  TEXTURE_RETURN_USHORT;
5379 }
5380 
5381 template <int texType, enum hipTextureReadMode mode>
5382 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture<ushort1, texType, mode> texRef, float x,
5383  float y, float level) {
5384  TEXTURE_REF_PARAMETERS_INIT;
5385  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5386  TEXTURE_RETURN_USHORT_X;
5387 }
5388 
5389 template <int texType, enum hipTextureReadMode mode>
5390 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture<ushort2, texType, mode> texRef, float x,
5391  float y, float level) {
5392  TEXTURE_REF_PARAMETERS_INIT;
5393  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5394  TEXTURE_RETURN_USHORT_XY;
5395 }
5396 
5397 template <int texType, enum hipTextureReadMode mode>
5398 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture<ushort4, texType, mode> texRef, float x,
5399  float y, float level) {
5400  TEXTURE_REF_PARAMETERS_INIT;
5401  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5402  TEXTURE_RETURN_USHORT_XYZW;
5403 }
5404 
5405 template <int texType, enum hipTextureReadMode mode>
5406 __TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture<int, texType, mode> texRef, float x, float y,
5407  float level) {
5408  TEXTURE_REF_PARAMETERS_INIT;
5409  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5410  TEXTURE_RETURN_INT;
5411 }
5412 
5413 template <int texType, enum hipTextureReadMode mode>
5414 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture<int1, texType, mode> texRef, float x, float y,
5415  float level) {
5416  TEXTURE_REF_PARAMETERS_INIT;
5417  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5418  TEXTURE_RETURN_INT_X;
5419 }
5420 
5421 template <int texType, enum hipTextureReadMode mode>
5422 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture<int2, texType, mode> texRef, float x, float y,
5423  float level) {
5424  TEXTURE_REF_PARAMETERS_INIT;
5425  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5426  TEXTURE_RETURN_INT_XY;
5427 }
5428 
5429 template <int texType, enum hipTextureReadMode mode>
5430 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture<int4, texType, mode> texRef, float x, float y,
5431  float level) {
5432  TEXTURE_REF_PARAMETERS_INIT;
5433  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5434  TEXTURE_RETURN_INT_XYZW;
5435 }
5436 
5437 template <int texType, enum hipTextureReadMode mode>
5438 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture<unsigned int, texType, mode> texRef,
5439  float x, float y, float level) {
5440  TEXTURE_REF_PARAMETERS_INIT;
5441  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5442  TEXTURE_RETURN_UINT;
5443 }
5444 
5445 template <int texType, enum hipTextureReadMode mode>
5446 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture<uint1, texType, mode> texRef, float x, float y,
5447  float level) {
5448  TEXTURE_REF_PARAMETERS_INIT;
5449  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5450  TEXTURE_RETURN_UINT_X;
5451 }
5452 
5453 template <int texType, enum hipTextureReadMode mode>
5454 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture<uint2, texType, mode> texRef, float x, float y,
5455  float level) {
5456  TEXTURE_REF_PARAMETERS_INIT;
5457  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5458  TEXTURE_RETURN_UINT_XY;
5459 }
5460 
5461 template <int texType, enum hipTextureReadMode mode>
5462 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture<uint4, texType, mode> texRef, float x, float y,
5463  float level) {
5464  TEXTURE_REF_PARAMETERS_INIT;
5465  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5466  TEXTURE_RETURN_UINT_XYZW;
5467 }
5468 
5469 template <int texType, enum hipTextureReadMode mode>
5470 __TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture<float, texType, mode> texRef, float x, float y,
5471  float level) {
5472  TEXTURE_REF_PARAMETERS_INIT;
5473  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5474  TEXTURE_RETURN_FLOAT;
5475 }
5476 
5477 template <int texType, enum hipTextureReadMode mode>
5478 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture<float1, texType, mode> texRef, float x, float y,
5479  float level) {
5480  TEXTURE_REF_PARAMETERS_INIT;
5481  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5482  TEXTURE_RETURN_FLOAT_X;
5483 }
5484 
5485 template <int texType, enum hipTextureReadMode mode>
5486 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture<float2, texType, mode> texRef, float x, float y,
5487  float level) {
5488  TEXTURE_REF_PARAMETERS_INIT;
5489  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5490  TEXTURE_RETURN_FLOAT_XY;
5491 }
5492 
5493 template <int texType, enum hipTextureReadMode mode>
5494 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture<float4, texType, mode> texRef, float x, float y,
5495  float level) {
5496  TEXTURE_REF_PARAMETERS_INIT;
5497  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5498  TEXTURE_RETURN_FLOAT_XYZW;
5499 }
5500 
5502 
5503 template <int texType, enum hipTextureReadMode mode>
5504 __TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture<char, texType, mode> texRef,
5505  hipTextureObject_t textureObject, float x, float y,
5506  float level) {
5507  TEXTURE_PARAMETERS_INIT;
5508  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5509  TEXTURE_RETURN_CHAR;
5510 }
5511 
5512 template <int texType, enum hipTextureReadMode mode>
5513 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture<char1, texType, mode> texRef,
5514  hipTextureObject_t textureObject, float x, float y,
5515  float level) {
5516  TEXTURE_PARAMETERS_INIT;
5517  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5518  TEXTURE_RETURN_CHAR_X;
5519 }
5520 
5521 template <int texType, enum hipTextureReadMode mode>
5522 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture<char2, texType, mode> texRef,
5523  hipTextureObject_t textureObject, float x, float y,
5524  float level) {
5525  TEXTURE_PARAMETERS_INIT;
5526  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5527  TEXTURE_RETURN_CHAR_XY;
5528 }
5529 
5530 template <int texType, enum hipTextureReadMode mode>
5531 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture<char4, texType, mode> texRef,
5532  hipTextureObject_t textureObject, float x, float y,
5533  float level) {
5534  TEXTURE_PARAMETERS_INIT;
5535  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5536  TEXTURE_RETURN_CHAR_XYZW;
5537 }
5538 
5539 template <int texType, enum hipTextureReadMode mode>
5540 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture<unsigned char, texType, mode> texRef,
5541  hipTextureObject_t textureObject, float x,
5542  float y, float level) {
5543  TEXTURE_PARAMETERS_INIT;
5544  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5545  TEXTURE_RETURN_UCHAR;
5546 }
5547 
5548 template <int texType, enum hipTextureReadMode mode>
5549 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture<uchar1, texType, mode> texRef,
5550  hipTextureObject_t textureObject, float x, float y,
5551  float level) {
5552  TEXTURE_PARAMETERS_INIT;
5553  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5554  TEXTURE_RETURN_UCHAR_X;
5555 }
5556 
5557 template <int texType, enum hipTextureReadMode mode>
5558 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture<uchar2, texType, mode> texRef,
5559  hipTextureObject_t textureObject, float x, float y,
5560  float level) {
5561  TEXTURE_PARAMETERS_INIT;
5562  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5563  TEXTURE_RETURN_UCHAR_XY;
5564 }
5565 
5566 template <int texType, enum hipTextureReadMode mode>
5567 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture<uchar4, texType, mode> texRef,
5568  hipTextureObject_t textureObject, float x, float y,
5569  float level) {
5570  TEXTURE_PARAMETERS_INIT;
5571  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5572  TEXTURE_RETURN_UCHAR_XYZW;
5573 }
5574 
5575 template <int texType, enum hipTextureReadMode mode>
5576 __TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture<short, texType, mode> texRef,
5577  hipTextureObject_t textureObject, float x, float y,
5578  float level) {
5579  TEXTURE_PARAMETERS_INIT;
5580  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5581  TEXTURE_RETURN_SHORT;
5582 }
5583 
5584 template <int texType, enum hipTextureReadMode mode>
5585 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture<short1, texType, mode> texRef,
5586  hipTextureObject_t textureObject, float x, float y,
5587  float level) {
5588  TEXTURE_PARAMETERS_INIT;
5589  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5590  TEXTURE_RETURN_SHORT_X;
5591 }
5592 
5593 template <int texType, enum hipTextureReadMode mode>
5594 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture<short2, texType, mode> texRef,
5595  hipTextureObject_t textureObject, float x, float y,
5596  float level) {
5597  TEXTURE_PARAMETERS_INIT;
5598  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5599  TEXTURE_RETURN_SHORT_XY;
5600 }
5601 
5602 template <int texType, enum hipTextureReadMode mode>
5603 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture<short4, texType, mode> texRef,
5604  hipTextureObject_t textureObject, float x, float y,
5605  float level) {
5606  TEXTURE_PARAMETERS_INIT;
5607  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5608  TEXTURE_RETURN_SHORT_XYZW;
5609 }
5610 
5611 template <int texType, enum hipTextureReadMode mode>
5612 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture<unsigned short, texType, mode> texRef,
5613  hipTextureObject_t textureObject, float x,
5614  float y, float level) {
5615  TEXTURE_PARAMETERS_INIT;
5616  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5617  TEXTURE_RETURN_USHORT;
5618 }
5619 
5620 template <int texType, enum hipTextureReadMode mode>
5621 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture<ushort1, texType, mode> texRef,
5622  hipTextureObject_t textureObject, float x, float y,
5623  float level) {
5624  TEXTURE_PARAMETERS_INIT;
5625  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5626  TEXTURE_RETURN_USHORT_X;
5627 }
5628 
5629 template <int texType, enum hipTextureReadMode mode>
5630 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture<ushort2, texType, mode> texRef,
5631  hipTextureObject_t textureObject, float x, float y,
5632  float level) {
5633  TEXTURE_PARAMETERS_INIT;
5634  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5635  TEXTURE_RETURN_USHORT_XY;
5636 }
5637 
5638 template <int texType, enum hipTextureReadMode mode>
5639 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture<ushort4, texType, mode> texRef,
5640  hipTextureObject_t textureObject, float x, float y,
5641  float level) {
5642  TEXTURE_PARAMETERS_INIT;
5643  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5644  TEXTURE_RETURN_USHORT_XYZW;
5645 }
5646 
5647 template <int texType, enum hipTextureReadMode mode>
5648 __TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture<int, texType, mode> texRef,
5649  hipTextureObject_t textureObject, float x, float y,
5650  float level) {
5651  TEXTURE_PARAMETERS_INIT;
5652  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5653  TEXTURE_RETURN_INT;
5654 }
5655 
5656 template <int texType, enum hipTextureReadMode mode>
5657 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture<int1, texType, mode> texRef,
5658  hipTextureObject_t textureObject, float x, float y,
5659  float level) {
5660  TEXTURE_PARAMETERS_INIT;
5661  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5662  TEXTURE_RETURN_INT_X;
5663 }
5664 
5665 template <int texType, enum hipTextureReadMode mode>
5666 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture<int2, texType, mode> texRef,
5667  hipTextureObject_t textureObject, float x, float y,
5668  float level) {
5669  TEXTURE_PARAMETERS_INIT;
5670  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5671  TEXTURE_RETURN_INT_XY;
5672 }
5673 
5674 template <int texType, enum hipTextureReadMode mode>
5675 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture<int4, texType, mode> texRef,
5676  hipTextureObject_t textureObject, float x, float y,
5677  float level) {
5678  TEXTURE_PARAMETERS_INIT;
5679  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5680  TEXTURE_RETURN_INT_XYZW;
5681 }
5682 
5683 template <int texType, enum hipTextureReadMode mode>
5684 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture<unsigned int, texType, mode> texRef,
5685  hipTextureObject_t textureObject, float x, float y,
5686  float level) {
5687  TEXTURE_PARAMETERS_INIT;
5688  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5689  TEXTURE_RETURN_UINT;
5690 }
5691 
5692 template <int texType, enum hipTextureReadMode mode>
5693 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture<uint1, texType, mode> texRef,
5694  hipTextureObject_t textureObject, float x, float y,
5695  float level) {
5696  TEXTURE_PARAMETERS_INIT;
5697  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5698  TEXTURE_RETURN_UINT_X;
5699 }
5700 
5701 template <int texType, enum hipTextureReadMode mode>
5702 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture<uint2, texType, mode> texRef,
5703  hipTextureObject_t textureObject, float x, float y,
5704  float level) {
5705  TEXTURE_PARAMETERS_INIT;
5706  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5707  TEXTURE_RETURN_UINT_XY;
5708 }
5709 
5710 template <int texType, enum hipTextureReadMode mode>
5711 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture<uint4, texType, mode> texRef,
5712  hipTextureObject_t textureObject, float x, float y,
5713  float level) {
5714  TEXTURE_PARAMETERS_INIT;
5715  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5716  TEXTURE_RETURN_UINT_XYZW;
5717 }
5718 
5719 template <int texType, enum hipTextureReadMode mode>
5720 __TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture<float, texType, mode> texRef,
5721  hipTextureObject_t textureObject, float x, float y,
5722  float level) {
5723  TEXTURE_PARAMETERS_INIT;
5724  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5725  TEXTURE_RETURN_FLOAT;
5726 }
5727 
5728 template <int texType, enum hipTextureReadMode mode>
5729 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture<float1, texType, mode> texRef,
5730  hipTextureObject_t textureObject, float x, float y,
5731  float level) {
5732  TEXTURE_PARAMETERS_INIT;
5733  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5734  TEXTURE_RETURN_FLOAT_X;
5735 }
5736 
5737 template <int texType, enum hipTextureReadMode mode>
5738 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture<float2, texType, mode> texRef,
5739  hipTextureObject_t textureObject, float x, float y,
5740  float level) {
5741  TEXTURE_PARAMETERS_INIT;
5742  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5743  TEXTURE_RETURN_FLOAT_XY;
5744 }
5745 
5746 template <int texType, enum hipTextureReadMode mode>
5747 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture<float4, texType, mode> texRef,
5748  hipTextureObject_t textureObject, float x, float y,
5749  float level) {
5750  TEXTURE_PARAMETERS_INIT;
5751  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
5752  TEXTURE_RETURN_FLOAT_XYZW;
5753 }
5754 
5756 
5757 template <int texType, enum hipTextureReadMode mode>
5758 __TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture<char, texType, mode> texRef, float x, float y,
5759  float2 dx, float2 dy) {
5760  TEXTURE_REF_PARAMETERS_INIT;
5761  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5762  float2(dx.x, dx.y).data,
5763  float2(dy.x, dy.y).data);
5764  TEXTURE_RETURN_CHAR;
5765 }
5766 
5767 template <int texType, enum hipTextureReadMode mode>
5768 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture<char1, texType, mode> texRef, float x, float y,
5769  float2 dx, float2 dy) {
5770  TEXTURE_REF_PARAMETERS_INIT;
5771  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5772  float2(dx.x, dx.y).data,
5773  float2(dy.x, dy.y).data);
5774  TEXTURE_RETURN_CHAR_X;
5775 }
5776 
5777 template <int texType, enum hipTextureReadMode mode>
5778 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture<char2, texType, mode> texRef, float x, float y,
5779  float2 dx, float2 dy) {
5780  TEXTURE_REF_PARAMETERS_INIT;
5781  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5782  float2(dx.x, dx.y).data,
5783  float2(dy.x, dy.y).data);
5784  TEXTURE_RETURN_CHAR_XY;
5785 }
5786 
5787 template <int texType, enum hipTextureReadMode mode>
5788 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture<char4, texType, mode> texRef, float x, float y,
5789  float2 dx, float2 dy) {
5790  TEXTURE_REF_PARAMETERS_INIT;
5791  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5792  float2(dx.x, dx.y).data,
5793  float2(dy.x, dy.y).data);
5794  TEXTURE_RETURN_CHAR_XYZW;
5795 }
5796 
5797 template <int texType, enum hipTextureReadMode mode>
5798 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture<unsigned char, texType, mode> texRef,
5799  float x, float y, float2 dx, float2 dy) {
5800  TEXTURE_REF_PARAMETERS_INIT;
5801  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5802  float2(dx.x, dx.y).data,
5803  float2(dy.x, dy.y).data);
5804  TEXTURE_RETURN_UCHAR;
5805 }
5806 
5807 template <int texType, enum hipTextureReadMode mode>
5808 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture<uchar1, texType, mode> texRef, float x, float y,
5809  float2 dx, float2 dy) {
5810  TEXTURE_REF_PARAMETERS_INIT;
5811  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5812  float2(dx.x, dx.y).data,
5813  float2(dy.x, dy.y).data);
5814  TEXTURE_RETURN_UCHAR_X;
5815 }
5816 
5817 template <int texType, enum hipTextureReadMode mode>
5818 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture<uchar2, texType, mode> texRef, float x, float y,
5819  float2 dx, float2 dy) {
5820  TEXTURE_REF_PARAMETERS_INIT;
5821  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5822  float2(dx.x, dx.y).data,
5823  float2(dy.x, dy.y).data);
5824  TEXTURE_RETURN_UCHAR_XY;
5825 }
5826 
5827 template <int texType, enum hipTextureReadMode mode>
5828 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture<uchar4, texType, mode> texRef, float x, float y,
5829  float2 dx, float2 dy) {
5830  TEXTURE_REF_PARAMETERS_INIT;
5831  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5832  float2(dx.x, dx.y).data,
5833  float2(dy.x, dy.y).data);
5834  TEXTURE_RETURN_UCHAR_XYZW;
5835 }
5836 
5837 template <int texType, enum hipTextureReadMode mode>
5838 __TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture<short, texType, mode> texRef, float x, float y,
5839  float2 dx, float2 dy) {
5840  TEXTURE_REF_PARAMETERS_INIT;
5841  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5842  float2(dx.x, dx.y).data,
5843  float2(dy.x, dy.y).data);
5844  TEXTURE_RETURN_SHORT;
5845 }
5846 
5847 template <int texType, enum hipTextureReadMode mode>
5848 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture<short1, texType, mode> texRef, float x, float y,
5849  float2 dx, float2 dy) {
5850  TEXTURE_REF_PARAMETERS_INIT;
5851  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5852  float2(dx.x, dx.y).data,
5853  float2(dy.x, dy.y).data);
5854  TEXTURE_RETURN_SHORT_X;
5855 }
5856 
5857 template <int texType, enum hipTextureReadMode mode>
5858 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture<short2, texType, mode> texRef, float x, float y,
5859  float2 dx, float2 dy) {
5860  TEXTURE_REF_PARAMETERS_INIT;
5861  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5862  float2(dx.x, dx.y).data,
5863  float2(dy.x, dy.y).data);
5864  TEXTURE_RETURN_SHORT_XY;
5865 }
5866 
5867 template <int texType, enum hipTextureReadMode mode>
5868 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture<short4, texType, mode> texRef, float x, float y,
5869  float2 dx, float2 dy) {
5870  TEXTURE_REF_PARAMETERS_INIT;
5871  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5872  float2(dx.x, dx.y).data,
5873  float2(dy.x, dy.y).data);
5874  TEXTURE_RETURN_SHORT_XYZW;
5875 }
5876 
5877 template <int texType, enum hipTextureReadMode mode>
5878 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture<unsigned short, texType, mode> texRef,
5879  float x, float y, float2 dx, float2 dy) {
5880  TEXTURE_REF_PARAMETERS_INIT;
5881  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5882  float2(dx.x, dx.y).data,
5883  float2(dy.x, dy.y).data);
5884  TEXTURE_RETURN_USHORT;
5885 }
5886 
5887 template <int texType, enum hipTextureReadMode mode>
5888 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture<ushort1, texType, mode> texRef, float x,
5889  float y, float2 dx, float2 dy) {
5890  TEXTURE_REF_PARAMETERS_INIT;
5891  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5892  float2(dx.x, dx.y).data,
5893  float2(dy.x, dy.y).data);
5894  TEXTURE_RETURN_USHORT_X;
5895 }
5896 
5897 template <int texType, enum hipTextureReadMode mode>
5898 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture<ushort2, texType, mode> texRef, float x,
5899  float y, float2 dx, float2 dy) {
5900  TEXTURE_REF_PARAMETERS_INIT;
5901  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5902  float2(dx.x, dx.y).data,
5903  float2(dy.x, dy.y).data);
5904  TEXTURE_RETURN_USHORT_XY;
5905 }
5906 
5907 template <int texType, enum hipTextureReadMode mode>
5908 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture<ushort4, texType, mode> texRef, float x,
5909  float y, float2 dx, float2 dy) {
5910  TEXTURE_REF_PARAMETERS_INIT;
5911  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5912  float2(dx.x, dx.y).data,
5913  float2(dy.x, dy.y).data);
5914  TEXTURE_RETURN_USHORT_XYZW;
5915 }
5916 
5917 template <int texType, enum hipTextureReadMode mode>
5918 __TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture<int, texType, mode> texRef, float x, float y,
5919  float2 dx, float2 dy) {
5920  TEXTURE_REF_PARAMETERS_INIT;
5921  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5922  float2(dx.x, dx.y).data,
5923  float2(dy.x, dy.y).data);
5924  TEXTURE_RETURN_INT;
5925 }
5926 
5927 template <int texType, enum hipTextureReadMode mode>
5928 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture<int1, texType, mode> texRef, float x, float y,
5929  float2 dx, float2 dy) {
5930  TEXTURE_REF_PARAMETERS_INIT;
5931  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5932  float2(dx.x, dx.y).data,
5933  float2(dy.x, dy.y).data);
5934  TEXTURE_RETURN_INT_X;
5935 }
5936 
5937 template <int texType, enum hipTextureReadMode mode>
5938 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture<int2, texType, mode> texRef, float x, float y,
5939  float2 dx, float2 dy) {
5940  TEXTURE_REF_PARAMETERS_INIT;
5941  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5942  float2(dx.x, dx.y).data,
5943  float2(dy.x, dy.y).data);
5944  TEXTURE_RETURN_INT_XY;
5945 }
5946 
5947 template <int texType, enum hipTextureReadMode mode>
5948 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture<int4, texType, mode> texRef, float x, float y,
5949  float2 dx, float2 dy) {
5950  TEXTURE_REF_PARAMETERS_INIT;
5951  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5952  float2(dx.x, dx.y).data,
5953  float2(dy.x, dy.y).data);
5954  TEXTURE_RETURN_INT_XYZW;
5955 }
5956 
5957 template <int texType, enum hipTextureReadMode mode>
5958 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture<unsigned int, texType, mode> texRef,
5959  float x, float y, float2 dx, float2 dy) {
5960  TEXTURE_REF_PARAMETERS_INIT;
5961  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5962  float2(dx.x, dx.y).data,
5963  float2(dy.x, dy.y).data);
5964  TEXTURE_RETURN_UINT;
5965 }
5966 
5967 template <int texType, enum hipTextureReadMode mode>
5968 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture<uint1, texType, mode> texRef, float x, float y,
5969  float2 dx, float2 dy) {
5970  TEXTURE_REF_PARAMETERS_INIT;
5971  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5972  float2(dx.x, dx.y).data,
5973  float2(dy.x, dy.y).data);
5974  TEXTURE_RETURN_UINT_X;
5975 }
5976 
5977 template <int texType, enum hipTextureReadMode mode>
5978 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture<uint2, texType, mode> texRef, float x, float y,
5979  float2 dx, float2 dy) {
5980  TEXTURE_REF_PARAMETERS_INIT;
5981  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5982  float2(dx.x, dx.y).data,
5983  float2(dy.x, dy.y).data);
5984  TEXTURE_RETURN_UINT_XY;
5985 }
5986 
5987 template <int texType, enum hipTextureReadMode mode>
5988 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture<uint4, texType, mode> texRef, float x, float y,
5989  float2 dx, float2 dy) {
5990  TEXTURE_REF_PARAMETERS_INIT;
5991  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
5992  float2(dx.x, dx.y).data,
5993  float2(dy.x, dy.y).data);
5994  TEXTURE_RETURN_UINT_XYZW;
5995 }
5996 
5997 template <int texType, enum hipTextureReadMode mode>
5998 __TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture<float, texType, mode> texRef, float x, float y,
5999  float2 dx, float2 dy) {
6000  TEXTURE_REF_PARAMETERS_INIT;
6001  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6002  float2(dx.x, dx.y).data,
6003  float2(dy.x, dy.y).data);
6004  TEXTURE_RETURN_FLOAT;
6005 }
6006 
6007 template <int texType, enum hipTextureReadMode mode>
6008 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture<float1, texType, mode> texRef, float x, float y,
6009  float2 dx, float2 dy) {
6010  TEXTURE_REF_PARAMETERS_INIT;
6011  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6012  float2(dx.x, dx.y).data,
6013  float2(dy.x, dy.y).data);
6014  TEXTURE_RETURN_FLOAT_X;
6015 }
6016 
6017 template <int texType, enum hipTextureReadMode mode>
6018 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture<float2, texType, mode> texRef, float x, float y,
6019  float2 dx, float2 dy) {
6020  TEXTURE_REF_PARAMETERS_INIT;
6021  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6022  float2(dx.x, dx.y).data,
6023  float2(dy.x, dy.y).data);
6024  TEXTURE_RETURN_FLOAT_XY;
6025 }
6026 
6027 template <int texType, enum hipTextureReadMode mode>
6028 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture<float4, texType, mode> texRef, float x, float y,
6029  float2 dx, float2 dy) {
6030  TEXTURE_REF_PARAMETERS_INIT;
6031  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6032  float2(dx.x, dx.y).data,
6033  float2(dy.x, dy.y).data);
6034  TEXTURE_RETURN_FLOAT_XYZW;
6035 }
6036 
6038 
6039 template <int texType, enum hipTextureReadMode mode>
6040 __TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture<char, texType, mode> texRef,
6041  hipTextureObject_t textureObject, float x, float y,
6042  float2 dx, float2 dy) {
6043  TEXTURE_PARAMETERS_INIT;
6044  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6045  float2(dx.x, dx.y).data,
6046  float2(dy.x, dy.y).data);
6047  TEXTURE_RETURN_CHAR;
6048 }
6049 
6050 template <int texType, enum hipTextureReadMode mode>
6051 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture<char1, texType, mode> texRef,
6052  hipTextureObject_t textureObject, float x, float y,
6053  float2 dx, float2 dy) {
6054  TEXTURE_PARAMETERS_INIT;
6055  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6056  float2(dx.x, dx.y).data,
6057  float2(dy.x, dy.y).data);
6058  TEXTURE_RETURN_CHAR_X;
6059 }
6060 
6061 template <int texType, enum hipTextureReadMode mode>
6062 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture<char2, texType, mode> texRef,
6063  hipTextureObject_t textureObject, float x, float y,
6064  float2 dx, float2 dy) {
6065  TEXTURE_PARAMETERS_INIT;
6066  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6067  float2(dx.x, dx.y).data,
6068  float2(dy.x, dy.y).data);
6069  TEXTURE_RETURN_CHAR_XY;
6070 }
6071 
6072 template <int texType, enum hipTextureReadMode mode>
6073 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture<char4, texType, mode> texRef,
6074  hipTextureObject_t textureObject, float x, float y,
6075  float2 dx, float2 dy) {
6076  TEXTURE_PARAMETERS_INIT;
6077  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6078  float2(dx.x, dx.y).data,
6079  float2(dy.x, dy.y).data);
6080  TEXTURE_RETURN_CHAR_XYZW;
6081 }
6082 
6083 template <int texType, enum hipTextureReadMode mode>
6084 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture<unsigned char, texType, mode> texRef,
6085  hipTextureObject_t textureObject, float x,
6086  float y, float2 dx, float2 dy) {
6087  TEXTURE_PARAMETERS_INIT;
6088  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6089  float2(dx.x, dx.y).data,
6090  float2(dy.x, dy.y).data);
6091  TEXTURE_RETURN_UCHAR;
6092 }
6093 
6094 template <int texType, enum hipTextureReadMode mode>
6095 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture<uchar1, texType, mode> texRef,
6096  hipTextureObject_t textureObject, float x, float y,
6097  float2 dx, float2 dy) {
6098  TEXTURE_PARAMETERS_INIT;
6099  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6100  float2(dx.x, dx.y).data,
6101  float2(dy.x, dy.y).data);
6102  TEXTURE_RETURN_UCHAR_X;
6103 }
6104 
6105 template <int texType, enum hipTextureReadMode mode>
6106 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture<uchar2, texType, mode> texRef,
6107  hipTextureObject_t textureObject, float x, float y,
6108  float2 dx, float2 dy) {
6109  TEXTURE_PARAMETERS_INIT;
6110  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6111  float2(dx.x, dx.y).data,
6112  float2(dy.x, dy.y).data);
6113  TEXTURE_RETURN_UCHAR_XY;
6114 }
6115 
6116 template <int texType, enum hipTextureReadMode mode>
6117 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture<uchar4, texType, mode> texRef,
6118  hipTextureObject_t textureObject, float x, float y,
6119  float2 dx, float2 dy) {
6120  TEXTURE_PARAMETERS_INIT;
6121  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6122  float2(dx.x, dx.y).data,
6123  float2(dy.x, dy.y).data);
6124  TEXTURE_RETURN_UCHAR_XYZW;
6125 }
6126 
6127 template <int texType, enum hipTextureReadMode mode>
6128 __TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture<short, texType, mode> texRef,
6129  hipTextureObject_t textureObject, float x, float y,
6130  float2 dx, float2 dy) {
6131  TEXTURE_PARAMETERS_INIT;
6132  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6133  float2(dx.x, dx.y).data,
6134  float2(dy.x, dy.y).data);
6135  TEXTURE_RETURN_SHORT;
6136 }
6137 
6138 template <int texType, enum hipTextureReadMode mode>
6139 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture<short1, texType, mode> texRef,
6140  hipTextureObject_t textureObject, float x, float y,
6141  float2 dx, float2 dy) {
6142  TEXTURE_PARAMETERS_INIT;
6143  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6144  float2(dx.x, dx.y).data,
6145  float2(dy.x, dy.y).data);
6146  TEXTURE_RETURN_SHORT_X;
6147 }
6148 
6149 template <int texType, enum hipTextureReadMode mode>
6150 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture<short2, texType, mode> texRef,
6151  hipTextureObject_t textureObject, float x, float y,
6152  float2 dx, float2 dy) {
6153  TEXTURE_PARAMETERS_INIT;
6154  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6155  float2(dx.x, dx.y).data,
6156  float2(dy.x, dy.y).data);
6157  TEXTURE_RETURN_SHORT_XY;
6158 }
6159 
6160 template <int texType, enum hipTextureReadMode mode>
6161 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture<short4, texType, mode> texRef,
6162  hipTextureObject_t textureObject, float x, float y,
6163  float2 dx, float2 dy) {
6164  TEXTURE_PARAMETERS_INIT;
6165  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6166  float2(dx.x, dx.y).data,
6167  float2(dy.x, dy.y).data);
6168  TEXTURE_RETURN_SHORT_XYZW;
6169 }
6170 
6171 template <int texType, enum hipTextureReadMode mode>
6172 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture<unsigned short, texType, mode> texRef,
6173  hipTextureObject_t textureObject, float x,
6174  float y, float2 dx, float2 dy) {
6175  TEXTURE_PARAMETERS_INIT;
6176  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6177  float2(dx.x, dx.y).data,
6178  float2(dy.x, dy.y).data);
6179  TEXTURE_RETURN_USHORT;
6180 }
6181 
6182 template <int texType, enum hipTextureReadMode mode>
6183 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture<ushort1, texType, mode> texRef,
6184  hipTextureObject_t textureObject, float x, float y,
6185  float2 dx, float2 dy) {
6186  TEXTURE_PARAMETERS_INIT;
6187  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6188  float2(dx.x, dx.y).data,
6189  float2(dy.x, dy.y).data);
6190  TEXTURE_RETURN_USHORT_X;
6191 }
6192 
6193 template <int texType, enum hipTextureReadMode mode>
6194 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture<ushort2, texType, mode> texRef,
6195  hipTextureObject_t textureObject, float x, float y,
6196  float2 dx, float2 dy) {
6197  TEXTURE_PARAMETERS_INIT;
6198  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6199  float2(dx.x, dx.y).data,
6200  float2(dy.x, dy.y).data);
6201  TEXTURE_RETURN_USHORT_XY;
6202 }
6203 
6204 template <int texType, enum hipTextureReadMode mode>
6205 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture<ushort4, texType, mode> texRef,
6206  hipTextureObject_t textureObject, float x, float y,
6207  float2 dx, float2 dy) {
6208  TEXTURE_PARAMETERS_INIT;
6209  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6210  float2(dx.x, dx.y).data,
6211  float2(dy.x, dy.y).data);
6212  TEXTURE_RETURN_USHORT_XYZW;
6213 }
6214 
6215 template <int texType, enum hipTextureReadMode mode>
6216 __TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture<int, texType, mode> texRef,
6217  hipTextureObject_t textureObject, float x, float y,
6218  float2 dx, float2 dy) {
6219  TEXTURE_PARAMETERS_INIT;
6220  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6221  float2(dx.x, dx.y).data,
6222  float2(dy.x, dy.y).data);
6223  TEXTURE_RETURN_INT;
6224 }
6225 
6226 template <int texType, enum hipTextureReadMode mode>
6227 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture<int1, texType, mode> texRef,
6228  hipTextureObject_t textureObject, float x, float y,
6229  float2 dx, float2 dy) {
6230  TEXTURE_PARAMETERS_INIT;
6231  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6232  float2(dx.x, dx.y).data,
6233  float2(dy.x, dy.y).data);
6234  TEXTURE_RETURN_INT_X;
6235 }
6236 
6237 template <int texType, enum hipTextureReadMode mode>
6238 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture<int2, texType, mode> texRef,
6239  hipTextureObject_t textureObject, float x, float y,
6240  float2 dx, float2 dy) {
6241  TEXTURE_PARAMETERS_INIT;
6242  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6243  float2(dx.x, dx.y).data,
6244  float2(dy.x, dy.y).data);
6245  TEXTURE_RETURN_INT_XY;
6246 }
6247 
6248 template <int texType, enum hipTextureReadMode mode>
6249 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture<int4, texType, mode> texRef,
6250  hipTextureObject_t textureObject, float x, float y,
6251  float2 dx, float2 dy) {
6252  TEXTURE_PARAMETERS_INIT;
6253  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6254  float2(dx.x, dx.y).data,
6255  float2(dy.x, dy.y).data);
6256  TEXTURE_RETURN_INT_XYZW;
6257 }
6258 
6259 template <int texType, enum hipTextureReadMode mode>
6260 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture<unsigned int, texType, mode> texRef,
6261  hipTextureObject_t textureObject, float x,
6262  float y, float2 dx, float2 dy) {
6263  TEXTURE_PARAMETERS_INIT;
6264  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6265  float2(dx.x, dx.y).data,
6266  float2(dy.x, dy.y).data);
6267  TEXTURE_RETURN_UINT;
6268 }
6269 
6270 template <int texType, enum hipTextureReadMode mode>
6271 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture<uint1, texType, mode> texRef,
6272  hipTextureObject_t textureObject, float x, float y,
6273  float2 dx, float2 dy) {
6274  TEXTURE_PARAMETERS_INIT;
6275  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6276  float2(dx.x, dx.y).data,
6277  float2(dy.x, dy.y).data);
6278  TEXTURE_RETURN_UINT_X;
6279 }
6280 
6281 template <int texType, enum hipTextureReadMode mode>
6282 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture<uint2, texType, mode> texRef,
6283  hipTextureObject_t textureObject, float x, float y,
6284  float2 dx, float2 dy) {
6285  TEXTURE_PARAMETERS_INIT;
6286  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6287  float2(dx.x, dx.y).data,
6288  float2(dy.x, dy.y).data);
6289  TEXTURE_RETURN_UINT_XY;
6290 }
6291 
6292 template <int texType, enum hipTextureReadMode mode>
6293 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture<uint4, texType, mode> texRef,
6294  hipTextureObject_t textureObject, float x, float y,
6295  float2 dx, float2 dy) {
6296  TEXTURE_PARAMETERS_INIT;
6297  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6298  float2(dx.x, dx.y).data,
6299  float2(dy.x, dy.y).data);
6300  TEXTURE_RETURN_UINT_XYZW;
6301 }
6302 
6303 template <int texType, enum hipTextureReadMode mode>
6304 __TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture<float, texType, mode> texRef,
6305  hipTextureObject_t textureObject, float x, float y,
6306  float2 dx, float2 dy) {
6307  TEXTURE_PARAMETERS_INIT;
6308  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6309  float2(dx.x, dx.y).data,
6310  float2(dy.x, dy.y).data);
6311  TEXTURE_RETURN_FLOAT;
6312 }
6313 
6314 template <int texType, enum hipTextureReadMode mode>
6315 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture<float1, texType, mode> texRef,
6316  hipTextureObject_t textureObject, float x, float y,
6317  float2 dx, float2 dy) {
6318  TEXTURE_PARAMETERS_INIT;
6319  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6320  float2(dx.x, dx.y).data,
6321  float2(dy.x, dy.y).data);
6322  TEXTURE_RETURN_FLOAT_X;
6323 }
6324 
6325 template <int texType, enum hipTextureReadMode mode>
6326 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture<float2, texType, mode> texRef,
6327  hipTextureObject_t textureObject, float x, float y,
6328  float2 dx, float2 dy) {
6329  TEXTURE_PARAMETERS_INIT;
6330  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6331  float2(dx.x, dx.y).data,
6332  float2(dy.x, dy.y).data);
6333  TEXTURE_RETURN_FLOAT_XY;
6334 }
6335 
6336 template <int texType, enum hipTextureReadMode mode>
6337 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture<float4, texType, mode> texRef,
6338  hipTextureObject_t textureObject, float x, float y,
6339  float2 dx, float2 dy) {
6340  TEXTURE_PARAMETERS_INIT;
6341  texel.f = __ockl_image_sample_grad_2D(i, s, float2(x, y).data,
6342  float2(dx.x, dx.y).data,
6343  float2(dy.x, dy.y).data);
6344  TEXTURE_RETURN_FLOAT_XYZW;
6345 }
6346 
6348 
6349 template <int texType, enum hipTextureReadMode mode>
6350 __TEXTURE_FUNCTIONS_DECL__ char tex3D(texture<char, texType, mode> texRef, float x, float y,
6351  float z) {
6352  TEXTURE_REF_PARAMETERS_INIT;
6353  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6354  TEXTURE_RETURN_CHAR;
6355 }
6356 
6357 template <int texType, enum hipTextureReadMode mode>
6358 __TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture<char1, texType, mode> texRef, float x, float y,
6359  float z) {
6360  TEXTURE_REF_PARAMETERS_INIT;
6361  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6362  TEXTURE_RETURN_CHAR_X;
6363 }
6364 
6365 template <int texType, enum hipTextureReadMode mode>
6366 __TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture<char2, texType, mode> texRef, float x, float y,
6367  float z) {
6368  TEXTURE_REF_PARAMETERS_INIT;
6369  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6370  TEXTURE_RETURN_CHAR_XY;
6371 }
6372 
6373 template <int texType, enum hipTextureReadMode mode>
6374 __TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture<char4, texType, mode> texRef, float x, float y,
6375  float z) {
6376  TEXTURE_REF_PARAMETERS_INIT;
6377  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6378  TEXTURE_RETURN_CHAR_XYZW;
6379 }
6380 
6381 template <int texType, enum hipTextureReadMode mode>
6382 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture<unsigned char, texType, mode> texRef,
6383  float x, float y, float z) {
6384  TEXTURE_REF_PARAMETERS_INIT;
6385  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6386  TEXTURE_RETURN_UCHAR;
6387 }
6388 
6389 template <int texType, enum hipTextureReadMode mode>
6390 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture<uchar1, texType, mode> texRef, float x, float y,
6391  float z) {
6392  TEXTURE_REF_PARAMETERS_INIT;
6393  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6394  TEXTURE_RETURN_UCHAR_X;
6395 }
6396 
6397 template <int texType, enum hipTextureReadMode mode>
6398 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture<uchar2, texType, mode> texRef, float x, float y,
6399  float z) {
6400  TEXTURE_REF_PARAMETERS_INIT;
6401  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6402  TEXTURE_RETURN_UCHAR_XY;
6403 }
6404 
6405 template <int texType, enum hipTextureReadMode mode>
6406 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture<uchar4, texType, mode> texRef, float x, float y,
6407  float z) {
6408  TEXTURE_REF_PARAMETERS_INIT;
6409  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6410  TEXTURE_RETURN_UCHAR_XYZW;
6411 }
6412 
6413 template <int texType, enum hipTextureReadMode mode>
6414 __TEXTURE_FUNCTIONS_DECL__ short tex3D(texture<short, texType, mode> texRef, float x, float y,
6415  float z) {
6416  TEXTURE_REF_PARAMETERS_INIT;
6417  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6418  TEXTURE_RETURN_SHORT;
6419 }
6420 
6421 template <int texType, enum hipTextureReadMode mode>
6422 __TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture<short1, texType, mode> texRef, float x, float y,
6423  float z) {
6424  TEXTURE_REF_PARAMETERS_INIT;
6425  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6426  TEXTURE_RETURN_SHORT_X;
6427 }
6428 
6429 template <int texType, enum hipTextureReadMode mode>
6430 __TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture<short2, texType, mode> texRef, float x, float y,
6431  float z) {
6432  TEXTURE_REF_PARAMETERS_INIT;
6433  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6434  TEXTURE_RETURN_SHORT_XY;
6435 }
6436 
6437 template <int texType, enum hipTextureReadMode mode>
6438 __TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture<short4, texType, mode> texRef, float x, float y,
6439  float z) {
6440  TEXTURE_REF_PARAMETERS_INIT;
6441  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6442  TEXTURE_RETURN_SHORT_XYZW;
6443 }
6444 
6445 template <int texType, enum hipTextureReadMode mode>
6446 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture<unsigned short, texType, mode> texRef,
6447  float x, float y, float z) {
6448  TEXTURE_REF_PARAMETERS_INIT;
6449  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6450  TEXTURE_RETURN_USHORT;
6451 }
6452 
6453 template <int texType, enum hipTextureReadMode mode>
6454 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture<ushort1, texType, mode> texRef, float x, float y,
6455  float z) {
6456  TEXTURE_REF_PARAMETERS_INIT;
6457  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6458  TEXTURE_RETURN_USHORT_X;
6459 }
6460 
6461 template <int texType, enum hipTextureReadMode mode>
6462 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture<ushort2, texType, mode> texRef, float x, float y,
6463  float z) {
6464  TEXTURE_REF_PARAMETERS_INIT;
6465  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6466  TEXTURE_RETURN_USHORT_XY;
6467 }
6468 
6469 template <int texType, enum hipTextureReadMode mode>
6470 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture<ushort4, texType, mode> texRef, float x, float y,
6471  float z) {
6472  TEXTURE_REF_PARAMETERS_INIT;
6473  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6474  TEXTURE_RETURN_USHORT_XYZW;
6475 }
6476 
6477 template <int texType, enum hipTextureReadMode mode>
6478 __TEXTURE_FUNCTIONS_DECL__ int tex3D(texture<int, texType, mode> texRef, float x, float y,
6479  float z) {
6480  TEXTURE_REF_PARAMETERS_INIT;
6481  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6482  TEXTURE_RETURN_INT;
6483 }
6484 
6485 template <int texType, enum hipTextureReadMode mode>
6486 __TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture<int1, texType, mode> texRef, float x, float y,
6487  float z) {
6488  TEXTURE_REF_PARAMETERS_INIT;
6489  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6490  TEXTURE_RETURN_INT_X;
6491 }
6492 
6493 template <int texType, enum hipTextureReadMode mode>
6494 __TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture<int2, texType, mode> texRef, float x, float y,
6495  float z) {
6496  TEXTURE_REF_PARAMETERS_INIT;
6497  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6498  TEXTURE_RETURN_INT_XY;
6499 }
6500 
6501 template <int texType, enum hipTextureReadMode mode>
6502 __TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture<int4, texType, mode> texRef, float x, float y,
6503  float z) {
6504  TEXTURE_REF_PARAMETERS_INIT;
6505  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6506  TEXTURE_RETURN_INT_XYZW;
6507 }
6508 
6509 template <int texType, enum hipTextureReadMode mode>
6510 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture<unsigned int, texType, mode> texRef, float x,
6511  float y, float z) {
6512  TEXTURE_REF_PARAMETERS_INIT;
6513  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6514  TEXTURE_RETURN_UINT;
6515 }
6516 
6517 template <int texType, enum hipTextureReadMode mode>
6518 __TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture<uint1, texType, mode> texRef, float x, float y,
6519  float z) {
6520  TEXTURE_REF_PARAMETERS_INIT;
6521  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6522  TEXTURE_RETURN_UINT_X;
6523 }
6524 
6525 template <int texType, enum hipTextureReadMode mode>
6526 __TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture<uint2, texType, mode> texRef, float x, float y,
6527  float z) {
6528  TEXTURE_REF_PARAMETERS_INIT;
6529  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6530  TEXTURE_RETURN_UINT_XY;
6531 }
6532 
6533 template <int texType, enum hipTextureReadMode mode>
6534 __TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture<uint4, texType, mode> texRef, float x, float y,
6535  float z) {
6536  TEXTURE_REF_PARAMETERS_INIT;
6537  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6538  TEXTURE_RETURN_UINT_XYZW;
6539 }
6540 
6541 template <int texType, enum hipTextureReadMode mode>
6542 __TEXTURE_FUNCTIONS_DECL__ float tex3D(texture<float, texType, mode> texRef, float x, float y,
6543  float z) {
6544  TEXTURE_REF_PARAMETERS_INIT;
6545  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6546  TEXTURE_RETURN_FLOAT;
6547 }
6548 
6549 template <int texType, enum hipTextureReadMode mode>
6550 __TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture<float1, texType, mode> texRef, float x, float y,
6551  float z) {
6552  TEXTURE_REF_PARAMETERS_INIT;
6553  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6554  TEXTURE_RETURN_FLOAT_X;
6555 }
6556 
6557 template <int texType, enum hipTextureReadMode mode>
6558 __TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture<float2, texType, mode> texRef, float x, float y,
6559  float z) {
6560  TEXTURE_REF_PARAMETERS_INIT;
6561  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6562  TEXTURE_RETURN_FLOAT_XY;
6563 }
6564 
6565 template <int texType, enum hipTextureReadMode mode>
6566 __TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture<float4, texType, mode> texRef, float x, float y,
6567  float z) {
6568  TEXTURE_REF_PARAMETERS_INIT;
6569  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6570  TEXTURE_RETURN_FLOAT_XYZW;
6571 }
6572 
6574 
6575 template <int texType, enum hipTextureReadMode mode>
6576 __TEXTURE_FUNCTIONS_DECL__ char tex3D(texture<char, texType, mode> texRef,
6577  hipTextureObject_t textureObject, float x, float y, float z) {
6578  TEXTURE_PARAMETERS_INIT;
6579  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6580  TEXTURE_RETURN_CHAR;
6581 }
6582 
6583 template <int texType, enum hipTextureReadMode mode>
6584 __TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture<char1, texType, mode> texRef,
6585  hipTextureObject_t textureObject, float x, float y,
6586  float z) {
6587  TEXTURE_PARAMETERS_INIT;
6588  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6589  TEXTURE_RETURN_CHAR_X;
6590 }
6591 
6592 template <int texType, enum hipTextureReadMode mode>
6593 __TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture<char2, texType, mode> texRef,
6594  hipTextureObject_t textureObject, float x, float y,
6595  float z) {
6596  TEXTURE_PARAMETERS_INIT;
6597  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6598  TEXTURE_RETURN_CHAR_XY;
6599 }
6600 
6601 template <int texType, enum hipTextureReadMode mode>
6602 __TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture<char4, texType, mode> texRef,
6603  hipTextureObject_t textureObject, float x, float y,
6604  float z) {
6605  TEXTURE_PARAMETERS_INIT;
6606  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6607  TEXTURE_RETURN_CHAR_XYZW;
6608 }
6609 
6610 template <int texType, enum hipTextureReadMode mode>
6611 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture<unsigned char, texType, mode> texRef,
6612  hipTextureObject_t textureObject, float x, float y,
6613  float z) {
6614  TEXTURE_PARAMETERS_INIT;
6615  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6616  TEXTURE_RETURN_UCHAR;
6617 }
6618 
6619 template <int texType, enum hipTextureReadMode mode>
6620 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture<uchar1, texType, mode> texRef,
6621  hipTextureObject_t textureObject, float x, float y,
6622  float z) {
6623  TEXTURE_PARAMETERS_INIT;
6624  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6625  TEXTURE_RETURN_UCHAR_X;
6626 }
6627 
6628 template <int texType, enum hipTextureReadMode mode>
6629 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture<uchar2, texType, mode> texRef,
6630  hipTextureObject_t textureObject, float x, float y,
6631  float z) {
6632  TEXTURE_PARAMETERS_INIT;
6633  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6634  TEXTURE_RETURN_UCHAR_XY;
6635 }
6636 
6637 template <int texType, enum hipTextureReadMode mode>
6638 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture<uchar4, texType, mode> texRef,
6639  hipTextureObject_t textureObject, float x, float y,
6640  float z) {
6641  TEXTURE_PARAMETERS_INIT;
6642  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6643  TEXTURE_RETURN_UCHAR_XYZW;
6644 }
6645 
6646 template <int texType, enum hipTextureReadMode mode>
6647 __TEXTURE_FUNCTIONS_DECL__ short tex3D(texture<short, texType, mode> texRef,
6648  hipTextureObject_t textureObject, float x, float y,
6649  float z) {
6650  TEXTURE_PARAMETERS_INIT;
6651  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6652  TEXTURE_RETURN_SHORT;
6653 }
6654 
6655 template <int texType, enum hipTextureReadMode mode>
6656 __TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture<short1, texType, mode> texRef,
6657  hipTextureObject_t textureObject, float x, float y,
6658  float z) {
6659  TEXTURE_PARAMETERS_INIT;
6660  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6661  TEXTURE_RETURN_SHORT_X;
6662 }
6663 
6664 template <int texType, enum hipTextureReadMode mode>
6665 __TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture<short2, texType, mode> texRef,
6666  hipTextureObject_t textureObject, float x, float y,
6667  float z) {
6668  TEXTURE_PARAMETERS_INIT;
6669  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6670  TEXTURE_RETURN_SHORT_XY;
6671 }
6672 
6673 template <int texType, enum hipTextureReadMode mode>
6674 __TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture<short4, texType, mode> texRef,
6675  hipTextureObject_t textureObject, float x, float y,
6676  float z) {
6677  TEXTURE_PARAMETERS_INIT;
6678  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6679  TEXTURE_RETURN_SHORT_XYZW;
6680 }
6681 
6682 template <int texType, enum hipTextureReadMode mode>
6683 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture<unsigned short, texType, mode> texRef,
6684  hipTextureObject_t textureObject, float x, float y,
6685  float z) {
6686  TEXTURE_PARAMETERS_INIT;
6687  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6688  TEXTURE_RETURN_USHORT;
6689 }
6690 
6691 template <int texType, enum hipTextureReadMode mode>
6692 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture<ushort1, texType, mode> texRef,
6693  hipTextureObject_t textureObject, float x, float y,
6694  float z) {
6695  TEXTURE_PARAMETERS_INIT;
6696  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6697  TEXTURE_RETURN_USHORT_X;
6698 }
6699 
6700 template <int texType, enum hipTextureReadMode mode>
6701 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture<ushort2, texType, mode> texRef,
6702  hipTextureObject_t textureObject, float x, float y,
6703  float z) {
6704  TEXTURE_PARAMETERS_INIT;
6705  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6706  TEXTURE_RETURN_USHORT_XY;
6707 }
6708 
6709 template <int texType, enum hipTextureReadMode mode>
6710 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture<ushort4, texType, mode> texRef,
6711  hipTextureObject_t textureObject, float x, float y,
6712  float z) {
6713  TEXTURE_PARAMETERS_INIT;
6714  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6715  TEXTURE_RETURN_USHORT_XYZW;
6716 }
6717 
6718 template <int texType, enum hipTextureReadMode mode>
6719 __TEXTURE_FUNCTIONS_DECL__ int tex3D(texture<int, texType, mode> texRef,
6720  hipTextureObject_t textureObject, float x, float y, float z) {
6721  TEXTURE_PARAMETERS_INIT;
6722  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6723  TEXTURE_RETURN_INT;
6724 }
6725 
6726 template <int texType, enum hipTextureReadMode mode>
6727 __TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture<int1, texType, mode> texRef,
6728  hipTextureObject_t textureObject, float x, float y, float z) {
6729  TEXTURE_PARAMETERS_INIT;
6730  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6731  TEXTURE_RETURN_INT_X;
6732 }
6733 
6734 template <int texType, enum hipTextureReadMode mode>
6735 __TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture<int2, texType, mode> texRef,
6736  hipTextureObject_t textureObject, float x, float y, float z) {
6737  TEXTURE_PARAMETERS_INIT;
6738  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6739  TEXTURE_RETURN_INT_XY;
6740 }
6741 
6742 template <int texType, enum hipTextureReadMode mode>
6743 __TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture<int4, texType, mode> texRef,
6744  hipTextureObject_t textureObject, float x, float y, float z) {
6745  TEXTURE_PARAMETERS_INIT;
6746  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6747  TEXTURE_RETURN_INT_XYZW;
6748 }
6749 
6750 template <int texType, enum hipTextureReadMode mode>
6751 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture<unsigned int, texType, mode> texRef,
6752  hipTextureObject_t textureObject, float x, float y,
6753  float z) {
6754  TEXTURE_PARAMETERS_INIT;
6755  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6756  TEXTURE_RETURN_UINT;
6757 }
6758 
6759 template <int texType, enum hipTextureReadMode mode>
6760 __TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture<uint1, texType, mode> texRef,
6761  hipTextureObject_t textureObject, float x, float y,
6762  float z) {
6763  TEXTURE_PARAMETERS_INIT;
6764  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6765  TEXTURE_RETURN_UINT_X;
6766 }
6767 
6768 template <int texType, enum hipTextureReadMode mode>
6769 __TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture<uint2, texType, mode> texRef,
6770  hipTextureObject_t textureObject, float x, float y,
6771  float z) {
6772  TEXTURE_PARAMETERS_INIT;
6773  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6774  TEXTURE_RETURN_UINT_XY;
6775 }
6776 
6777 template <int texType, enum hipTextureReadMode mode>
6778 __TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture<uint4, texType, mode> texRef,
6779  hipTextureObject_t textureObject, float x, float y,
6780  float z) {
6781  TEXTURE_PARAMETERS_INIT;
6782  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6783  TEXTURE_RETURN_UINT_XYZW;
6784 }
6785 
6786 template <int texType, enum hipTextureReadMode mode>
6787 __TEXTURE_FUNCTIONS_DECL__ float tex3D(texture<float, texType, mode> texRef,
6788  hipTextureObject_t textureObject, float x, float y,
6789  float z) {
6790  TEXTURE_PARAMETERS_INIT;
6791  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6792  TEXTURE_RETURN_FLOAT;
6793 }
6794 
6795 template <int texType, enum hipTextureReadMode mode>
6796 __TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture<float1, texType, mode> texRef,
6797  hipTextureObject_t textureObject, float x, float y,
6798  float z) {
6799  TEXTURE_PARAMETERS_INIT;
6800  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6801  TEXTURE_RETURN_FLOAT_X;
6802 }
6803 
6804 template <int texType, enum hipTextureReadMode mode>
6805 __TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture<float2, texType, mode> texRef,
6806  hipTextureObject_t textureObject, float x, float y,
6807  float z) {
6808  TEXTURE_PARAMETERS_INIT;
6809  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6810  TEXTURE_RETURN_FLOAT_XY;
6811 }
6812 
6813 template <int texType, enum hipTextureReadMode mode>
6814 __TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture<float4, texType, mode> texRef,
6815  hipTextureObject_t textureObject, float x, float y,
6816  float z) {
6817  TEXTURE_PARAMETERS_INIT;
6818  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
6819  TEXTURE_RETURN_FLOAT_XYZW;
6820 }
6821 
6823 
6824 template <int texType, enum hipTextureReadMode mode>
6825 __TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture<char, texType, mode> texRef, float x, float y,
6826  float z, float level) {
6827  TEXTURE_REF_PARAMETERS_INIT;
6828  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6829  level);
6830  TEXTURE_RETURN_CHAR;
6831 }
6832 
6833 template <int texType, enum hipTextureReadMode mode>
6834 __TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture<char1, texType, mode> texRef, float x, float y,
6835  float z, float level) {
6836  TEXTURE_REF_PARAMETERS_INIT;
6837  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6838  level);
6839  TEXTURE_RETURN_CHAR_X;
6840 }
6841 
6842 template <int texType, enum hipTextureReadMode mode>
6843 __TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture<char2, texType, mode> texRef, float x, float y,
6844  float z, float level) {
6845  TEXTURE_REF_PARAMETERS_INIT;
6846  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6847  level);
6848  TEXTURE_RETURN_CHAR_XY;
6849 }
6850 
6851 template <int texType, enum hipTextureReadMode mode>
6852 __TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture<char4, texType, mode> texRef, float x, float y,
6853  float z, float level) {
6854  TEXTURE_REF_PARAMETERS_INIT;
6855  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6856  level);
6857  TEXTURE_RETURN_CHAR_XYZW;
6858 }
6859 
6860 template <int texType, enum hipTextureReadMode mode>
6861 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture<unsigned char, texType, mode> texRef,
6862  float x, float y, float z, float level) {
6863  TEXTURE_REF_PARAMETERS_INIT;
6864  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6865  level);
6866  TEXTURE_RETURN_UCHAR;
6867 }
6868 
6869 template <int texType, enum hipTextureReadMode mode>
6870 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture<uchar1, texType, mode> texRef, float x, float y,
6871  float z, float level) {
6872  TEXTURE_REF_PARAMETERS_INIT;
6873  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6874  level);
6875  TEXTURE_RETURN_UCHAR_X;
6876 }
6877 
6878 template <int texType, enum hipTextureReadMode mode>
6879 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture<uchar2, texType, mode> texRef, float x, float y,
6880  float z, float level) {
6881  TEXTURE_REF_PARAMETERS_INIT;
6882  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6883  level);
6884  TEXTURE_RETURN_UCHAR_XY;
6885 }
6886 
6887 template <int texType, enum hipTextureReadMode mode>
6888 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture<uchar4, texType, mode> texRef, float x, float y,
6889  float z, float level) {
6890  TEXTURE_REF_PARAMETERS_INIT;
6891  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6892  level);
6893  TEXTURE_RETURN_UCHAR_XYZW;
6894 }
6895 
6896 template <int texType, enum hipTextureReadMode mode>
6897 __TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture<int, texType, mode> texRef, float x, float y,
6898  float z, float level) {
6899  TEXTURE_REF_PARAMETERS_INIT;
6900  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6901  level);
6902  TEXTURE_RETURN_INT;
6903 }
6904 
6905 template <int texType, enum hipTextureReadMode mode>
6906 __TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture<int1, texType, mode> texRef, float x, float y,
6907  float z, float level) {
6908  TEXTURE_REF_PARAMETERS_INIT;
6909  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6910  level);
6911  TEXTURE_RETURN_INT_X;
6912 }
6913 
6914 template <int texType, enum hipTextureReadMode mode>
6915 __TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture<int2, texType, mode> texRef, float x, float y,
6916  float z, float level) {
6917  TEXTURE_REF_PARAMETERS_INIT;
6918  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6919  level);
6920  TEXTURE_RETURN_INT_XY;
6921 }
6922 
6923 template <int texType, enum hipTextureReadMode mode>
6924 __TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture<int4, texType, mode> texRef, float x, float y,
6925  float z, float level) {
6926  TEXTURE_REF_PARAMETERS_INIT;
6927  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6928  level);
6929  TEXTURE_RETURN_INT_XYZW;
6930 }
6931 
6932 template <int texType, enum hipTextureReadMode mode>
6933 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture<unsigned int, texType, mode> texRef,
6934  float x, float y, float z, float level) {
6935  TEXTURE_REF_PARAMETERS_INIT;
6936  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6937  level);
6938  TEXTURE_RETURN_UINT;
6939 }
6940 
6941 template <int texType, enum hipTextureReadMode mode>
6942 __TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture<uint1, texType, mode> texRef, float x, float y,
6943  float z, float level) {
6944  TEXTURE_REF_PARAMETERS_INIT;
6945  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6946  level);
6947  TEXTURE_RETURN_UINT_X;
6948 }
6949 
6950 template <int texType, enum hipTextureReadMode mode>
6951 __TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture<uint2, texType, mode> texRef, float x, float y,
6952  float z, float level) {
6953  TEXTURE_REF_PARAMETERS_INIT;
6954  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6955  level);
6956  TEXTURE_RETURN_UINT_XY;
6957 }
6958 
6959 template <int texType, enum hipTextureReadMode mode>
6960 __TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture<uint4, texType, mode> texRef, float x, float y,
6961  float z, float level) {
6962  TEXTURE_REF_PARAMETERS_INIT;
6963  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6964  level);
6965  TEXTURE_RETURN_UINT_XYZW;
6966 }
6967 
6968 template <int texType, enum hipTextureReadMode mode>
6969 __TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture<float, texType, mode> texRef, float x, float y,
6970  float z, float level) {
6971  TEXTURE_REF_PARAMETERS_INIT;
6972  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6973  level);
6974  TEXTURE_RETURN_FLOAT;
6975 }
6976 
6977 template <int texType, enum hipTextureReadMode mode>
6978 __TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture<float1, texType, mode> texRef, float x, float y,
6979  float z, float level) {
6980  TEXTURE_REF_PARAMETERS_INIT;
6981  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6982  level);
6983  TEXTURE_RETURN_FLOAT_X;
6984 }
6985 
6986 template <int texType, enum hipTextureReadMode mode>
6987 __TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture<float2, texType, mode> texRef, float x, float y,
6988  float z, float level) {
6989  TEXTURE_REF_PARAMETERS_INIT;
6990  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
6991  level);
6992  TEXTURE_RETURN_FLOAT_XY;
6993 }
6994 
6995 template <int texType, enum hipTextureReadMode mode>
6996 __TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture<float4, texType, mode> texRef, float x, float y,
6997  float z, float level) {
6998  TEXTURE_REF_PARAMETERS_INIT;
6999  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7000  level);
7001  TEXTURE_RETURN_FLOAT_XYZW;
7002 }
7003 
7005 
7006 template <int texType, enum hipTextureReadMode mode>
7007 __TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture<char, texType, mode> texRef,
7008  hipTextureObject_t textureObject, float x, float y,
7009  float z, float level) {
7010  TEXTURE_PARAMETERS_INIT;
7011  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7012  level);
7013  TEXTURE_RETURN_CHAR;
7014 }
7015 
7016 template <int texType, enum hipTextureReadMode mode>
7017 __TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture<char1, texType, mode> texRef,
7018  hipTextureObject_t textureObject, float x, float y,
7019  float z, float level) {
7020  TEXTURE_PARAMETERS_INIT;
7021  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7022  level);
7023  TEXTURE_RETURN_CHAR_X;
7024 }
7025 
7026 template <int texType, enum hipTextureReadMode mode>
7027 __TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture<char2, texType, mode> texRef,
7028  hipTextureObject_t textureObject, float x, float y,
7029  float z, float level) {
7030  TEXTURE_PARAMETERS_INIT;
7031  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7032  level);
7033  TEXTURE_RETURN_CHAR_XY;
7034 }
7035 
7036 template <int texType, enum hipTextureReadMode mode>
7037 __TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture<char4, texType, mode> texRef,
7038  hipTextureObject_t textureObject, float x, float y,
7039  float z, float level) {
7040  TEXTURE_PARAMETERS_INIT;
7041  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7042  level);
7043  TEXTURE_RETURN_CHAR_XYZW;
7044 }
7045 
7046 template <int texType, enum hipTextureReadMode mode>
7047 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture<unsigned char, texType, mode> texRef,
7048  hipTextureObject_t textureObject, float x,
7049  float y, float z, float level) {
7050  TEXTURE_PARAMETERS_INIT;
7051  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7052  level);
7053  TEXTURE_RETURN_UCHAR;
7054 }
7055 
7056 template <int texType, enum hipTextureReadMode mode>
7057 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture<uchar1, texType, mode> texRef,
7058  hipTextureObject_t textureObject, float x, float y,
7059  float z, float level) {
7060  TEXTURE_PARAMETERS_INIT;
7061  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7062  level);
7063  TEXTURE_RETURN_UCHAR_X;
7064 }
7065 
7066 template <int texType, enum hipTextureReadMode mode>
7067 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture<uchar2, texType, mode> texRef,
7068  hipTextureObject_t textureObject, float x, float y,
7069  float z, float level) {
7070  TEXTURE_PARAMETERS_INIT;
7071  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7072  level);
7073  TEXTURE_RETURN_UCHAR_XY;
7074 }
7075 
7076 template <int texType, enum hipTextureReadMode mode>
7077 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture<uchar4, texType, mode> texRef,
7078  hipTextureObject_t textureObject, float x, float y,
7079  float z, float level) {
7080  TEXTURE_PARAMETERS_INIT;
7081  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7082  level);
7083  TEXTURE_RETURN_UCHAR_XYZW;
7084 }
7085 
7086 template <int texType, enum hipTextureReadMode mode>
7087 __TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture<int, texType, mode> texRef,
7088  hipTextureObject_t textureObject, float x, float y, float z,
7089  float level) {
7090  TEXTURE_PARAMETERS_INIT;
7091  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7092  level);
7093  TEXTURE_RETURN_INT;
7094 }
7095 
7096 template <int texType, enum hipTextureReadMode mode>
7097 __TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture<int1, texType, mode> texRef,
7098  hipTextureObject_t textureObject, float x, float y,
7099  float z, float level) {
7100  TEXTURE_PARAMETERS_INIT;
7101  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7102  level);
7103  TEXTURE_RETURN_INT_X;
7104 }
7105 
7106 template <int texType, enum hipTextureReadMode mode>
7107 __TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture<int2, texType, mode> texRef,
7108  hipTextureObject_t textureObject, float x, float y,
7109  float z, float level) {
7110  TEXTURE_PARAMETERS_INIT;
7111  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7112  level);
7113  TEXTURE_RETURN_INT_XY;
7114 }
7115 
7116 template <int texType, enum hipTextureReadMode mode>
7117 __TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture<int4, texType, mode> texRef,
7118  hipTextureObject_t textureObject, float x, float y,
7119  float z, float level) {
7120  TEXTURE_PARAMETERS_INIT;
7121  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7122  level);
7123  TEXTURE_RETURN_INT_XYZW;
7124 }
7125 
7126 template <int texType, enum hipTextureReadMode mode>
7127 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture<unsigned int, texType, mode> texRef,
7128  hipTextureObject_t textureObject, float x, float y,
7129  float z, float level) {
7130  TEXTURE_PARAMETERS_INIT;
7131  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7132  level);
7133  TEXTURE_RETURN_UINT;
7134 }
7135 
7136 template <int texType, enum hipTextureReadMode mode>
7137 __TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture<uint1, texType, mode> texRef,
7138  hipTextureObject_t textureObject, float x, float y,
7139  float z, float level) {
7140  TEXTURE_PARAMETERS_INIT;
7141  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7142  level);
7143  TEXTURE_RETURN_UINT_X;
7144 }
7145 
7146 template <int texType, enum hipTextureReadMode mode>
7147 __TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture<uint2, texType, mode> texRef,
7148  hipTextureObject_t textureObject, float x, float y,
7149  float z, float level) {
7150  TEXTURE_PARAMETERS_INIT;
7151  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7152  level);
7153  TEXTURE_RETURN_UINT_XY;
7154 }
7155 
7156 template <int texType, enum hipTextureReadMode mode>
7157 __TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture<uint4, texType, mode> texRef,
7158  hipTextureObject_t textureObject, float x, float y,
7159  float z, float level) {
7160  TEXTURE_PARAMETERS_INIT;
7161  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7162  level);
7163  TEXTURE_RETURN_UINT_XYZW;
7164 }
7165 
7166 template <int texType, enum hipTextureReadMode mode>
7167 __TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture<float, texType, mode> texRef,
7168  hipTextureObject_t textureObject, float x, float y,
7169  float z, float level) {
7170  TEXTURE_PARAMETERS_INIT;
7171  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7172  level);
7173  TEXTURE_RETURN_FLOAT;
7174 }
7175 
7176 template <int texType, enum hipTextureReadMode mode>
7177 __TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture<float1, texType, mode> texRef,
7178  hipTextureObject_t textureObject, float x, float y,
7179  float z, float level) {
7180  TEXTURE_PARAMETERS_INIT;
7181  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7182  level);
7183  TEXTURE_RETURN_FLOAT_X;
7184 }
7185 
7186 template <int texType, enum hipTextureReadMode mode>
7187 __TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture<float2, texType, mode> texRef,
7188  hipTextureObject_t textureObject, float x, float y,
7189  float z, float level) {
7190  TEXTURE_PARAMETERS_INIT;
7191  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7192  level);
7193  TEXTURE_RETURN_FLOAT_XY;
7194 }
7195 
7196 template <int texType, enum hipTextureReadMode mode>
7197 __TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture<float4, texType, mode> texRef,
7198  hipTextureObject_t textureObject, float x, float y,
7199  float z, float level) {
7200  TEXTURE_PARAMETERS_INIT;
7201  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
7202  level);
7203  TEXTURE_RETURN_FLOAT_XYZW;
7204 }
7205 
7207 
7208 template <int texType, enum hipTextureReadMode mode>
7209 __TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture<char, texType, mode> texRef, float x, float y,
7210  float z, float4 dx, float4 dy) {
7211  TEXTURE_REF_PARAMETERS_INIT;
7212  texel.f =
7213  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7214  float4(dx.x, dx.y, dx.z, dx.w).data,
7215  float4(dy.x, dy.y, dy.z, dy.w).data);
7216  TEXTURE_RETURN_CHAR;
7217 }
7218 
7219 template <int texType, enum hipTextureReadMode mode>
7220 __TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture<char1, texType, mode> texRef, float x, float y,
7221  float z, float4 dx, float4 dy) {
7222  TEXTURE_REF_PARAMETERS_INIT;
7223  texel.f =
7224  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7225  float4(dx.x, dx.y, dx.z, dx.w).data,
7226  float4(dy.x, dy.y, dy.z, dy.w).data);
7227  TEXTURE_RETURN_CHAR_X;
7228 }
7229 
7230 template <int texType, enum hipTextureReadMode mode>
7231 __TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture<char2, texType, mode> texRef, float x, float y,
7232  float z, float4 dx, float4 dy) {
7233  TEXTURE_REF_PARAMETERS_INIT;
7234  texel.f =
7235  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7236  float4(dx.x, dx.y, dx.z, dx.w).data,
7237  float4(dy.x, dy.y, dy.z, dy.w).data);
7238  TEXTURE_RETURN_CHAR_XY;
7239 }
7240 
7241 template <int texType, enum hipTextureReadMode mode>
7242 __TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture<char4, texType, mode> texRef, float x, float y,
7243  float z, float4 dx, float4 dy) {
7244  TEXTURE_REF_PARAMETERS_INIT;
7245  texel.f =
7246  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7247  float4(dx.x, dx.y, dx.z, dx.w).data,
7248  float4(dy.x, dy.y, dy.z, dy.w).data);
7249  TEXTURE_RETURN_CHAR_XYZW;
7250 }
7251 
7252 template <int texType, enum hipTextureReadMode mode>
7253 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture<unsigned char, texType, mode> texRef,
7254  float x, float y, float z, float4 dx,
7255  float4 dy) {
7256  TEXTURE_REF_PARAMETERS_INIT;
7257  texel.f =
7258  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7259  float4(dx.x, dx.y, dx.z, dx.w).data,
7260  float4(dy.x, dy.y, dy.z, dy.w).data);
7261  TEXTURE_RETURN_UCHAR;
7262 }
7263 
7264 template <int texType, enum hipTextureReadMode mode>
7265 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture<uchar1, texType, mode> texRef, float x, float y,
7266  float z, float4 dx, float4 dy) {
7267  TEXTURE_REF_PARAMETERS_INIT;
7268  texel.f =
7269  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7270  float4(dx.x, dx.y, dx.z, dx.w).data,
7271  float4(dy.x, dy.y, dy.z, dy.w).data);
7272  TEXTURE_RETURN_UCHAR_X;
7273 }
7274 
7275 template <int texType, enum hipTextureReadMode mode>
7276 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture<uchar2, texType, mode> texRef, float x, float y,
7277  float z, float4 dx, float4 dy) {
7278  TEXTURE_REF_PARAMETERS_INIT;
7279  texel.f =
7280  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7281  float4(dx.x, dx.y, dx.z, dx.w).data,
7282  float4(dy.x, dy.y, dy.z, dy.w).data);
7283  TEXTURE_RETURN_UCHAR_XY;
7284 }
7285 
7286 template <int texType, enum hipTextureReadMode mode>
7287 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture<uchar4, texType, mode> texRef, float x, float y,
7288  float z, float4 dx, float4 dy) {
7289  TEXTURE_REF_PARAMETERS_INIT;
7290  texel.f =
7291  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7292  float4(dx.x, dx.y, dx.z, dx.w).data,
7293  float4(dy.x, dy.y, dy.z, dy.w).data);
7294  TEXTURE_RETURN_UCHAR_XYZW;
7295 }
7296 
7297 template <int texType, enum hipTextureReadMode mode>
7298 __TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture<short, texType, mode> texRef, float x, float y,
7299  float z, float4 dx, float4 dy) {
7300  TEXTURE_REF_PARAMETERS_INIT;
7301  texel.f =
7302  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7303  float4(dx.x, dx.y, dx.z, dx.w).data,
7304  float4(dy.x, dy.y, dy.z, dy.w).data);
7305  TEXTURE_RETURN_SHORT;
7306 }
7307 
7308 template <int texType, enum hipTextureReadMode mode>
7309 __TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture<short1, texType, mode> texRef, float x, float y,
7310  float z, float4 dx, float4 dy) {
7311  TEXTURE_REF_PARAMETERS_INIT;
7312  texel.f =
7313  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7314  float4(dx.x, dx.y, dx.z, dx.w).data,
7315  float4(dy.x, dy.y, dy.z, dy.w).data);
7316  TEXTURE_RETURN_SHORT_X;
7317 }
7318 
7319 template <int texType, enum hipTextureReadMode mode>
7320 __TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture<short2, texType, mode> texRef, float x, float y,
7321  float z, float4 dx, float4 dy) {
7322  TEXTURE_REF_PARAMETERS_INIT;
7323  texel.f =
7324  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7325  float4(dx.x, dx.y, dx.z, dx.w).data,
7326  float4(dy.x, dy.y, dy.z, dy.w).data);
7327  TEXTURE_RETURN_SHORT_XY;
7328 }
7329 
7330 template <int texType, enum hipTextureReadMode mode>
7331 __TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture<short4, texType, mode> texRef, float x, float y,
7332  float z, float4 dx, float4 dy) {
7333  TEXTURE_REF_PARAMETERS_INIT;
7334  texel.f =
7335  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7336  float4(dx.x, dx.y, dx.z, dx.w).data,
7337  float4(dy.x, dy.y, dy.z, dy.w).data);
7338  TEXTURE_RETURN_SHORT_XYZW;
7339 }
7340 
7341 template <int texType, enum hipTextureReadMode mode>
7342 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture<unsigned short, texType, mode> texRef,
7343  float x, float y, float z, float4 dx,
7344  float4 dy) {
7345  TEXTURE_REF_PARAMETERS_INIT;
7346  texel.f =
7347  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7348  float4(dx.x, dx.y, dx.z, dx.w).data,
7349  float4(dy.x, dy.y, dy.z, dy.w).data);
7350  TEXTURE_RETURN_USHORT;
7351 }
7352 
7353 template <int texType, enum hipTextureReadMode mode>
7354 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture<ushort1, texType, mode> texRef, float x,
7355  float y, float z, float4 dx, float4 dy) {
7356  TEXTURE_REF_PARAMETERS_INIT;
7357  texel.f =
7358  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7359  float4(dx.x, dx.y, dx.z, dx.w).data,
7360  float4(dy.x, dy.y, dy.z, dy.w).data);
7361  TEXTURE_RETURN_USHORT_X;
7362 }
7363 
7364 template <int texType, enum hipTextureReadMode mode>
7365 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture<ushort2, texType, mode> texRef, float x,
7366  float y, float z, float4 dx, float4 dy) {
7367  TEXTURE_REF_PARAMETERS_INIT;
7368  texel.f =
7369  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7370  float4(dx.x, dx.y, dx.z, dx.w).data,
7371  float4(dy.x, dy.y, dy.z, dy.w).data);
7372  TEXTURE_RETURN_USHORT_XY;
7373 }
7374 
7375 template <int texType, enum hipTextureReadMode mode>
7376 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture<ushort4, texType, mode> texRef, float x,
7377  float y, float z, float4 dx, float4 dy) {
7378  TEXTURE_REF_PARAMETERS_INIT;
7379  texel.f =
7380  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7381  float4(dx.x, dx.y, dx.z, dx.w).data,
7382  float4(dy.x, dy.y, dy.z, dy.w).data);
7383  TEXTURE_RETURN_USHORT_XYZW;
7384 }
7385 
7386 template <int texType, enum hipTextureReadMode mode>
7387 __TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture<int, texType, mode> texRef, float x, float y,
7388  float z, float4 dx, float4 dy) {
7389  TEXTURE_REF_PARAMETERS_INIT;
7390  texel.f =
7391  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7392  float4(dx.x, dx.y, dx.z, dx.w).data,
7393  float4(dy.x, dy.y, dy.z, dy.w).data);
7394  TEXTURE_RETURN_INT;
7395 }
7396 
7397 template <int texType, enum hipTextureReadMode mode>
7398 __TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture<int1, texType, mode> texRef, float x, float y,
7399  float z, float4 dx, float4 dy) {
7400  TEXTURE_REF_PARAMETERS_INIT;
7401  texel.f =
7402  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7403  float4(dx.x, dx.y, dx.z, dx.w).data,
7404  float4(dy.x, dy.y, dy.z, dy.w).data);
7405  TEXTURE_RETURN_INT_X;
7406 }
7407 
7408 template <int texType, enum hipTextureReadMode mode>
7409 __TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture<int2, texType, mode> texRef, float x, float y,
7410  float z, float4 dx, float4 dy) {
7411  TEXTURE_REF_PARAMETERS_INIT;
7412  texel.f =
7413  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7414  float4(dx.x, dx.y, dx.z, dx.w).data,
7415  float4(dy.x, dy.y, dy.z, dy.w).data);
7416  TEXTURE_RETURN_INT_XY;
7417 }
7418 
7419 template <int texType, enum hipTextureReadMode mode>
7420 __TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture<int4, texType, mode> texRef, float x, float y,
7421  float z, float4 dx, float4 dy) {
7422  TEXTURE_REF_PARAMETERS_INIT;
7423  texel.f =
7424  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7425  float4(dx.x, dx.y, dx.z, dx.w).data,
7426  float4(dy.x, dy.y, dy.z, dy.w).data);
7427  TEXTURE_RETURN_INT_XYZW;
7428 }
7429 
7430 template <int texType, enum hipTextureReadMode mode>
7431 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture<unsigned int, texType, mode> texRef,
7432  float x, float y, float z, float4 dx, float4 dy) {
7433  TEXTURE_REF_PARAMETERS_INIT;
7434  texel.f =
7435  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7436  float4(dx.x, dx.y, dx.z, dx.w).data,
7437  float4(dy.x, dy.y, dy.z, dy.w).data);
7438  TEXTURE_RETURN_UINT;
7439 }
7440 
7441 template <int texType, enum hipTextureReadMode mode>
7442 __TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture<uint1, texType, mode> texRef, float x, float y,
7443  float z, float4 dx, float4 dy) {
7444  TEXTURE_REF_PARAMETERS_INIT;
7445  texel.f =
7446  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7447  float4(dx.x, dx.y, dx.z, dx.w).data,
7448  float4(dy.x, dy.y, dy.z, dy.w).data);
7449  TEXTURE_RETURN_UINT_X;
7450 }
7451 
7452 template <int texType, enum hipTextureReadMode mode>
7453 __TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture<uint2, texType, mode> texRef, float x, float y,
7454  float z, float4 dx, float4 dy) {
7455  TEXTURE_REF_PARAMETERS_INIT;
7456  texel.f =
7457  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7458  float4(dx.x, dx.y, dx.z, dx.w).data,
7459  float4(dy.x, dy.y, dy.z, dy.w).data);
7460  TEXTURE_RETURN_UINT_XY;
7461 }
7462 
7463 template <int texType, enum hipTextureReadMode mode>
7464 __TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture<uint4, texType, mode> texRef, float x, float y,
7465  float z, float4 dx, float4 dy) {
7466  TEXTURE_REF_PARAMETERS_INIT;
7467  texel.f =
7468  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7469  float4(dx.x, dx.y, dx.z, dx.w).data,
7470  float4(dy.x, dy.y, dy.z, dy.w).data);
7471  TEXTURE_RETURN_UINT_XYZW;
7472 }
7473 
7474 template <int texType, enum hipTextureReadMode mode>
7475 __TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture<float, texType, mode> texRef, float x, float y,
7476  float z, float4 dx, float4 dy) {
7477  TEXTURE_REF_PARAMETERS_INIT;
7478  texel.f =
7479  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7480  float4(dx.x, dx.y, dx.z, dx.w).data,
7481  float4(dy.x, dy.y, dy.z, dy.w).data);
7482  TEXTURE_RETURN_FLOAT;
7483 }
7484 
7485 template <int texType, enum hipTextureReadMode mode>
7486 __TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture<float1, texType, mode> texRef, float x, float y,
7487  float z, float4 dx, float4 dy) {
7488  TEXTURE_REF_PARAMETERS_INIT;
7489  texel.f =
7490  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7491  float4(dx.x, dx.y, dx.z, dx.w).data,
7492  float4(dy.x, dy.y, dy.z, dy.w).data);
7493  TEXTURE_RETURN_FLOAT_X;
7494 }
7495 
7496 template <int texType, enum hipTextureReadMode mode>
7497 __TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture<float2, texType, mode> texRef, float x, float y,
7498  float z, float4 dx, float4 dy) {
7499  TEXTURE_REF_PARAMETERS_INIT;
7500  texel.f =
7501  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7502  float4(dx.x, dx.y, dx.z, dx.w).data,
7503  float4(dy.x, dy.y, dy.z, dy.w).data);
7504  TEXTURE_RETURN_FLOAT_XY;
7505 }
7506 
7507 template <int texType, enum hipTextureReadMode mode>
7508 __TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture<float4, texType, mode> texRef, float x, float y,
7509  float z, float4 dx, float4 dy) {
7510  TEXTURE_REF_PARAMETERS_INIT;
7511  texel.f =
7512  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7513  float4(dx.x, dx.y, dx.z, dx.w).data,
7514  float4(dy.x, dy.y, dy.z, dy.w).data);
7515  TEXTURE_RETURN_FLOAT_XYZW;
7516 }
7517 
7519 template <int texType, enum hipTextureReadMode mode>
7520 __TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture<char, texType, mode> texRef,
7521  hipTextureObject_t textureObject, float x, float y,
7522  float z, float4 dx, float4 dy) {
7523  TEXTURE_PARAMETERS_INIT;
7524  texel.f =
7525  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7526  float4(dx.x, dx.y, dx.z, dx.w).data,
7527  float4(dy.x, dy.y, dy.z, dy.w).data);
7528  TEXTURE_RETURN_CHAR;
7529 }
7530 
7531 template <int texType, enum hipTextureReadMode mode>
7532 __TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture<char1, texType, mode> texRef,
7533  hipTextureObject_t textureObject, float x, float y,
7534  float z, float4 dx, float4 dy) {
7535  TEXTURE_PARAMETERS_INIT;
7536  texel.f =
7537  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7538  float4(dx.x, dx.y, dx.z, dx.w).data,
7539  float4(dy.x, dy.y, dy.z, dy.w).data);
7540  TEXTURE_RETURN_CHAR_X;
7541 }
7542 
7543 template <int texType, enum hipTextureReadMode mode>
7544 __TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture<char2, texType, mode> texRef,
7545  hipTextureObject_t textureObject, float x, float y,
7546  float z, float4 dx, float4 dy) {
7547  TEXTURE_PARAMETERS_INIT;
7548  texel.f =
7549  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7550  float4(dx.x, dx.y, dx.z, dx.w).data,
7551  float4(dy.x, dy.y, dy.z, dy.w).data);
7552  TEXTURE_RETURN_CHAR_XY;
7553 }
7554 
7555 template <int texType, enum hipTextureReadMode mode>
7556 __TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture<char4, texType, mode> texRef,
7557  hipTextureObject_t textureObject, float x, float y,
7558  float z, float4 dx, float4 dy) {
7559  TEXTURE_PARAMETERS_INIT;
7560  texel.f =
7561  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7562  float4(dx.x, dx.y, dx.z, dx.w).data,
7563  float4(dy.x, dy.y, dy.z, dy.w).data);
7564  TEXTURE_RETURN_CHAR_XYZW;
7565 }
7566 
7567 template <int texType, enum hipTextureReadMode mode>
7568 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture<unsigned char, texType, mode> texRef,
7569  hipTextureObject_t textureObject, float x,
7570  float y, float z, float4 dx, float4 dy) {
7571  TEXTURE_PARAMETERS_INIT;
7572  texel.f =
7573  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7574  float4(dx.x, dx.y, dx.z, dx.w).data,
7575  float4(dy.x, dy.y, dy.z, dy.w).data);
7576  TEXTURE_RETURN_UCHAR;
7577 }
7578 
7579 template <int texType, enum hipTextureReadMode mode>
7580 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture<uchar1, texType, mode> texRef,
7581  hipTextureObject_t textureObject, float x, float y,
7582  float z, float4 dx, float4 dy) {
7583  TEXTURE_PARAMETERS_INIT;
7584  texel.f =
7585  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7586  float4(dx.x, dx.y, dx.z, dx.w).data,
7587  float4(dy.x, dy.y, dy.z, dy.w).data);
7588  TEXTURE_RETURN_UCHAR_X;
7589 }
7590 
7591 template <int texType, enum hipTextureReadMode mode>
7592 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture<uchar2, texType, mode> texRef,
7593  hipTextureObject_t textureObject, float x, float y,
7594  float z, float4 dx, float4 dy) {
7595  TEXTURE_PARAMETERS_INIT;
7596  texel.f =
7597  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7598  float4(dx.x, dx.y, dx.z, dx.w).data,
7599  float4(dy.x, dy.y, dy.z, dy.w).data);
7600  TEXTURE_RETURN_UCHAR_XY;
7601 }
7602 
7603 template <int texType, enum hipTextureReadMode mode>
7604 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture<uchar4, texType, mode> texRef,
7605  hipTextureObject_t textureObject, float x, float y,
7606  float z, float4 dx, float4 dy) {
7607  TEXTURE_PARAMETERS_INIT;
7608  texel.f =
7609  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7610  float4(dx.x, dx.y, dx.z, dx.w).data,
7611  float4(dy.x, dy.y, dy.z, dy.w).data);
7612  TEXTURE_RETURN_UCHAR_XYZW;
7613 }
7614 
7615 template <int texType, enum hipTextureReadMode mode>
7616 __TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture<short, texType, mode> texRef,
7617  hipTextureObject_t textureObject, float x, float y,
7618  float z, float4 dx, float4 dy) {
7619  TEXTURE_PARAMETERS_INIT;
7620  texel.f =
7621  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7622  float4(dx.x, dx.y, dx.z, dx.w).data,
7623  float4(dy.x, dy.y, dy.z, dy.w).data);
7624  TEXTURE_RETURN_SHORT;
7625 }
7626 
7627 template <int texType, enum hipTextureReadMode mode>
7628 __TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture<short1, texType, mode> texRef,
7629  hipTextureObject_t textureObject, float x, float y,
7630  float z, float4 dx, float4 dy) {
7631  TEXTURE_PARAMETERS_INIT;
7632  texel.f =
7633  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7634  float4(dx.x, dx.y, dx.z, dx.w).data,
7635  float4(dy.x, dy.y, dy.z, dy.w).data);
7636  TEXTURE_RETURN_SHORT_X;
7637 }
7638 
7639 template <int texType, enum hipTextureReadMode mode>
7640 __TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture<short2, texType, mode> texRef,
7641  hipTextureObject_t textureObject, float x, float y,
7642  float z, float4 dx, float4 dy) {
7643  TEXTURE_PARAMETERS_INIT;
7644  texel.f =
7645  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7646  float4(dx.x, dx.y, dx.z, dx.w).data,
7647  float4(dy.x, dy.y, dy.z, dy.w).data);
7648  TEXTURE_RETURN_SHORT_XY;
7649 }
7650 
7651 template <int texType, enum hipTextureReadMode mode>
7652 __TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture<short4, texType, mode> texRef,
7653  hipTextureObject_t textureObject, float x, float y,
7654  float z, float4 dx, float4 dy) {
7655  TEXTURE_PARAMETERS_INIT;
7656  texel.f =
7657  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7658  float4(dx.x, dx.y, dx.z, dx.w).data,
7659  float4(dy.x, dy.y, dy.z, dy.w).data);
7660  TEXTURE_RETURN_SHORT_XYZW;
7661 }
7662 
7663 template <int texType, enum hipTextureReadMode mode>
7664 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture<unsigned short, texType, mode> texRef,
7665  hipTextureObject_t textureObject, float x,
7666  float y, float z, float4 dx, float4 dy) {
7667  TEXTURE_PARAMETERS_INIT;
7668  texel.f =
7669  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7670  float4(dx.x, dx.y, dx.z, dx.w).data,
7671  float4(dy.x, dy.y, dy.z, dy.w).data);
7672  TEXTURE_RETURN_USHORT;
7673 }
7674 
7675 template <int texType, enum hipTextureReadMode mode>
7676 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture<ushort1, texType, mode> texRef,
7677  hipTextureObject_t textureObject, float x, float y,
7678  float z, float4 dx, float4 dy) {
7679  TEXTURE_PARAMETERS_INIT;
7680  texel.f =
7681  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7682  float4(dx.x, dx.y, dx.z, dx.w).data,
7683  float4(dy.x, dy.y, dy.z, dy.w).data);
7684  TEXTURE_RETURN_USHORT_X;
7685 }
7686 
7687 template <int texType, enum hipTextureReadMode mode>
7688 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture<ushort2, texType, mode> texRef,
7689  hipTextureObject_t textureObject, float x, float y,
7690  float z, float4 dx, float4 dy) {
7691  TEXTURE_PARAMETERS_INIT;
7692  texel.f =
7693  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7694  float4(dx.x, dx.y, dx.z, dx.w).data,
7695  float4(dy.x, dy.y, dy.z, dy.w).data);
7696  TEXTURE_RETURN_USHORT_XY;
7697 }
7698 
7699 template <int texType, enum hipTextureReadMode mode>
7700 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture<ushort4, texType, mode> texRef,
7701  hipTextureObject_t textureObject, float x, float y,
7702  float z, float4 dx, float4 dy) {
7703  TEXTURE_PARAMETERS_INIT;
7704  texel.f =
7705  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7706  float4(dx.x, dx.y, dx.z, dx.w).data,
7707  float4(dy.x, dy.y, dy.z, dy.w).data);
7708  TEXTURE_RETURN_USHORT_XYZW;
7709 }
7710 
7711 template <int texType, enum hipTextureReadMode mode>
7712 __TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture<int, texType, mode> texRef,
7713  hipTextureObject_t textureObject, float x, float y,
7714  float z, float4 dx, float4 dy) {
7715  TEXTURE_PARAMETERS_INIT;
7716  texel.f =
7717  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7718  float4(dx.x, dx.y, dx.z, dx.w).data,
7719  float4(dy.x, dy.y, dy.z, dy.w).data);
7720  TEXTURE_RETURN_INT;
7721 }
7722 
7723 template <int texType, enum hipTextureReadMode mode>
7724 __TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture<int1, texType, mode> texRef,
7725  hipTextureObject_t textureObject, float x, float y,
7726  float z, float4 dx, float4 dy) {
7727  TEXTURE_PARAMETERS_INIT;
7728  texel.f =
7729  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7730  float4(dx.x, dx.y, dx.z, dx.w).data,
7731  float4(dy.x, dy.y, dy.z, dy.w).data);
7732  TEXTURE_RETURN_INT_X;
7733 }
7734 
7735 template <int texType, enum hipTextureReadMode mode>
7736 __TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture<int2, texType, mode> texRef,
7737  hipTextureObject_t textureObject, float x, float y,
7738  float z, float4 dx, float4 dy) {
7739  TEXTURE_PARAMETERS_INIT;
7740  texel.f =
7741  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7742  float4(dx.x, dx.y, dx.z, dx.w).data,
7743  float4(dy.x, dy.y, dy.z, dy.w).data);
7744  TEXTURE_RETURN_INT_XY;
7745 }
7746 
7747 template <int texType, enum hipTextureReadMode mode>
7748 __TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture<int4, texType, mode> texRef,
7749  hipTextureObject_t textureObject, float x, float y,
7750  float z, float4 dx, float4 dy) {
7751  TEXTURE_PARAMETERS_INIT;
7752  texel.f =
7753  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7754  float4(dx.x, dx.y, dx.z, dx.w).data,
7755  float4(dy.x, dy.y, dy.z, dy.w).data);
7756  TEXTURE_RETURN_INT_XYZW;
7757 }
7758 
7759 template <int texType, enum hipTextureReadMode mode>
7760 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture<unsigned int, texType, mode> texRef,
7761  hipTextureObject_t textureObject, float x,
7762  float y, float z, float4 dx, float4 dy) {
7763  TEXTURE_PARAMETERS_INIT;
7764  texel.f =
7765  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7766  float4(dx.x, dx.y, dx.z, dx.w).data,
7767  float4(dy.x, dy.y, dy.z, dy.w).data);
7768  TEXTURE_RETURN_UINT;
7769 }
7770 
7771 template <int texType, enum hipTextureReadMode mode>
7772 __TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture<uint1, texType, mode> texRef,
7773  hipTextureObject_t textureObject, float x, float y,
7774  float z, float4 dx, float4 dy) {
7775  TEXTURE_PARAMETERS_INIT;
7776  texel.f =
7777  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7778  float4(dx.x, dx.y, dx.z, dx.w).data,
7779  float4(dy.x, dy.y, dy.z, dy.w).data);
7780  TEXTURE_RETURN_UINT_X;
7781 }
7782 
7783 template <int texType, enum hipTextureReadMode mode>
7784 __TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture<uint2, texType, mode> texRef,
7785  hipTextureObject_t textureObject, float x, float y,
7786  float z, float4 dx, float4 dy) {
7787  TEXTURE_PARAMETERS_INIT;
7788  texel.f =
7789  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7790  float4(dx.x, dx.y, dx.z, dx.w).data,
7791  float4(dy.x, dy.y, dy.z, dy.w).data);
7792  TEXTURE_RETURN_UINT_XY;
7793 }
7794 
7795 template <int texType, enum hipTextureReadMode mode>
7796 __TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture<uint4, texType, mode> texRef,
7797  hipTextureObject_t textureObject, float x, float y,
7798  float z, float4 dx, float4 dy) {
7799  TEXTURE_PARAMETERS_INIT;
7800  texel.f =
7801  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7802  float4(dx.x, dx.y, dx.z, dx.w).data,
7803  float4(dy.x, dy.y, dy.z, dy.w).data);
7804  TEXTURE_RETURN_UINT_XYZW;
7805 }
7806 
7807 template <int texType, enum hipTextureReadMode mode>
7808 __TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture<float, texType, mode> texRef,
7809  hipTextureObject_t textureObject, float x, float y,
7810  float z, float4 dx, float4 dy) {
7811  TEXTURE_PARAMETERS_INIT;
7812  texel.f =
7813  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7814  float4(dx.x, dx.y, dx.z, dx.w).data,
7815  float4(dy.x, dy.y, dy.z, dy.w).data);
7816  TEXTURE_RETURN_FLOAT;
7817 }
7818 
7819 template <int texType, enum hipTextureReadMode mode>
7820 __TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture<float1, texType, mode> texRef,
7821  hipTextureObject_t textureObject, float x, float y,
7822  float z, float4 dx, float4 dy) {
7823  TEXTURE_PARAMETERS_INIT;
7824  texel.f =
7825  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7826  float4(dx.x, dx.y, dx.z, dx.w).data,
7827  float4(dy.x, dy.y, dy.z, dy.w).data);
7828  TEXTURE_RETURN_FLOAT_X;
7829 }
7830 
7831 template <int texType, enum hipTextureReadMode mode>
7832 __TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture<float2, texType, mode> texRef,
7833  hipTextureObject_t textureObject, float x, float y,
7834  float z, float4 dx, float4 dy) {
7835  TEXTURE_PARAMETERS_INIT;
7836  texel.f =
7837  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7838  float4(dx.x, dx.y, dx.z, dx.w).data,
7839  float4(dy.x, dy.y, dy.z, dy.w).data);
7840  TEXTURE_RETURN_FLOAT_XY;
7841 }
7842 
7843 template <int texType, enum hipTextureReadMode mode>
7844 __TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture<float4, texType, mode> texRef,
7845  hipTextureObject_t textureObject, float x, float y,
7846  float z, float4 dx, float4 dy) {
7847  TEXTURE_PARAMETERS_INIT;
7848  texel.f =
7849  __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data,
7850  float4(dx.x, dx.y, dx.z, dx.w).data,
7851  float4(dy.x, dy.y, dy.z, dy.w).data);
7852  TEXTURE_RETURN_FLOAT_XYZW;
7853 }
7854 
7856 
7857 template <int texType, enum hipTextureReadMode mode>
7858 __TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture<char, texType, mode> texRef, float x,
7859  int layer) {
7860  TEXTURE_REF_PARAMETERS_INIT;
7861  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7862  TEXTURE_RETURN_CHAR;
7863 }
7864 
7865 template <int texType, enum hipTextureReadMode mode>
7866 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture<char1, texType, mode> texRef, float x,
7867  int layer) {
7868  TEXTURE_REF_PARAMETERS_INIT;
7869  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7870  TEXTURE_RETURN_CHAR_X;
7871 }
7872 
7873 template <int texType, enum hipTextureReadMode mode>
7874 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture<char2, texType, mode> texRef, float x,
7875  int layer) {
7876  TEXTURE_REF_PARAMETERS_INIT;
7877  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7878  TEXTURE_RETURN_CHAR_XY;
7879 }
7880 
7881 template <int texType, enum hipTextureReadMode mode>
7882 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture<char4, texType, mode> texRef, float x,
7883  int layer) {
7884  TEXTURE_REF_PARAMETERS_INIT;
7885  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7886  TEXTURE_RETURN_CHAR_XYZW;
7887 }
7888 
7889 template <int texType, enum hipTextureReadMode mode>
7890 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture<unsigned char, texType, mode> texRef,
7891  float x, int layer) {
7892  TEXTURE_REF_PARAMETERS_INIT;
7893  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7894  TEXTURE_RETURN_UCHAR;
7895 }
7896 
7897 template <int texType, enum hipTextureReadMode mode>
7898 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture<uchar1, texType, mode> texRef, float x,
7899  int layer) {
7900  TEXTURE_REF_PARAMETERS_INIT;
7901  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7902  TEXTURE_RETURN_UCHAR_X;
7903 }
7904 
7905 template <int texType, enum hipTextureReadMode mode>
7906 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture<uchar2, texType, mode> texRef, float x,
7907  int layer) {
7908  TEXTURE_REF_PARAMETERS_INIT;
7909  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7910  TEXTURE_RETURN_UCHAR_XY;
7911 }
7912 
7913 template <int texType, enum hipTextureReadMode mode>
7914 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture<uchar4, texType, mode> texRef, float x,
7915  int layer) {
7916  TEXTURE_REF_PARAMETERS_INIT;
7917  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7918  TEXTURE_RETURN_UCHAR_XYZW;
7919 }
7920 
7921 template <int texType, enum hipTextureReadMode mode>
7922 __TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture<short, texType, mode> texRef, float x,
7923  int layer) {
7924  TEXTURE_REF_PARAMETERS_INIT;
7925  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7926  TEXTURE_RETURN_SHORT;
7927 }
7928 
7929 template <int texType, enum hipTextureReadMode mode>
7930 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture<short1, texType, mode> texRef, float x,
7931  int layer) {
7932  TEXTURE_REF_PARAMETERS_INIT;
7933  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7934  TEXTURE_RETURN_SHORT_X;
7935 }
7936 
7937 template <int texType, enum hipTextureReadMode mode>
7938 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture<short2, texType, mode> texRef, float x,
7939  int layer) {
7940  TEXTURE_REF_PARAMETERS_INIT;
7941  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7942  TEXTURE_RETURN_SHORT_XY;
7943 }
7944 
7945 template <int texType, enum hipTextureReadMode mode>
7946 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture<short4, texType, mode> texRef, float x,
7947  int layer) {
7948  TEXTURE_REF_PARAMETERS_INIT;
7949  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7950  TEXTURE_RETURN_SHORT_XYZW;
7951 }
7952 
7953 template <int texType, enum hipTextureReadMode mode>
7954 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered(
7955  texture<unsigned short, texType, mode> texRef, float x, int layer) {
7956  TEXTURE_REF_PARAMETERS_INIT;
7957  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7958  TEXTURE_RETURN_USHORT;
7959 }
7960 
7961 template <int texType, enum hipTextureReadMode mode>
7962 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture<ushort1, texType, mode> texRef, float x,
7963  int layer) {
7964  TEXTURE_REF_PARAMETERS_INIT;
7965  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7966  TEXTURE_RETURN_USHORT_X;
7967 }
7968 
7969 template <int texType, enum hipTextureReadMode mode>
7970 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture<ushort2, texType, mode> texRef, float x,
7971  int layer) {
7972  TEXTURE_REF_PARAMETERS_INIT;
7973  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7974  TEXTURE_RETURN_USHORT_XY;
7975 }
7976 
7977 template <int texType, enum hipTextureReadMode mode>
7978 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture<ushort4, texType, mode> texRef, float x,
7979  int layer) {
7980  TEXTURE_REF_PARAMETERS_INIT;
7981  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7982  TEXTURE_RETURN_USHORT_XYZW;
7983 }
7984 
7985 template <int texType, enum hipTextureReadMode mode>
7986 __TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture<int, texType, mode> texRef, float x,
7987  int layer) {
7988  TEXTURE_REF_PARAMETERS_INIT;
7989  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7990  TEXTURE_RETURN_INT;
7991 }
7992 
7993 template <int texType, enum hipTextureReadMode mode>
7994 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture<int1, texType, mode> texRef, float x,
7995  int layer) {
7996  TEXTURE_REF_PARAMETERS_INIT;
7997  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
7998  TEXTURE_RETURN_INT_X;
7999 }
8000 
8001 template <int texType, enum hipTextureReadMode mode>
8002 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture<int2, texType, mode> texRef, float x,
8003  int layer) {
8004  TEXTURE_REF_PARAMETERS_INIT;
8005  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8006  TEXTURE_RETURN_INT_XY;
8007 }
8008 
8009 template <int texType, enum hipTextureReadMode mode>
8010 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture<int4, texType, mode> texRef, float x,
8011  int layer) {
8012  TEXTURE_REF_PARAMETERS_INIT;
8013  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8014  TEXTURE_RETURN_INT_XYZW;
8015 }
8016 
8017 template <int texType, enum hipTextureReadMode mode>
8018 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture<unsigned int, texType, mode> texRef,
8019  float x, int layer) {
8020  TEXTURE_REF_PARAMETERS_INIT;
8021  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8022  TEXTURE_RETURN_UINT;
8023 }
8024 
8025 template <int texType, enum hipTextureReadMode mode>
8026 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture<uint1, texType, mode> texRef, float x,
8027  int layer) {
8028  TEXTURE_REF_PARAMETERS_INIT;
8029  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8030  TEXTURE_RETURN_UINT_X;
8031 }
8032 
8033 template <int texType, enum hipTextureReadMode mode>
8034 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture<uint2, texType, mode> texRef, float x,
8035  int layer) {
8036  TEXTURE_REF_PARAMETERS_INIT;
8037  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8038  TEXTURE_RETURN_UINT_XY;
8039 }
8040 
8041 template <int texType, enum hipTextureReadMode mode>
8042 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture<uint4, texType, mode> texRef, float x,
8043  int layer) {
8044  TEXTURE_REF_PARAMETERS_INIT;
8045  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8046  TEXTURE_RETURN_UINT_XYZW;
8047 }
8048 
8049 template <int texType, enum hipTextureReadMode mode>
8050 __TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture<float, texType, mode> texRef, float x,
8051  int layer) {
8052  TEXTURE_REF_PARAMETERS_INIT;
8053  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8054  TEXTURE_RETURN_FLOAT;
8055 }
8056 
8057 template <int texType, enum hipTextureReadMode mode>
8058 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture<float1, texType, mode> texRef, float x,
8059  int layer) {
8060  TEXTURE_REF_PARAMETERS_INIT;
8061  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8062  TEXTURE_RETURN_FLOAT_X;
8063 }
8064 
8065 template <int texType, enum hipTextureReadMode mode>
8066 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture<float2, texType, mode> texRef, float x,
8067  int layer) {
8068  TEXTURE_REF_PARAMETERS_INIT;
8069  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8070  TEXTURE_RETURN_FLOAT_XY;
8071 }
8072 
8073 template <int texType, enum hipTextureReadMode mode>
8074 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture<float4, texType, mode> texRef, float x,
8075  int layer) {
8076  TEXTURE_REF_PARAMETERS_INIT;
8077  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8078  TEXTURE_RETURN_FLOAT_XYZW;
8079 }
8080 
8082 
8083 template <int texType, enum hipTextureReadMode mode>
8084 __TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture<char, texType, mode> texRef,
8085  hipTextureObject_t textureObject, float x, int layer) {
8086  TEXTURE_PARAMETERS_INIT;
8087  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8088  TEXTURE_RETURN_CHAR;
8089 }
8090 
8091 template <int texType, enum hipTextureReadMode mode>
8092 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture<char1, texType, mode> texRef,
8093  hipTextureObject_t textureObject, float x,
8094  int layer) {
8095  TEXTURE_PARAMETERS_INIT;
8096  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8097  TEXTURE_RETURN_CHAR_X;
8098 }
8099 
8100 template <int texType, enum hipTextureReadMode mode>
8101 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture<char2, texType, mode> texRef,
8102  hipTextureObject_t textureObject, float x,
8103  int layer) {
8104  TEXTURE_PARAMETERS_INIT;
8105  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8106  TEXTURE_RETURN_CHAR_XY;
8107 }
8108 
8109 template <int texType, enum hipTextureReadMode mode>
8110 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture<char4, texType, mode> texRef,
8111  hipTextureObject_t textureObject, float x,
8112  int layer) {
8113  TEXTURE_PARAMETERS_INIT;
8114  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8115  TEXTURE_RETURN_CHAR_XYZW;
8116 }
8117 
8118 template <int texType, enum hipTextureReadMode mode>
8119 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture<unsigned char, texType, mode> texRef,
8120  hipTextureObject_t textureObject, float x,
8121  int layer) {
8122  TEXTURE_PARAMETERS_INIT;
8123  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8124  TEXTURE_RETURN_UCHAR;
8125 }
8126 
8127 template <int texType, enum hipTextureReadMode mode>
8128 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture<uchar1, texType, mode> texRef,
8129  hipTextureObject_t textureObject, float x,
8130  int layer) {
8131  TEXTURE_PARAMETERS_INIT;
8132  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8133  TEXTURE_RETURN_UCHAR_X;
8134 }
8135 
8136 template <int texType, enum hipTextureReadMode mode>
8137 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture<uchar2, texType, mode> texRef,
8138  hipTextureObject_t textureObject, float x,
8139  int layer) {
8140  TEXTURE_PARAMETERS_INIT;
8141  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8142  TEXTURE_RETURN_UCHAR_XY;
8143 }
8144 
8145 template <int texType, enum hipTextureReadMode mode>
8146 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture<uchar4, texType, mode> texRef,
8147  hipTextureObject_t textureObject, float x,
8148  int layer) {
8149  TEXTURE_PARAMETERS_INIT;
8150  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8151  TEXTURE_RETURN_UCHAR_XYZW;
8152 }
8153 
8154 template <int texType, enum hipTextureReadMode mode>
8155 __TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture<short, texType, mode> texRef,
8156  hipTextureObject_t textureObject, float x,
8157  int layer) {
8158  TEXTURE_PARAMETERS_INIT;
8159  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8160  TEXTURE_RETURN_SHORT;
8161 }
8162 
8163 template <int texType, enum hipTextureReadMode mode>
8164 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture<short1, texType, mode> texRef,
8165  hipTextureObject_t textureObject, float x,
8166  int layer) {
8167  TEXTURE_PARAMETERS_INIT;
8168  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8169  TEXTURE_RETURN_SHORT_X;
8170 }
8171 
8172 template <int texType, enum hipTextureReadMode mode>
8173 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture<short2, texType, mode> texRef,
8174  hipTextureObject_t textureObject, float x,
8175  int layer) {
8176  TEXTURE_PARAMETERS_INIT;
8177  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8178  TEXTURE_RETURN_SHORT_XY;
8179 }
8180 
8181 template <int texType, enum hipTextureReadMode mode>
8182 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture<short4, texType, mode> texRef,
8183  hipTextureObject_t textureObject, float x,
8184  int layer) {
8185  TEXTURE_PARAMETERS_INIT;
8186  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8187  TEXTURE_RETURN_SHORT_XYZW;
8188 }
8189 
8190 template <int texType, enum hipTextureReadMode mode>
8191 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered(
8192  texture<unsigned short, texType, mode> texRef, hipTextureObject_t textureObject, float x,
8193  int layer) {
8194  TEXTURE_PARAMETERS_INIT;
8195  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8196  TEXTURE_RETURN_USHORT;
8197 }
8198 
8199 template <int texType, enum hipTextureReadMode mode>
8200 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture<ushort1, texType, mode> texRef,
8201  hipTextureObject_t textureObject, float x,
8202  int layer) {
8203  TEXTURE_PARAMETERS_INIT;
8204  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8205  TEXTURE_RETURN_USHORT_X;
8206 }
8207 
8208 template <int texType, enum hipTextureReadMode mode>
8209 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture<ushort2, texType, mode> texRef,
8210  hipTextureObject_t textureObject, float x,
8211  int layer) {
8212  TEXTURE_PARAMETERS_INIT;
8213  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8214  TEXTURE_RETURN_USHORT_XY;
8215 }
8216 
8217 template <int texType, enum hipTextureReadMode mode>
8218 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture<ushort4, texType, mode> texRef,
8219  hipTextureObject_t textureObject, float x,
8220  int layer) {
8221  TEXTURE_PARAMETERS_INIT;
8222  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8223  TEXTURE_RETURN_USHORT_XYZW;
8224 }
8225 
8226 template <int texType, enum hipTextureReadMode mode>
8227 __TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture<int, texType, mode> texRef,
8228  hipTextureObject_t textureObject, float x, int layer) {
8229  TEXTURE_PARAMETERS_INIT;
8230  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8231  TEXTURE_RETURN_INT;
8232 }
8233 
8234 template <int texType, enum hipTextureReadMode mode>
8235 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture<int1, texType, mode> texRef,
8236  hipTextureObject_t textureObject, float x, int layer) {
8237  TEXTURE_PARAMETERS_INIT;
8238  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8239  TEXTURE_RETURN_INT_X;
8240 }
8241 
8242 template <int texType, enum hipTextureReadMode mode>
8243 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture<int2, texType, mode> texRef,
8244  hipTextureObject_t textureObject, float x, int layer) {
8245  TEXTURE_PARAMETERS_INIT;
8246  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8247  TEXTURE_RETURN_INT_XY;
8248 }
8249 
8250 template <int texType, enum hipTextureReadMode mode>
8251 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture<int4, texType, mode> texRef,
8252  hipTextureObject_t textureObject, float x, int layer) {
8253  TEXTURE_PARAMETERS_INIT;
8254  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8255  TEXTURE_RETURN_INT_XYZW;
8256 }
8257 
8258 template <int texType, enum hipTextureReadMode mode>
8259 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture<unsigned int, texType, mode> texRef,
8260  hipTextureObject_t textureObject, float x,
8261  int layer) {
8262  TEXTURE_PARAMETERS_INIT;
8263  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8264  TEXTURE_RETURN_UINT;
8265 }
8266 
8267 template <int texType, enum hipTextureReadMode mode>
8268 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture<uint1, texType, mode> texRef,
8269  hipTextureObject_t textureObject, float x,
8270  int layer) {
8271  TEXTURE_PARAMETERS_INIT;
8272  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8273  TEXTURE_RETURN_UINT_X;
8274 }
8275 
8276 template <int texType, enum hipTextureReadMode mode>
8277 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture<uint2, texType, mode> texRef,
8278  hipTextureObject_t textureObject, float x,
8279  int layer) {
8280  TEXTURE_PARAMETERS_INIT;
8281  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8282  TEXTURE_RETURN_UINT_XY;
8283 }
8284 
8285 template <int texType, enum hipTextureReadMode mode>
8286 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture<uint4, texType, mode> texRef,
8287  hipTextureObject_t textureObject, float x,
8288  int layer) {
8289  TEXTURE_PARAMETERS_INIT;
8290  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8291  TEXTURE_RETURN_UINT_XYZW;
8292 }
8293 
8294 template <int texType, enum hipTextureReadMode mode>
8295 __TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture<float, texType, mode> texRef,
8296  hipTextureObject_t textureObject, float x,
8297  int layer) {
8298  TEXTURE_PARAMETERS_INIT;
8299  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8300  TEXTURE_RETURN_FLOAT;
8301 }
8302 
8303 template <int texType, enum hipTextureReadMode mode>
8304 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture<float1, texType, mode> texRef,
8305  hipTextureObject_t textureObject, float x,
8306  int layer) {
8307  TEXTURE_PARAMETERS_INIT;
8308  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8309  TEXTURE_RETURN_FLOAT_X;
8310 }
8311 
8312 template <int texType, enum hipTextureReadMode mode>
8313 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture<float2, texType, mode> texRef,
8314  hipTextureObject_t textureObject, float x,
8315  int layer) {
8316  TEXTURE_PARAMETERS_INIT;
8317  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8318  TEXTURE_RETURN_FLOAT_XY;
8319 }
8320 
8321 template <int texType, enum hipTextureReadMode mode>
8322 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture<float4, texType, mode> texRef,
8323  hipTextureObject_t textureObject, float x,
8324  int layer) {
8325  TEXTURE_PARAMETERS_INIT;
8326  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
8327  TEXTURE_RETURN_FLOAT_XYZW;
8328 }
8329 
8331 
8332 template <int texType, enum hipTextureReadMode mode>
8333 __TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture<char, texType, mode> texRef, float x,
8334  int layer, float level) {
8335  TEXTURE_REF_PARAMETERS_INIT;
8336  texel.f =
8337  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8338  TEXTURE_RETURN_CHAR;
8339 }
8340 
8341 template <int texType, enum hipTextureReadMode mode>
8342 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture<char1, texType, mode> texRef, float x,
8343  int layer, float level) {
8344  TEXTURE_REF_PARAMETERS_INIT;
8345  texel.f =
8346  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8347  TEXTURE_RETURN_CHAR_X;
8348 }
8349 
8350 template <int texType, enum hipTextureReadMode mode>
8351 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture<char2, texType, mode> texRef, float x,
8352  int layer, float level) {
8353  TEXTURE_REF_PARAMETERS_INIT;
8354  texel.f =
8355  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8356  TEXTURE_RETURN_CHAR_XY;
8357 }
8358 
8359 template <int texType, enum hipTextureReadMode mode>
8360 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture<char4, texType, mode> texRef, float x,
8361  int layer, float level) {
8362  TEXTURE_REF_PARAMETERS_INIT;
8363  texel.f =
8364  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8365  TEXTURE_RETURN_CHAR_XYZW;
8366 }
8367 
8368 template <int texType, enum hipTextureReadMode mode>
8369 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod(
8370  texture<unsigned char, texType, mode> texRef, float x, int layer, float level) {
8371  TEXTURE_REF_PARAMETERS_INIT;
8372  texel.f =
8373  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8374  TEXTURE_RETURN_UCHAR;
8375 }
8376 
8377 template <int texType, enum hipTextureReadMode mode>
8378 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture<uchar1, texType, mode> texRef, float x,
8379  int layer, float level) {
8380  TEXTURE_REF_PARAMETERS_INIT;
8381  texel.f =
8382  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8383  TEXTURE_RETURN_UCHAR_X;
8384 }
8385 
8386 template <int texType, enum hipTextureReadMode mode>
8387 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture<uchar2, texType, mode> texRef, float x,
8388  int layer, float level) {
8389  TEXTURE_REF_PARAMETERS_INIT;
8390  texel.f =
8391  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8392  TEXTURE_RETURN_UCHAR_XY;
8393 }
8394 
8395 template <int texType, enum hipTextureReadMode mode>
8396 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture<uchar4, texType, mode> texRef, float x,
8397  int layer, float level) {
8398  TEXTURE_REF_PARAMETERS_INIT;
8399  texel.f =
8400  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8401  TEXTURE_RETURN_UCHAR_XYZW;
8402 }
8403 
8404 template <int texType, enum hipTextureReadMode mode>
8405 __TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture<short, texType, mode> texRef, float x,
8406  int layer, float level) {
8407  TEXTURE_REF_PARAMETERS_INIT;
8408  texel.f =
8409  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8410  TEXTURE_RETURN_SHORT;
8411 }
8412 
8413 template <int texType, enum hipTextureReadMode mode>
8414 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture<short1, texType, mode> texRef, float x,
8415  int layer, float level) {
8416  TEXTURE_REF_PARAMETERS_INIT;
8417  texel.f =
8418  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8419  TEXTURE_RETURN_SHORT_X;
8420 }
8421 
8422 template <int texType, enum hipTextureReadMode mode>
8423 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture<short2, texType, mode> texRef, float x,
8424  int layer, float level) {
8425  TEXTURE_REF_PARAMETERS_INIT;
8426  texel.f =
8427  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8428  TEXTURE_RETURN_SHORT_XY;
8429 }
8430 
8431 template <int texType, enum hipTextureReadMode mode>
8432 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture<short4, texType, mode> texRef, float x,
8433  int layer, float level) {
8434  TEXTURE_REF_PARAMETERS_INIT;
8435  texel.f =
8436  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8437  TEXTURE_RETURN_SHORT_XYZW;
8438 }
8439 
8440 template <int texType, enum hipTextureReadMode mode>
8441 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod(
8442  texture<unsigned short, texType, mode> texRef, float x, int layer, float level) {
8443  TEXTURE_REF_PARAMETERS_INIT;
8444  texel.f =
8445  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8446  TEXTURE_RETURN_USHORT;
8447 }
8448 
8449 template <int texType, enum hipTextureReadMode mode>
8450 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture<ushort1, texType, mode> texRef, float x,
8451  int layer, float level) {
8452  TEXTURE_REF_PARAMETERS_INIT;
8453  texel.f =
8454  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8455  TEXTURE_RETURN_USHORT_X;
8456 }
8457 
8458 template <int texType, enum hipTextureReadMode mode>
8459 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture<ushort2, texType, mode> texRef, float x,
8460  int layer, float level) {
8461  TEXTURE_REF_PARAMETERS_INIT;
8462  texel.f =
8463  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8464  TEXTURE_RETURN_USHORT_XY;
8465 }
8466 
8467 template <int texType, enum hipTextureReadMode mode>
8468 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture<ushort4, texType, mode> texRef, float x,
8469  int layer, float level) {
8470  TEXTURE_REF_PARAMETERS_INIT;
8471  texel.f =
8472  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8473  TEXTURE_RETURN_USHORT_XYZW;
8474 }
8475 
8476 template <int texType, enum hipTextureReadMode mode>
8477 __TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture<int, texType, mode> texRef, float x,
8478  int layer, float level) {
8479  TEXTURE_REF_PARAMETERS_INIT;
8480  texel.f =
8481  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8482  TEXTURE_RETURN_INT;
8483 }
8484 
8485 template <int texType, enum hipTextureReadMode mode>
8486 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture<int1, texType, mode> texRef, float x,
8487  int layer, float level) {
8488  TEXTURE_REF_PARAMETERS_INIT;
8489  texel.f =
8490  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8491  TEXTURE_RETURN_INT_X;
8492 }
8493 
8494 template <int texType, enum hipTextureReadMode mode>
8495 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture<int2, texType, mode> texRef, float x,
8496  int layer, float level) {
8497  TEXTURE_REF_PARAMETERS_INIT;
8498  texel.f =
8499  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8500  TEXTURE_RETURN_INT_XY;
8501 }
8502 
8503 template <int texType, enum hipTextureReadMode mode>
8504 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture<int4, texType, mode> texRef, float x,
8505  int layer, float level) {
8506  TEXTURE_REF_PARAMETERS_INIT;
8507  texel.f =
8508  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8509  TEXTURE_RETURN_INT_XYZW;
8510 }
8511 
8512 template <int texType, enum hipTextureReadMode mode>
8513 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture<unsigned int, texType, mode> texRef,
8514  float x, int layer, float level) {
8515  TEXTURE_REF_PARAMETERS_INIT;
8516  texel.f =
8517  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8518  TEXTURE_RETURN_UINT;
8519 }
8520 
8521 template <int texType, enum hipTextureReadMode mode>
8522 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture<uint1, texType, mode> texRef, float x,
8523  int layer, float level) {
8524  TEXTURE_REF_PARAMETERS_INIT;
8525  texel.f =
8526  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8527  TEXTURE_RETURN_UINT_X;
8528 }
8529 
8530 template <int texType, enum hipTextureReadMode mode>
8531 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture<uint2, texType, mode> texRef, float x,
8532  int layer, float level) {
8533  TEXTURE_REF_PARAMETERS_INIT;
8534  texel.f =
8535  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8536  TEXTURE_RETURN_UINT_XY;
8537 }
8538 
8539 template <int texType, enum hipTextureReadMode mode>
8540 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture<uint4, texType, mode> texRef, float x,
8541  int layer, float level) {
8542  TEXTURE_REF_PARAMETERS_INIT;
8543  texel.f =
8544  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8545  TEXTURE_RETURN_UINT_XYZW;
8546 }
8547 
8548 template <int texType, enum hipTextureReadMode mode>
8549 __TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture<float, texType, mode> texRef, float x,
8550  int layer, float level) {
8551  TEXTURE_REF_PARAMETERS_INIT;
8552  texel.f =
8553  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8554  TEXTURE_RETURN_FLOAT;
8555 }
8556 
8557 template <int texType, enum hipTextureReadMode mode>
8558 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture<float1, texType, mode> texRef, float x,
8559  int layer, float level) {
8560  TEXTURE_REF_PARAMETERS_INIT;
8561  texel.f =
8562  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8563  TEXTURE_RETURN_FLOAT_X;
8564 }
8565 
8566 template <int texType, enum hipTextureReadMode mode>
8567 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture<float2, texType, mode> texRef, float x,
8568  int layer, float level) {
8569  TEXTURE_REF_PARAMETERS_INIT;
8570  texel.f =
8571  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8572  TEXTURE_RETURN_FLOAT_XY;
8573 }
8574 
8575 template <int texType, enum hipTextureReadMode mode>
8576 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture<float4, texType, mode> texRef, float x,
8577  int layer, float level) {
8578  TEXTURE_REF_PARAMETERS_INIT;
8579  texel.f =
8580  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8581  TEXTURE_RETURN_FLOAT_XYZW;
8582 }
8583 
8585 
8586 template <int texType, enum hipTextureReadMode mode>
8587 __TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture<char, texType, mode> texRef,
8588  hipTextureObject_t textureObject, float x,
8589  int layer, float level) {
8590  TEXTURE_PARAMETERS_INIT;
8591  texel.f =
8592  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8593  TEXTURE_RETURN_CHAR;
8594 }
8595 
8596 template <int texType, enum hipTextureReadMode mode>
8597 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture<char1, texType, mode> texRef,
8598  hipTextureObject_t textureObject, float x,
8599  int layer, float level) {
8600  TEXTURE_PARAMETERS_INIT;
8601  texel.f =
8602  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8603  TEXTURE_RETURN_CHAR_X;
8604 }
8605 
8606 template <int texType, enum hipTextureReadMode mode>
8607 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture<char2, texType, mode> texRef,
8608  hipTextureObject_t textureObject, float x,
8609  int layer, float level) {
8610  TEXTURE_PARAMETERS_INIT;
8611  texel.f =
8612  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8613  TEXTURE_RETURN_CHAR_XY;
8614 }
8615 
8616 template <int texType, enum hipTextureReadMode mode>
8617 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture<char4, texType, mode> texRef,
8618  hipTextureObject_t textureObject, float x,
8619  int layer, float level) {
8620  TEXTURE_PARAMETERS_INIT;
8621  texel.f =
8622  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8623  TEXTURE_RETURN_CHAR_XYZW;
8624 }
8625 
8626 template <int texType, enum hipTextureReadMode mode>
8627 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod(
8628  texture<unsigned char, texType, mode> texRef, hipTextureObject_t textureObject, float x,
8629  int layer, float level) {
8630  TEXTURE_PARAMETERS_INIT;
8631  texel.f =
8632  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8633  TEXTURE_RETURN_UCHAR;
8634 }
8635 
8636 template <int texType, enum hipTextureReadMode mode>
8637 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture<uchar1, texType, mode> texRef,
8638  hipTextureObject_t textureObject, float x,
8639  int layer, float level) {
8640  TEXTURE_PARAMETERS_INIT;
8641  texel.f =
8642  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8643  TEXTURE_RETURN_UCHAR_X;
8644 }
8645 
8646 template <int texType, enum hipTextureReadMode mode>
8647 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture<uchar2, texType, mode> texRef,
8648  hipTextureObject_t textureObject, float x,
8649  int layer, float level) {
8650  TEXTURE_PARAMETERS_INIT;
8651  texel.f =
8652  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8653  TEXTURE_RETURN_UCHAR_XY;
8654 }
8655 
8656 template <int texType, enum hipTextureReadMode mode>
8657 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture<uchar4, texType, mode> texRef,
8658  hipTextureObject_t textureObject, float x,
8659  int layer, float level) {
8660  TEXTURE_PARAMETERS_INIT;
8661  texel.f =
8662  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8663  TEXTURE_RETURN_UCHAR_XYZW;
8664 }
8665 
8666 template <int texType, enum hipTextureReadMode mode>
8667 __TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture<short, texType, mode> texRef,
8668  hipTextureObject_t textureObject, float x,
8669  int layer, float level) {
8670  TEXTURE_PARAMETERS_INIT;
8671  texel.f =
8672  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8673  TEXTURE_RETURN_SHORT;
8674 }
8675 
8676 template <int texType, enum hipTextureReadMode mode>
8677 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture<short1, texType, mode> texRef,
8678  hipTextureObject_t textureObject, float x,
8679  int layer, float level) {
8680  TEXTURE_PARAMETERS_INIT;
8681  texel.f =
8682  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8683  TEXTURE_RETURN_SHORT_X;
8684 }
8685 
8686 template <int texType, enum hipTextureReadMode mode>
8687 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture<short2, texType, mode> texRef,
8688  hipTextureObject_t textureObject, float x,
8689  int layer, float level) {
8690  TEXTURE_PARAMETERS_INIT;
8691  texel.f =
8692  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8693  TEXTURE_RETURN_SHORT_XY;
8694 }
8695 
8696 template <int texType, enum hipTextureReadMode mode>
8697 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture<short4, texType, mode> texRef,
8698  hipTextureObject_t textureObject, float x,
8699  int layer, float level) {
8700  TEXTURE_PARAMETERS_INIT;
8701  texel.f =
8702  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8703  TEXTURE_RETURN_SHORT_XYZW;
8704 }
8705 
8706 template <int texType, enum hipTextureReadMode mode>
8707 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod(
8708  texture<unsigned short, texType, mode> texRef, hipTextureObject_t textureObject, float x,
8709  int layer, float level) {
8710  TEXTURE_PARAMETERS_INIT;
8711  texel.f =
8712  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8713  TEXTURE_RETURN_USHORT;
8714 }
8715 
8716 template <int texType, enum hipTextureReadMode mode>
8717 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture<ushort1, texType, mode> texRef,
8718  hipTextureObject_t textureObject, float x,
8719  int layer, float level) {
8720  TEXTURE_PARAMETERS_INIT;
8721  texel.f =
8722  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8723  TEXTURE_RETURN_USHORT_X;
8724 }
8725 
8726 template <int texType, enum hipTextureReadMode mode>
8727 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture<ushort2, texType, mode> texRef,
8728  hipTextureObject_t textureObject, float x,
8729  int layer, float level) {
8730  TEXTURE_PARAMETERS_INIT;
8731  texel.f =
8732  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8733  TEXTURE_RETURN_USHORT_XY;
8734 }
8735 
8736 template <int texType, enum hipTextureReadMode mode>
8737 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture<ushort4, texType, mode> texRef,
8738  hipTextureObject_t textureObject, float x,
8739  int layer, float level) {
8740  TEXTURE_PARAMETERS_INIT;
8741  texel.f =
8742  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8743  TEXTURE_RETURN_USHORT_XYZW;
8744 }
8745 
8746 template <int texType, enum hipTextureReadMode mode>
8747 __TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture<int, texType, mode> texRef,
8748  hipTextureObject_t textureObject, float x, int layer,
8749  float level) {
8750  TEXTURE_PARAMETERS_INIT;
8751  texel.f =
8752  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8753  TEXTURE_RETURN_INT;
8754 }
8755 
8756 template <int texType, enum hipTextureReadMode mode>
8757 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture<int1, texType, mode> texRef,
8758  hipTextureObject_t textureObject, float x,
8759  int layer, float level) {
8760  TEXTURE_PARAMETERS_INIT;
8761  texel.f =
8762  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8763  TEXTURE_RETURN_INT_X;
8764 }
8765 
8766 template <int texType, enum hipTextureReadMode mode>
8767 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture<int2, texType, mode> texRef,
8768  hipTextureObject_t textureObject, float x,
8769  int layer, float level) {
8770  TEXTURE_PARAMETERS_INIT;
8771  texel.f =
8772  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8773  TEXTURE_RETURN_INT_XY;
8774 }
8775 
8776 template <int texType, enum hipTextureReadMode mode>
8777 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture<int4, texType, mode> texRef,
8778  hipTextureObject_t textureObject, float x,
8779  int layer, float level) {
8780  TEXTURE_PARAMETERS_INIT;
8781  texel.f =
8782  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8783  TEXTURE_RETURN_INT_XYZW;
8784 }
8785 
8786 template <int texType, enum hipTextureReadMode mode>
8787 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture<unsigned int, texType, mode> texRef,
8788  hipTextureObject_t textureObject, float x,
8789  int layer, float level) {
8790  TEXTURE_PARAMETERS_INIT;
8791  texel.f =
8792  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8793  TEXTURE_RETURN_UINT;
8794 }
8795 
8796 template <int texType, enum hipTextureReadMode mode>
8797 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture<uint1, texType, mode> texRef,
8798  hipTextureObject_t textureObject, float x,
8799  int layer, float level) {
8800  TEXTURE_PARAMETERS_INIT;
8801  texel.f =
8802  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8803  TEXTURE_RETURN_UINT_X;
8804 }
8805 
8806 template <int texType, enum hipTextureReadMode mode>
8807 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture<uint2, texType, mode> texRef,
8808  hipTextureObject_t textureObject, float x,
8809  int layer, float level) {
8810  TEXTURE_PARAMETERS_INIT;
8811  texel.f =
8812  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8813  TEXTURE_RETURN_UINT_XY;
8814 }
8815 
8816 template <int texType, enum hipTextureReadMode mode>
8817 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture<uint4, texType, mode> texRef,
8818  hipTextureObject_t textureObject, float x,
8819  int layer, float level) {
8820  TEXTURE_PARAMETERS_INIT;
8821  texel.f =
8822  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8823  TEXTURE_RETURN_UINT_XYZW;
8824 }
8825 
8826 template <int texType, enum hipTextureReadMode mode>
8827 __TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture<float, texType, mode> texRef,
8828  hipTextureObject_t textureObject, float x,
8829  int layer, float level) {
8830  TEXTURE_PARAMETERS_INIT;
8831  texel.f =
8832  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8833  TEXTURE_RETURN_FLOAT;
8834 }
8835 
8836 template <int texType, enum hipTextureReadMode mode>
8837 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture<float1, texType, mode> texRef,
8838  hipTextureObject_t textureObject, float x,
8839  int layer, float level) {
8840  TEXTURE_PARAMETERS_INIT;
8841  texel.f =
8842  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8843  TEXTURE_RETURN_FLOAT_X;
8844 }
8845 
8846 template <int texType, enum hipTextureReadMode mode>
8847 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture<float2, texType, mode> texRef,
8848  hipTextureObject_t textureObject, float x,
8849  int layer, float level) {
8850  TEXTURE_PARAMETERS_INIT;
8851  texel.f =
8852  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8853  TEXTURE_RETURN_FLOAT_XY;
8854 }
8855 
8856 template <int texType, enum hipTextureReadMode mode>
8857 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture<float4, texType, mode> texRef,
8858  hipTextureObject_t textureObject, float x,
8859  int layer, float level) {
8860  TEXTURE_PARAMETERS_INIT;
8861  texel.f =
8862  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
8863  TEXTURE_RETURN_FLOAT_XYZW;
8864 }
8865 
8867 
8868 template <int texType, enum hipTextureReadMode mode>
8869 __TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture<char, texType, mode> texRef, float x,
8870  int layer, float dx, float dy) {
8871  TEXTURE_REF_PARAMETERS_INIT;
8872  texel.f =
8873  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8874  TEXTURE_RETURN_CHAR;
8875 }
8876 
8877 template <int texType, enum hipTextureReadMode mode>
8878 __TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture<char, texType, mode> texRef,
8879  hipTextureObject_t textureObject, float x,
8880  int layer, float dx, float dy) {
8881  TEXTURE_PARAMETERS_INIT;
8882  texel.f =
8883  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8884  TEXTURE_RETURN_CHAR;
8885 }
8886 
8887 template <int texType, enum hipTextureReadMode mode>
8888 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture<char1, texType, mode> texRef, float x,
8889  int layer, float dx, float dy) {
8890  TEXTURE_REF_PARAMETERS_INIT;
8891  texel.f =
8892  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8893  TEXTURE_RETURN_CHAR_X;
8894 }
8895 
8896 template <int texType, enum hipTextureReadMode mode>
8897 __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture<char1, texType, mode> texRef,
8898  hipTextureObject_t textureObject, float x,
8899  int layer, float dx, float dy) {
8900  TEXTURE_PARAMETERS_INIT;
8901  texel.f =
8902  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8903  TEXTURE_RETURN_CHAR_X;
8904 }
8905 
8906 template <int texType, enum hipTextureReadMode mode>
8907 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture<char2, texType, mode> texRef, float x,
8908  int layer, float dx, float dy) {
8909  TEXTURE_REF_PARAMETERS_INIT;
8910  texel.f =
8911  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8912  TEXTURE_RETURN_CHAR_XY;
8913 }
8914 
8915 template <int texType, enum hipTextureReadMode mode>
8916 __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture<char2, texType, mode> texRef,
8917  hipTextureObject_t textureObject, float x,
8918  int layer, float dx, float dy) {
8919  TEXTURE_PARAMETERS_INIT;
8920  texel.f =
8921  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8922  TEXTURE_RETURN_CHAR_XY;
8923 }
8924 
8925 template <int texType, enum hipTextureReadMode mode>
8926 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture<char4, texType, mode> texRef, float x,
8927  int layer, float dx, float dy) {
8928  TEXTURE_REF_PARAMETERS_INIT;
8929  texel.f =
8930  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8931  TEXTURE_RETURN_CHAR_XYZW;
8932 }
8933 
8934 template <int texType, enum hipTextureReadMode mode>
8935 __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture<char4, texType, mode> texRef,
8936  hipTextureObject_t textureObject, float x,
8937  int layer, float dx, float dy) {
8938  TEXTURE_PARAMETERS_INIT;
8939  texel.f =
8940  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8941  TEXTURE_RETURN_CHAR_XYZW;
8942 }
8943 
8944 template <int texType, enum hipTextureReadMode mode>
8945 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad(
8946  texture<unsigned char, texType, mode> texRef, float x, int layer, float dx, float dy) {
8947  TEXTURE_REF_PARAMETERS_INIT;
8948  texel.f =
8949  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8950  TEXTURE_RETURN_UCHAR;
8951 }
8952 
8953 template <int texType, enum hipTextureReadMode mode>
8954 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad(
8955  texture<unsigned char, texType, mode> texRef, hipTextureObject_t textureObject, float x,
8956  int layer, float dx, float dy) {
8957  TEXTURE_PARAMETERS_INIT;
8958  texel.f =
8959  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8960  TEXTURE_RETURN_UCHAR;
8961 }
8962 
8963 template <int texType, enum hipTextureReadMode mode>
8964 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture<uchar1, texType, mode> texRef, float x,
8965  int layer, float dx, float dy) {
8966  TEXTURE_REF_PARAMETERS_INIT;
8967  texel.f =
8968  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8969  TEXTURE_RETURN_UCHAR_X;
8970 }
8971 
8972 template <int texType, enum hipTextureReadMode mode>
8973 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture<uchar1, texType, mode> texRef,
8974  hipTextureObject_t textureObject, float x,
8975  int layer, float dx, float dy) {
8976  TEXTURE_PARAMETERS_INIT;
8977  texel.f =
8978  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8979  TEXTURE_RETURN_UCHAR_X;
8980 }
8981 
8982 template <int texType, enum hipTextureReadMode mode>
8983 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture<uchar2, texType, mode> texRef, float x,
8984  int layer, float dx, float dy) {
8985  TEXTURE_REF_PARAMETERS_INIT;
8986  texel.f =
8987  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8988  TEXTURE_RETURN_UCHAR_XY;
8989 }
8990 
8991 template <int texType, enum hipTextureReadMode mode>
8992 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture<uchar2, texType, mode> texRef,
8993  hipTextureObject_t textureObject, float x,
8994  int layer, float dx, float dy) {
8995  TEXTURE_PARAMETERS_INIT;
8996  texel.f =
8997  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
8998  TEXTURE_RETURN_UCHAR_XY;
8999 }
9000 
9001 template <int texType, enum hipTextureReadMode mode>
9002 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture<uchar4, texType, mode> texRef, float x,
9003  int layer, float dx, float dy) {
9004  TEXTURE_REF_PARAMETERS_INIT;
9005  texel.f =
9006  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9007  TEXTURE_RETURN_UCHAR_XYZW;
9008 }
9009 
9010 template <int texType, enum hipTextureReadMode mode>
9011 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture<uchar4, texType, mode> texRef,
9012  hipTextureObject_t textureObject, float x,
9013  int layer, float dx, float dy) {
9014  TEXTURE_PARAMETERS_INIT;
9015  texel.f =
9016  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9017  TEXTURE_RETURN_UCHAR_XYZW;
9018 }
9019 
9020 template <int texType, enum hipTextureReadMode mode>
9021 __TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture<short, texType, mode> texRef, float x,
9022  int layer, float dx, float dy) {
9023  TEXTURE_REF_PARAMETERS_INIT;
9024  texel.f =
9025  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9026  TEXTURE_RETURN_SHORT;
9027 }
9028 
9029 template <int texType, enum hipTextureReadMode mode>
9030 __TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture<short, texType, mode> texRef,
9031  hipTextureObject_t textureObject, float x,
9032  int layer, float dx, float dy) {
9033  TEXTURE_PARAMETERS_INIT;
9034  texel.f =
9035  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9036  TEXTURE_RETURN_SHORT;
9037 }
9038 
9039 template <int texType, enum hipTextureReadMode mode>
9040 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture<short1, texType, mode> texRef, float x,
9041  int layer, float dx, float dy) {
9042  TEXTURE_REF_PARAMETERS_INIT;
9043  texel.f =
9044  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9045  TEXTURE_RETURN_SHORT_X;
9046 }
9047 
9048 template <int texType, enum hipTextureReadMode mode>
9049 __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture<short1, texType, mode> texRef,
9050  hipTextureObject_t textureObject, float x,
9051  int layer, float dx, float dy) {
9052  TEXTURE_PARAMETERS_INIT;
9053  texel.f =
9054  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9055  TEXTURE_RETURN_SHORT_X;
9056 }
9057 
9058 template <int texType, enum hipTextureReadMode mode>
9059 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture<short2, texType, mode> texRef, float x,
9060  int layer, float dx, float dy) {
9061  TEXTURE_REF_PARAMETERS_INIT;
9062  texel.f =
9063  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9064  TEXTURE_RETURN_SHORT_XY;
9065 }
9066 
9067 template <int texType, enum hipTextureReadMode mode>
9068 __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture<short2, texType, mode> texRef,
9069  hipTextureObject_t textureObject, float x,
9070  int layer, float dx, float dy) {
9071  TEXTURE_PARAMETERS_INIT;
9072  texel.f =
9073  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9074  TEXTURE_RETURN_SHORT_XY;
9075 }
9076 
9077 template <int texType, enum hipTextureReadMode mode>
9078 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture<short4, texType, mode> texRef, float x,
9079  int layer, float dx, float dy) {
9080  TEXTURE_REF_PARAMETERS_INIT;
9081  texel.f =
9082  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9083  TEXTURE_RETURN_SHORT_XYZW;
9084 }
9085 
9086 template <int texType, enum hipTextureReadMode mode>
9087 __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture<short4, texType, mode> texRef,
9088  hipTextureObject_t textureObject, float x,
9089  int layer, float dx, float dy) {
9090  TEXTURE_PARAMETERS_INIT;
9091  texel.f =
9092  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9093  TEXTURE_RETURN_SHORT_XYZW;
9094 }
9095 
9096 template <int texType, enum hipTextureReadMode mode>
9097 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad(
9098  texture<unsigned short, texType, mode> texRef, float x, int layer, float dx, float dy) {
9099  TEXTURE_REF_PARAMETERS_INIT;
9100  texel.f =
9101  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9102  TEXTURE_RETURN_USHORT;
9103 }
9104 
9105 template <int texType, enum hipTextureReadMode mode>
9106 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad(
9107  texture<unsigned short, texType, mode> texRef, hipTextureObject_t textureObject, float x,
9108  int layer, float dx, float dy) {
9109  TEXTURE_PARAMETERS_INIT;
9110  texel.f =
9111  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9112  TEXTURE_RETURN_USHORT;
9113 }
9114 
9115 template <int texType, enum hipTextureReadMode mode>
9116 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture<ushort1, texType, mode> texRef, float x,
9117  int layer, float dx, float dy) {
9118  TEXTURE_REF_PARAMETERS_INIT;
9119  texel.f =
9120  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9121  TEXTURE_RETURN_USHORT_X;
9122 }
9123 
9124 template <int texType, enum hipTextureReadMode mode>
9125 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture<ushort1, texType, mode> texRef,
9126  hipTextureObject_t textureObject, float x,
9127  int layer, float dx, float dy) {
9128  TEXTURE_PARAMETERS_INIT;
9129  texel.f =
9130  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9131  TEXTURE_RETURN_USHORT_X;
9132 }
9133 
9134 template <int texType, enum hipTextureReadMode mode>
9135 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture<ushort2, texType, mode> texRef, float x,
9136  int layer, float dx, float dy) {
9137  TEXTURE_REF_PARAMETERS_INIT;
9138  texel.f =
9139  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9140  TEXTURE_RETURN_USHORT_XY;
9141 }
9142 
9143 template <int texType, enum hipTextureReadMode mode>
9144 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture<ushort2, texType, mode> texRef,
9145  hipTextureObject_t textureObject, float x,
9146  int layer, float dx, float dy) {
9147  TEXTURE_PARAMETERS_INIT;
9148  texel.f =
9149  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9150  TEXTURE_RETURN_USHORT_XY;
9151 }
9152 
9153 template <int texType, enum hipTextureReadMode mode>
9154 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture<ushort4, texType, mode> texRef, float x,
9155  int layer, float dx, float dy) {
9156  TEXTURE_REF_PARAMETERS_INIT;
9157  texel.f =
9158  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9159  TEXTURE_RETURN_USHORT_XYZW;
9160 }
9161 
9162 template <int texType, enum hipTextureReadMode mode>
9163 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture<ushort4, texType, mode> texRef,
9164  hipTextureObject_t textureObject, float x,
9165  int layer, float dx, float dy) {
9166  TEXTURE_PARAMETERS_INIT;
9167  texel.f =
9168  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9169  TEXTURE_RETURN_USHORT_XYZW;
9170 }
9171 
9172 template <int texType, enum hipTextureReadMode mode>
9173 __TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture<int, texType, mode> texRef, float x,
9174  int layer, float dx, float dy) {
9175  TEXTURE_REF_PARAMETERS_INIT;
9176  texel.f =
9177  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9178  TEXTURE_RETURN_INT;
9179 }
9180 
9181 template <int texType, enum hipTextureReadMode mode>
9182 __TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture<int, texType, mode> texRef,
9183  hipTextureObject_t textureObject, float x,
9184  int layer, float dx, float dy) {
9185  TEXTURE_PARAMETERS_INIT;
9186  texel.f =
9187  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9188  TEXTURE_RETURN_INT;
9189 }
9190 
9191 template <int texType, enum hipTextureReadMode mode>
9192 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture<int1, texType, mode> texRef, float x,
9193  int layer, float dx, float dy) {
9194  TEXTURE_REF_PARAMETERS_INIT;
9195  texel.f =
9196  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9197  TEXTURE_RETURN_INT_X;
9198 }
9199 
9200 template <int texType, enum hipTextureReadMode mode>
9201 __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture<int1, texType, mode> texRef,
9202  hipTextureObject_t textureObject, float x,
9203  int layer, float dx, float dy) {
9204  TEXTURE_PARAMETERS_INIT;
9205  texel.f =
9206  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9207  TEXTURE_RETURN_INT_X;
9208 }
9209 
9210 template <int texType, enum hipTextureReadMode mode>
9211 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture<int2, texType, mode> texRef, float x,
9212  int layer, float dx, float dy) {
9213  TEXTURE_REF_PARAMETERS_INIT;
9214  texel.f =
9215  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9216  TEXTURE_RETURN_INT_XY;
9217 }
9218 
9219 template <int texType, enum hipTextureReadMode mode>
9220 __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture<int2, texType, mode> texRef,
9221  hipTextureObject_t textureObject, float x,
9222  int layer, float dx, float dy) {
9223  TEXTURE_PARAMETERS_INIT;
9224  texel.f =
9225  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9226  TEXTURE_RETURN_INT_XY;
9227 }
9228 
9229 template <int texType, enum hipTextureReadMode mode>
9230 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture<int4, texType, mode> texRef, float x,
9231  int layer, float dx, float dy) {
9232  TEXTURE_REF_PARAMETERS_INIT;
9233  texel.f =
9234  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9235  TEXTURE_RETURN_INT_XYZW;
9236 }
9237 
9238 template <int texType, enum hipTextureReadMode mode>
9239 __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture<int4, texType, mode> texRef,
9240  hipTextureObject_t textureObject, float x,
9241  int layer, float dx, float dy) {
9242  TEXTURE_PARAMETERS_INIT;
9243  texel.f =
9244  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9245  TEXTURE_RETURN_INT_XYZW;
9246 }
9247 
9248 template <int texType, enum hipTextureReadMode mode>
9249 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad(
9250  texture<unsigned int, texType, mode> texRef, float x, int layer, float dx, float dy) {
9251  TEXTURE_REF_PARAMETERS_INIT;
9252  texel.f =
9253  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9254  TEXTURE_RETURN_UINT;
9255 }
9256 
9257 template <int texType, enum hipTextureReadMode mode>
9258 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad(
9259  texture<unsigned int, texType, mode> texRef, hipTextureObject_t textureObject, float x,
9260  int layer, float dx, float dy) {
9261  TEXTURE_PARAMETERS_INIT;
9262  texel.f =
9263  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9264  TEXTURE_RETURN_UINT;
9265 }
9266 
9267 template <int texType, enum hipTextureReadMode mode>
9268 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture<uint1, texType, mode> texRef, float x,
9269  int layer, float dx, float dy) {
9270  TEXTURE_REF_PARAMETERS_INIT;
9271  texel.f =
9272  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9273  TEXTURE_RETURN_UINT_X;
9274 }
9275 
9276 template <int texType, enum hipTextureReadMode mode>
9277 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture<uint1, texType, mode> texRef,
9278  hipTextureObject_t textureObject, float x,
9279  int layer, float dx, float dy) {
9280  TEXTURE_PARAMETERS_INIT;
9281  texel.f =
9282  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9283  TEXTURE_RETURN_UINT_X;
9284 }
9285 
9286 template <int texType, enum hipTextureReadMode mode>
9287 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture<uint2, texType, mode> texRef, float x,
9288  int layer, float dx, float dy) {
9289  TEXTURE_REF_PARAMETERS_INIT;
9290  texel.f =
9291  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9292  TEXTURE_RETURN_UINT_XY;
9293 }
9294 
9295 template <int texType, enum hipTextureReadMode mode>
9296 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture<uint2, texType, mode> texRef,
9297  hipTextureObject_t textureObject, float x,
9298  int layer, float dx, float dy) {
9299  TEXTURE_PARAMETERS_INIT;
9300  texel.f =
9301  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9302  TEXTURE_RETURN_UINT_XY;
9303 }
9304 
9305 template <int texType, enum hipTextureReadMode mode>
9306 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture<uint4, texType, mode> texRef, float x,
9307  int layer, float dx, float dy) {
9308  TEXTURE_REF_PARAMETERS_INIT;
9309  texel.f =
9310  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9311  TEXTURE_RETURN_UINT_XYZW;
9312 }
9313 
9314 template <int texType, enum hipTextureReadMode mode>
9315 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture<uint4, texType, mode> texRef,
9316  hipTextureObject_t textureObject, float x,
9317  int layer, float dx, float dy) {
9318  TEXTURE_PARAMETERS_INIT;
9319  texel.f =
9320  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9321  TEXTURE_RETURN_UINT_XYZW;
9322 }
9323 
9324 template <int texType, enum hipTextureReadMode mode>
9325 __TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture<float, texType, mode> texRef, float x,
9326  int layer, float dx, float dy) {
9327  TEXTURE_REF_PARAMETERS_INIT;
9328  texel.f =
9329  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9330  TEXTURE_RETURN_FLOAT;
9331 }
9332 
9333 template <int texType, enum hipTextureReadMode mode>
9334 __TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture<float, texType, mode> texRef,
9335  hipTextureObject_t textureObject, float x,
9336  int layer, float dx, float dy) {
9337  TEXTURE_PARAMETERS_INIT;
9338  texel.f =
9339  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9340  TEXTURE_RETURN_FLOAT;
9341 }
9342 
9343 template <int texType, enum hipTextureReadMode mode>
9344 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture<float1, texType, mode> texRef, float x,
9345  int layer, float dx, float dy) {
9346  TEXTURE_REF_PARAMETERS_INIT;
9347  texel.f =
9348  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9349  TEXTURE_RETURN_FLOAT_X;
9350 }
9351 
9352 template <int texType, enum hipTextureReadMode mode>
9353 __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture<float1, texType, mode> texRef,
9354  hipTextureObject_t textureObject, float x,
9355  int layer, float dx, float dy) {
9356  TEXTURE_PARAMETERS_INIT;
9357  texel.f =
9358  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9359  TEXTURE_RETURN_FLOAT_X;
9360 }
9361 
9362 template <int texType, enum hipTextureReadMode mode>
9363 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture<float2, texType, mode> texRef, float x,
9364  int layer, float dx, float dy) {
9365  TEXTURE_REF_PARAMETERS_INIT;
9366  texel.f =
9367  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9368  TEXTURE_RETURN_FLOAT_XY;
9369 }
9370 
9371 template <int texType, enum hipTextureReadMode mode>
9372 __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture<float2, texType, mode> texRef,
9373  hipTextureObject_t textureObject, float x,
9374  int layer, float dx, float dy) {
9375  TEXTURE_PARAMETERS_INIT;
9376  texel.f =
9377  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9378  TEXTURE_RETURN_FLOAT_XY;
9379 }
9380 
9381 template <int texType, enum hipTextureReadMode mode>
9382 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture<float4, texType, mode> texRef, float x,
9383  int layer, float dx, float dy) {
9384  TEXTURE_REF_PARAMETERS_INIT;
9385  texel.f =
9386  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9387  TEXTURE_RETURN_FLOAT_XYZW;
9388 }
9389 
9390 template <int texType, enum hipTextureReadMode mode>
9391 __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture<float4, texType, mode> texRef,
9392  hipTextureObject_t textureObject, float x,
9393  int layer, float dx, float dy) {
9394  TEXTURE_PARAMETERS_INIT;
9395  texel.f =
9396  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
9397  TEXTURE_RETURN_FLOAT_XYZW;
9398 }
9399 
9401 
9402 template <int texType, enum hipTextureReadMode mode>
9403 __TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture<char, texType, mode> texRef, float x, float y,
9404  int layer) {
9405  TEXTURE_REF_PARAMETERS_INIT;
9406  texel.f =
9407  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9408  TEXTURE_RETURN_CHAR;
9409 }
9410 
9411 template <int texType, enum hipTextureReadMode mode>
9412 __TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture<char, texType, mode> texRef,
9413  hipTextureObject_t textureObject, float x, float y,
9414  int layer) {
9415  TEXTURE_PARAMETERS_INIT;
9416  texel.f =
9417  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9418  TEXTURE_RETURN_CHAR;
9419 }
9420 
9421 template <int texType, enum hipTextureReadMode mode>
9422 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture<char1, texType, mode> texRef, float x,
9423  float y, int layer) {
9424  TEXTURE_REF_PARAMETERS_INIT;
9425  texel.f =
9426  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9427  TEXTURE_RETURN_CHAR_X;
9428 }
9429 
9430 template <int texType, enum hipTextureReadMode mode>
9431 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture<char1, texType, mode> texRef,
9432  hipTextureObject_t textureObject, float x, float y,
9433  int layer) {
9434  TEXTURE_PARAMETERS_INIT;
9435  texel.f =
9436  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9437  TEXTURE_RETURN_CHAR_X;
9438 }
9439 
9440 template <int texType, enum hipTextureReadMode mode>
9441 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture<char2, texType, mode> texRef, float x,
9442  float y, int layer) {
9443  TEXTURE_REF_PARAMETERS_INIT;
9444  texel.f =
9445  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9446  TEXTURE_RETURN_CHAR_XY;
9447 }
9448 
9449 template <int texType, enum hipTextureReadMode mode>
9450 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture<char2, texType, mode> texRef,
9451  hipTextureObject_t textureObject, float x, float y,
9452  int layer) {
9453  TEXTURE_PARAMETERS_INIT;
9454  texel.f =
9455  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9456  TEXTURE_RETURN_CHAR_XY;
9457 }
9458 
9459 template <int texType, enum hipTextureReadMode mode>
9460 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture<char4, texType, mode> texRef, float x,
9461  float y, int layer) {
9462  TEXTURE_REF_PARAMETERS_INIT;
9463  texel.f =
9464  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9465  TEXTURE_RETURN_CHAR_XYZW;
9466 }
9467 
9468 template <int texType, enum hipTextureReadMode mode>
9469 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture<char4, texType, mode> texRef,
9470  hipTextureObject_t textureObject, float x, float y,
9471  int layer) {
9472  TEXTURE_PARAMETERS_INIT;
9473  texel.f =
9474  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9475  TEXTURE_RETURN_CHAR_XYZW;
9476 }
9477 
9478 template <int texType, enum hipTextureReadMode mode>
9479 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture<unsigned char, texType, mode> texRef,
9480  float x, float y, int layer) {
9481  TEXTURE_REF_PARAMETERS_INIT;
9482  texel.f =
9483  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9484  TEXTURE_RETURN_UCHAR;
9485 }
9486 
9487 template <int texType, enum hipTextureReadMode mode>
9488 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture<unsigned char, texType, mode> texRef,
9489  hipTextureObject_t textureObject, float x,
9490  float y, int layer) {
9491  TEXTURE_PARAMETERS_INIT;
9492  texel.f =
9493  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9494  TEXTURE_RETURN_UCHAR;
9495 }
9496 
9497 template <int texType, enum hipTextureReadMode mode>
9498 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture<uchar1, texType, mode> texRef, float x,
9499  float y, int layer) {
9500  TEXTURE_REF_PARAMETERS_INIT;
9501  texel.f =
9502  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9503  TEXTURE_RETURN_UCHAR_X;
9504 }
9505 
9506 template <int texType, enum hipTextureReadMode mode>
9507 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture<uchar1, texType, mode> texRef,
9508  hipTextureObject_t textureObject, float x, float y,
9509  int layer) {
9510  TEXTURE_PARAMETERS_INIT;
9511  texel.f =
9512  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9513  TEXTURE_RETURN_UCHAR_X;
9514 }
9515 
9516 template <int texType, enum hipTextureReadMode mode>
9517 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture<uchar2, texType, mode> texRef, float x,
9518  float y, int layer) {
9519  TEXTURE_REF_PARAMETERS_INIT;
9520  texel.f =
9521  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9522  TEXTURE_RETURN_UCHAR_XY;
9523 }
9524 
9525 template <int texType, enum hipTextureReadMode mode>
9526 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture<uchar2, texType, mode> texRef,
9527  hipTextureObject_t textureObject, float x, float y,
9528  int layer) {
9529  TEXTURE_PARAMETERS_INIT;
9530  texel.f =
9531  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9532  TEXTURE_RETURN_UCHAR_XY;
9533 }
9534 
9535 template <int texType, enum hipTextureReadMode mode>
9536 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture<uchar4, texType, mode> texRef, float x,
9537  float y, int layer) {
9538  TEXTURE_REF_PARAMETERS_INIT;
9539  texel.f =
9540  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9541  TEXTURE_RETURN_UCHAR_XYZW;
9542 }
9543 
9544 template <int texType, enum hipTextureReadMode mode>
9545 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture<uchar4, texType, mode> texRef,
9546  hipTextureObject_t textureObject, float x, float y,
9547  int layer) {
9548  TEXTURE_PARAMETERS_INIT;
9549  texel.f =
9550  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9551  TEXTURE_RETURN_UCHAR_XYZW;
9552 }
9553 
9554 template <int texType, enum hipTextureReadMode mode>
9555 __TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture<short, texType, mode> texRef, float x,
9556  float y, int layer) {
9557  TEXTURE_REF_PARAMETERS_INIT;
9558  texel.f =
9559  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9560  TEXTURE_RETURN_SHORT;
9561 }
9562 
9563 template <int texType, enum hipTextureReadMode mode>
9564 __TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture<short, texType, mode> texRef,
9565  hipTextureObject_t textureObject, float x, float y,
9566  int layer) {
9567  TEXTURE_PARAMETERS_INIT;
9568  texel.f =
9569  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9570  TEXTURE_RETURN_SHORT;
9571 }
9572 
9573 template <int texType, enum hipTextureReadMode mode>
9574 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture<short1, texType, mode> texRef, float x,
9575  float y, int layer) {
9576  TEXTURE_REF_PARAMETERS_INIT;
9577  texel.f =
9578  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9579  TEXTURE_RETURN_SHORT_X;
9580 }
9581 
9582 template <int texType, enum hipTextureReadMode mode>
9583 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture<short1, texType, mode> texRef,
9584  hipTextureObject_t textureObject, float x, float y,
9585  int layer) {
9586  TEXTURE_PARAMETERS_INIT;
9587  texel.f =
9588  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9589  TEXTURE_RETURN_SHORT_X;
9590 }
9591 
9592 template <int texType, enum hipTextureReadMode mode>
9593 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture<short2, texType, mode> texRef, float x,
9594  float y, int layer) {
9595  TEXTURE_REF_PARAMETERS_INIT;
9596  texel.f =
9597  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9598  TEXTURE_RETURN_SHORT_XY;
9599 }
9600 
9601 template <int texType, enum hipTextureReadMode mode>
9602 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture<short2, texType, mode> texRef,
9603  hipTextureObject_t textureObject, float x, float y,
9604  int layer) {
9605  TEXTURE_PARAMETERS_INIT;
9606  texel.f =
9607  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9608  TEXTURE_RETURN_SHORT_XY;
9609 }
9610 
9611 template <int texType, enum hipTextureReadMode mode>
9612 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture<short4, texType, mode> texRef, float x,
9613  float y, int layer) {
9614  TEXTURE_REF_PARAMETERS_INIT;
9615  texel.f =
9616  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9617  TEXTURE_RETURN_SHORT_XYZW;
9618 }
9619 
9620 template <int texType, enum hipTextureReadMode mode>
9621 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture<short4, texType, mode> texRef,
9622  hipTextureObject_t textureObject, float x, float y,
9623  int layer) {
9624  TEXTURE_PARAMETERS_INIT;
9625  texel.f =
9626  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9627  TEXTURE_RETURN_SHORT_XYZW;
9628 }
9629 
9630 template <int texType, enum hipTextureReadMode mode>
9631 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered(
9632  texture<unsigned short, texType, mode> texRef, float x, float y, int layer) {
9633  TEXTURE_REF_PARAMETERS_INIT;
9634  texel.f =
9635  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9636  TEXTURE_RETURN_USHORT;
9637 }
9638 
9639 template <int texType, enum hipTextureReadMode mode>
9640 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered(
9641  texture<unsigned short, texType, mode> texRef, hipTextureObject_t textureObject, float x,
9642  float y, int layer) {
9643  TEXTURE_PARAMETERS_INIT;
9644  texel.f =
9645  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9646  TEXTURE_RETURN_USHORT;
9647 }
9648 
9649 template <int texType, enum hipTextureReadMode mode>
9650 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture<ushort1, texType, mode> texRef, float x,
9651  float y, int layer) {
9652  TEXTURE_REF_PARAMETERS_INIT;
9653  texel.f =
9654  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9655  TEXTURE_RETURN_USHORT_X;
9656 }
9657 
9658 template <int texType, enum hipTextureReadMode mode>
9659 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture<ushort1, texType, mode> texRef,
9660  hipTextureObject_t textureObject, float x, float y,
9661  int layer) {
9662  TEXTURE_PARAMETERS_INIT;
9663  texel.f =
9664  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9665  TEXTURE_RETURN_USHORT_X;
9666 }
9667 
9668 template <int texType, enum hipTextureReadMode mode>
9669 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture<ushort2, texType, mode> texRef, float x,
9670  float y, int layer) {
9671  TEXTURE_REF_PARAMETERS_INIT;
9672  texel.f =
9673  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9674  TEXTURE_RETURN_USHORT_XY;
9675 }
9676 
9677 template <int texType, enum hipTextureReadMode mode>
9678 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture<ushort2, texType, mode> texRef,
9679  hipTextureObject_t textureObject, float x, float y,
9680  int layer) {
9681  TEXTURE_PARAMETERS_INIT;
9682  texel.f =
9683  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9684  TEXTURE_RETURN_USHORT_XY;
9685 }
9686 
9687 template <int texType, enum hipTextureReadMode mode>
9688 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture<ushort4, texType, mode> texRef, float x,
9689  float y, int layer) {
9690  TEXTURE_REF_PARAMETERS_INIT;
9691  texel.f =
9692  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9693  TEXTURE_RETURN_USHORT_XYZW;
9694 }
9695 
9696 template <int texType, enum hipTextureReadMode mode>
9697 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture<ushort4, texType, mode> texRef,
9698  hipTextureObject_t textureObject, float x, float y,
9699  int layer) {
9700  TEXTURE_PARAMETERS_INIT;
9701  texel.f =
9702  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9703  TEXTURE_RETURN_USHORT_XYZW;
9704 }
9705 
9706 template <int texType, enum hipTextureReadMode mode>
9707 __TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture<int, texType, mode> texRef, float x, float y,
9708  int layer) {
9709  TEXTURE_REF_PARAMETERS_INIT;
9710  texel.f =
9711  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9712  TEXTURE_RETURN_INT;
9713 }
9714 
9715 template <int texType, enum hipTextureReadMode mode>
9716 __TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture<int, texType, mode> texRef,
9717  hipTextureObject_t textureObject, float x, float y,
9718  int layer) {
9719  TEXTURE_PARAMETERS_INIT;
9720  texel.f =
9721  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9722  TEXTURE_RETURN_INT;
9723 }
9724 
9725 template <int texType, enum hipTextureReadMode mode>
9726 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture<int1, texType, mode> texRef, float x, float y,
9727  int layer) {
9728  TEXTURE_REF_PARAMETERS_INIT;
9729  texel.f =
9730  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9731  TEXTURE_RETURN_INT_X;
9732 }
9733 
9734 template <int texType, enum hipTextureReadMode mode>
9735 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture<int1, texType, mode> texRef,
9736  hipTextureObject_t textureObject, float x, float y,
9737  int layer) {
9738  TEXTURE_PARAMETERS_INIT;
9739  texel.f =
9740  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9741  TEXTURE_RETURN_INT_X;
9742 }
9743 
9744 template <int texType, enum hipTextureReadMode mode>
9745 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture<int2, texType, mode> texRef, float x, float y,
9746  int layer) {
9747  TEXTURE_REF_PARAMETERS_INIT;
9748  texel.f =
9749  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9750  TEXTURE_RETURN_INT_XY;
9751 }
9752 
9753 template <int texType, enum hipTextureReadMode mode>
9754 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture<int2, texType, mode> texRef,
9755  hipTextureObject_t textureObject, float x, float y,
9756  int layer) {
9757  TEXTURE_PARAMETERS_INIT;
9758  texel.f =
9759  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9760  TEXTURE_RETURN_INT_XY;
9761 }
9762 
9763 template <int texType, enum hipTextureReadMode mode>
9764 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture<int4, texType, mode> texRef, float x, float y,
9765  int layer) {
9766  TEXTURE_REF_PARAMETERS_INIT;
9767  texel.f =
9768  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9769  TEXTURE_RETURN_INT_XYZW;
9770 }
9771 
9772 template <int texType, enum hipTextureReadMode mode>
9773 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture<int4, texType, mode> texRef,
9774  hipTextureObject_t textureObject, float x, float y,
9775  int layer) {
9776  TEXTURE_PARAMETERS_INIT;
9777  texel.f =
9778  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9779  TEXTURE_RETURN_INT_XYZW;
9780 }
9781 
9782 template <int texType, enum hipTextureReadMode mode>
9783 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture<unsigned int, texType, mode> texRef,
9784  float x, float y, int layer) {
9785  TEXTURE_REF_PARAMETERS_INIT;
9786  texel.f =
9787  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9788  TEXTURE_RETURN_UINT;
9789 }
9790 
9791 template <int texType, enum hipTextureReadMode mode>
9792 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture<unsigned int, texType, mode> texRef,
9793  hipTextureObject_t textureObject, float x,
9794  float y, int layer) {
9795  TEXTURE_PARAMETERS_INIT;
9796  texel.f =
9797  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9798  TEXTURE_RETURN_UINT;
9799 }
9800 
9801 template <int texType, enum hipTextureReadMode mode>
9802 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture<uint1, texType, mode> texRef, float x,
9803  float y, int layer) {
9804  TEXTURE_REF_PARAMETERS_INIT;
9805  texel.f =
9806  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9807  TEXTURE_RETURN_UINT_X;
9808 }
9809 
9810 template <int texType, enum hipTextureReadMode mode>
9811 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture<uint1, texType, mode> texRef,
9812  hipTextureObject_t textureObject, float x, float y,
9813  int layer) {
9814  TEXTURE_PARAMETERS_INIT;
9815  texel.f =
9816  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9817  TEXTURE_RETURN_UINT_X;
9818 }
9819 
9820 template <int texType, enum hipTextureReadMode mode>
9821 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture<uint2, texType, mode> texRef, float x,
9822  float y, int layer) {
9823  TEXTURE_REF_PARAMETERS_INIT;
9824  texel.f =
9825  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9826  TEXTURE_RETURN_UINT_XY;
9827 }
9828 
9829 template <int texType, enum hipTextureReadMode mode>
9830 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture<uint2, texType, mode> texRef,
9831  hipTextureObject_t textureObject, float x, float y,
9832  int layer) {
9833  TEXTURE_PARAMETERS_INIT;
9834  texel.f =
9835  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9836  TEXTURE_RETURN_UINT_XY;
9837 }
9838 
9839 template <int texType, enum hipTextureReadMode mode>
9840 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture<uint4, texType, mode> texRef, float x,
9841  float y, int layer) {
9842  TEXTURE_REF_PARAMETERS_INIT;
9843  texel.f =
9844  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9845  TEXTURE_RETURN_UINT_XYZW;
9846 }
9847 
9848 template <int texType, enum hipTextureReadMode mode>
9849 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture<uint4, texType, mode> texRef,
9850  hipTextureObject_t textureObject, float x, float y,
9851  int layer) {
9852  TEXTURE_PARAMETERS_INIT;
9853  texel.f =
9854  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9855  TEXTURE_RETURN_UINT_XYZW;
9856 }
9857 
9858 template <int texType, enum hipTextureReadMode mode>
9859 __TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture<float, texType, mode> texRef, float x,
9860  float y, int layer) {
9861  TEXTURE_REF_PARAMETERS_INIT;
9862  texel.f =
9863  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9864  TEXTURE_RETURN_FLOAT;
9865 }
9866 
9867 template <int texType, enum hipTextureReadMode mode>
9868 __TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture<float, texType, mode> texRef,
9869  hipTextureObject_t textureObject, float x, float y,
9870  int layer) {
9871  TEXTURE_PARAMETERS_INIT;
9872  texel.f =
9873  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9874  TEXTURE_RETURN_FLOAT;
9875 }
9876 
9877 template <int texType, enum hipTextureReadMode mode>
9878 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture<float1, texType, mode> texRef, float x,
9879  float y, int layer) {
9880  TEXTURE_REF_PARAMETERS_INIT;
9881  texel.f =
9882  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9883  TEXTURE_RETURN_FLOAT_X;
9884 }
9885 
9886 template <int texType, enum hipTextureReadMode mode>
9887 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture<float1, texType, mode> texRef,
9888  hipTextureObject_t textureObject, float x, float y,
9889  int layer) {
9890  TEXTURE_PARAMETERS_INIT;
9891  texel.f =
9892  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9893  TEXTURE_RETURN_FLOAT_X;
9894 }
9895 
9896 template <int texType, enum hipTextureReadMode mode>
9897 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture<float2, texType, mode> texRef, float x,
9898  float y, int layer) {
9899  TEXTURE_REF_PARAMETERS_INIT;
9900  texel.f =
9901  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9902  TEXTURE_RETURN_FLOAT_XY;
9903 }
9904 
9905 template <int texType, enum hipTextureReadMode mode>
9906 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture<float2, texType, mode> texRef,
9907  hipTextureObject_t textureObject, float x, float y,
9908  int layer) {
9909  TEXTURE_PARAMETERS_INIT;
9910  texel.f =
9911  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9912  TEXTURE_RETURN_FLOAT_XY;
9913 }
9914 
9915 template <int texType, enum hipTextureReadMode mode>
9916 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture<float4, texType, mode> texRef, float x,
9917  float y, int layer) {
9918  TEXTURE_REF_PARAMETERS_INIT;
9919  texel.f =
9920  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9921  TEXTURE_RETURN_FLOAT_XYZW;
9922 }
9923 
9924 template <int texType, enum hipTextureReadMode mode>
9925 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture<float4, texType, mode> texRef,
9926  hipTextureObject_t textureObject, float x, float y,
9927  int layer) {
9928  TEXTURE_PARAMETERS_INIT;
9929  texel.f =
9930  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
9931  TEXTURE_RETURN_FLOAT_XYZW;
9932 }
9933 
9935 
9936 template <int texType, enum hipTextureReadMode mode>
9937 __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture<char, texType, mode> texRef, float x,
9938  float y, int layer, float level) {
9939  TEXTURE_REF_PARAMETERS_INIT;
9940  texel.f = __ockl_image_sample_lod_2Da(
9941  i, s, float4(x, y, layer, 0.0f).data, level);
9942  TEXTURE_RETURN_CHAR;
9943 }
9944 
9945 template <int texType, enum hipTextureReadMode mode>
9946 __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture<char, texType, mode> texRef,
9947  hipTextureObject_t textureObject, float x, float y,
9948  int layer, float level) {
9949  TEXTURE_PARAMETERS_INIT;
9950  texel.f = __ockl_image_sample_lod_2Da(
9951  i, s, float4(x, y, layer, 0.0f).data, level);
9952  TEXTURE_RETURN_CHAR;
9953 }
9954 
9955 template <int texType, enum hipTextureReadMode mode>
9956 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture<char1, texType, mode> texRef, float x,
9957  float y, int layer, float level) {
9958  TEXTURE_REF_PARAMETERS_INIT;
9959  texel.f = __ockl_image_sample_lod_2Da(
9960  i, s, float4(x, y, layer, 0.0f).data, level);
9961  TEXTURE_RETURN_CHAR_X;
9962 }
9963 
9964 template <int texType, enum hipTextureReadMode mode>
9965 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture<char1, texType, mode> texRef,
9966  hipTextureObject_t textureObject, float x, float y,
9967  int layer, float level) {
9968  TEXTURE_PARAMETERS_INIT;
9969  texel.f = __ockl_image_sample_lod_2Da(
9970  i, s, float4(x, y, layer, 0.0f).data, level);
9971  TEXTURE_RETURN_CHAR_X;
9972 }
9973 
9974 template <int texType, enum hipTextureReadMode mode>
9975 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture<char2, texType, mode> texRef, float x,
9976  float y, int layer, float level) {
9977  TEXTURE_REF_PARAMETERS_INIT;
9978  texel.f = __ockl_image_sample_lod_2Da(
9979  i, s, float4(x, y, layer, 0.0f).data, level);
9980  TEXTURE_RETURN_CHAR_XY;
9981 }
9982 
9983 template <int texType, enum hipTextureReadMode mode>
9984 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture<char2, texType, mode> texRef,
9985  hipTextureObject_t textureObject, float x, float y,
9986  int layer, float level) {
9987  TEXTURE_PARAMETERS_INIT;
9988  texel.f = __ockl_image_sample_lod_2Da(
9989  i, s, float4(x, y, layer, 0.0f).data, level);
9990  TEXTURE_RETURN_CHAR_XY;
9991 }
9992 
9993 template <int texType, enum hipTextureReadMode mode>
9994 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture<char4, texType, mode> texRef, float x,
9995  float y, int layer, float level) {
9996  TEXTURE_REF_PARAMETERS_INIT;
9997  texel.f = __ockl_image_sample_lod_2Da(
9998  i, s, float4(x, y, layer, 0.0f).data, level);
9999  TEXTURE_RETURN_CHAR_XYZW;
10000 }
10001 
10002 template <int texType, enum hipTextureReadMode mode>
10003 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture<char4, texType, mode> texRef,
10004  hipTextureObject_t textureObject, float x, float y,
10005  int layer, float level) {
10006  TEXTURE_PARAMETERS_INIT;
10007  texel.f = __ockl_image_sample_lod_2Da(
10008  i, s, float4(x, y, layer, 0.0f).data, level);
10009  TEXTURE_RETURN_CHAR_XYZW;
10010 }
10011 
10012 template <int texType, enum hipTextureReadMode mode>
10013 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod(
10014  texture<unsigned char, texType, mode> texRef, float x, float y, int layer, float level) {
10015  TEXTURE_REF_PARAMETERS_INIT;
10016  texel.f = __ockl_image_sample_lod_2Da(
10017  i, s, float4(x, y, layer, 0.0f).data, level);
10018  TEXTURE_RETURN_UCHAR;
10019 }
10020 
10021 template <int texType, enum hipTextureReadMode mode>
10022 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod(
10023  texture<unsigned char, texType, mode> texRef, hipTextureObject_t textureObject, float x,
10024  float y, int layer, float level) {
10025  TEXTURE_PARAMETERS_INIT;
10026  texel.f = __ockl_image_sample_lod_2Da(
10027  i, s, float4(x, y, layer, 0.0f).data, level);
10028  TEXTURE_RETURN_UCHAR;
10029 }
10030 
10031 template <int texType, enum hipTextureReadMode mode>
10032 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture<uchar1, texType, mode> texRef, float x,
10033  float y, int layer, float level) {
10034  TEXTURE_REF_PARAMETERS_INIT;
10035  texel.f = __ockl_image_sample_lod_2Da(
10036  i, s, float4(x, y, layer, 0.0f).data, level);
10037  TEXTURE_RETURN_UCHAR_X;
10038 }
10039 
10040 template <int texType, enum hipTextureReadMode mode>
10041 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture<uchar1, texType, mode> texRef,
10042  hipTextureObject_t textureObject, float x,
10043  float y, int layer, float level) {
10044  TEXTURE_PARAMETERS_INIT;
10045  texel.f = __ockl_image_sample_lod_2Da(
10046  i, s, float4(x, y, layer, 0.0f).data, level);
10047  TEXTURE_RETURN_UCHAR_X;
10048 }
10049 
10050 template <int texType, enum hipTextureReadMode mode>
10051 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture<uchar2, texType, mode> texRef, float x,
10052  float y, int layer, float level) {
10053  TEXTURE_REF_PARAMETERS_INIT;
10054  texel.f = __ockl_image_sample_lod_2Da(
10055  i, s, float4(x, y, layer, 0.0f).data, level);
10056  TEXTURE_RETURN_UCHAR_XY;
10057 }
10058 
10059 template <int texType, enum hipTextureReadMode mode>
10060 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture<uchar2, texType, mode> texRef,
10061  hipTextureObject_t textureObject, float x,
10062  float y, int layer, float level) {
10063  TEXTURE_PARAMETERS_INIT;
10064  texel.f = __ockl_image_sample_lod_2Da(
10065  i, s, float4(x, y, layer, 0.0f).data, level);
10066  TEXTURE_RETURN_UCHAR_XY;
10067 }
10068 
10069 template <int texType, enum hipTextureReadMode mode>
10070 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture<uchar4, texType, mode> texRef, float x,
10071  float y, int layer, float level) {
10072  TEXTURE_REF_PARAMETERS_INIT;
10073  texel.f = __ockl_image_sample_lod_2Da(
10074  i, s, float4(x, y, layer, 0.0f).data, level);
10075  TEXTURE_RETURN_UCHAR_XYZW;
10076 }
10077 
10078 template <int texType, enum hipTextureReadMode mode>
10079 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture<uchar4, texType, mode> texRef,
10080  hipTextureObject_t textureObject, float x,
10081  float y, int layer, float level) {
10082  TEXTURE_PARAMETERS_INIT;
10083  texel.f = __ockl_image_sample_lod_2Da(
10084  i, s, float4(x, y, layer, 0.0f).data, level);
10085  TEXTURE_RETURN_UCHAR_XYZW;
10086 }
10087 
10088 template <int texType, enum hipTextureReadMode mode>
10089 __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture<short, texType, mode> texRef, float x,
10090  float y, int layer, float level) {
10091  TEXTURE_REF_PARAMETERS_INIT;
10092  texel.f = __ockl_image_sample_lod_2Da(
10093  i, s, float4(x, y, layer, 0.0f).data, level);
10094  TEXTURE_RETURN_SHORT;
10095 }
10096 
10097 template <int texType, enum hipTextureReadMode mode>
10098 __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture<short, texType, mode> texRef,
10099  hipTextureObject_t textureObject, float x, float y,
10100  int layer, float level) {
10101  TEXTURE_PARAMETERS_INIT;
10102  texel.f = __ockl_image_sample_lod_2Da(
10103  i, s, float4(x, y, layer, 0.0f).data, level);
10104  TEXTURE_RETURN_SHORT;
10105 }
10106 
10107 template <int texType, enum hipTextureReadMode mode>
10108 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture<short1, texType, mode> texRef, float x,
10109  float y, int layer, float level) {
10110  TEXTURE_REF_PARAMETERS_INIT;
10111  texel.f = __ockl_image_sample_lod_2Da(
10112  i, s, float4(x, y, layer, 0.0f).data, level);
10113  TEXTURE_RETURN_SHORT_X;
10114 }
10115 
10116 template <int texType, enum hipTextureReadMode mode>
10117 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture<short1, texType, mode> texRef,
10118  hipTextureObject_t textureObject, float x,
10119  float y, int layer, float level) {
10120  TEXTURE_PARAMETERS_INIT;
10121  texel.f = __ockl_image_sample_lod_2Da(
10122  i, s, float4(x, y, layer, 0.0f).data, level);
10123  TEXTURE_RETURN_SHORT_X;
10124 }
10125 
10126 template <int texType, enum hipTextureReadMode mode>
10127 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture<short2, texType, mode> texRef, float x,
10128  float y, int layer, float level) {
10129  TEXTURE_REF_PARAMETERS_INIT;
10130  texel.f = __ockl_image_sample_lod_2Da(
10131  i, s, float4(x, y, layer, 0.0f).data, level);
10132  TEXTURE_RETURN_SHORT_XY;
10133 }
10134 
10135 template <int texType, enum hipTextureReadMode mode>
10136 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture<short2, texType, mode> texRef,
10137  hipTextureObject_t textureObject, float x,
10138  float y, int layer, float level) {
10139  TEXTURE_PARAMETERS_INIT;
10140  texel.f = __ockl_image_sample_lod_2Da(
10141  i, s, float4(x, y, layer, 0.0f).data, level);
10142  TEXTURE_RETURN_SHORT_XY;
10143 }
10144 
10145 template <int texType, enum hipTextureReadMode mode>
10146 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture<short4, texType, mode> texRef, float x,
10147  float y, int layer, float level) {
10148  TEXTURE_REF_PARAMETERS_INIT;
10149  texel.f = __ockl_image_sample_lod_2Da(
10150  i, s, float4(x, y, layer, 0.0f).data, level);
10151  TEXTURE_RETURN_SHORT_XYZW;
10152 }
10153 
10154 template <int texType, enum hipTextureReadMode mode>
10155 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture<short4, texType, mode> texRef,
10156  hipTextureObject_t textureObject, float x,
10157  float y, int layer, float level) {
10158  TEXTURE_PARAMETERS_INIT;
10159  texel.f = __ockl_image_sample_lod_2Da(
10160  i, s, float4(x, y, layer, 0.0f).data, level);
10161  TEXTURE_RETURN_SHORT_XYZW;
10162 }
10163 
10164 template <int texType, enum hipTextureReadMode mode>
10165 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod(
10166  texture<unsigned short, texType, mode> texRef, float x, float y, int layer, float level) {
10167  TEXTURE_REF_PARAMETERS_INIT;
10168  texel.f = __ockl_image_sample_lod_2Da(
10169  i, s, float4(x, y, layer, 0.0f).data, level);
10170  TEXTURE_RETURN_USHORT;
10171 }
10172 
10173 template <int texType, enum hipTextureReadMode mode>
10174 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod(
10175  texture<unsigned short, texType, mode> texRef, hipTextureObject_t textureObject, float x,
10176  float y, int layer, float level) {
10177  TEXTURE_PARAMETERS_INIT;
10178  texel.f = __ockl_image_sample_lod_2Da(
10179  i, s, float4(x, y, layer, 0.0f).data, level);
10180  TEXTURE_RETURN_USHORT;
10181 }
10182 
10183 template <int texType, enum hipTextureReadMode mode>
10184 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture<ushort1, texType, mode> texRef, float x,
10185  float y, int layer, float level) {
10186  TEXTURE_REF_PARAMETERS_INIT;
10187  texel.f = __ockl_image_sample_lod_2Da(
10188  i, s, float4(x, y, layer, 0.0f).data, level);
10189  TEXTURE_RETURN_USHORT_X;
10190 }
10191 
10192 template <int texType, enum hipTextureReadMode mode>
10193 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture<ushort1, texType, mode> texRef,
10194  hipTextureObject_t textureObject, float x,
10195  float y, int layer, float level) {
10196  TEXTURE_PARAMETERS_INIT;
10197  texel.f = __ockl_image_sample_lod_2Da(
10198  i, s, float4(x, y, layer, 0.0f).data, level);
10199  TEXTURE_RETURN_USHORT_X;
10200 }
10201 
10202 template <int texType, enum hipTextureReadMode mode>
10203 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture<ushort2, texType, mode> texRef, float x,
10204  float y, int layer, float level) {
10205  TEXTURE_REF_PARAMETERS_INIT;
10206  texel.f = __ockl_image_sample_lod_2Da(
10207  i, s, float4(x, y, layer, 0.0f).data, level);
10208  TEXTURE_RETURN_USHORT_XY;
10209 }
10210 
10211 template <int texType, enum hipTextureReadMode mode>
10212 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture<ushort2, texType, mode> texRef,
10213  hipTextureObject_t textureObject, float x,
10214  float y, int layer, float level) {
10215  TEXTURE_PARAMETERS_INIT;
10216  texel.f = __ockl_image_sample_lod_2Da(
10217  i, s, float4(x, y, layer, 0.0f).data, level);
10218  TEXTURE_RETURN_USHORT_XY;
10219 }
10220 
10221 template <int texType, enum hipTextureReadMode mode>
10222 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture<ushort4, texType, mode> texRef, float x,
10223  float y, int layer, float level) {
10224  TEXTURE_REF_PARAMETERS_INIT;
10225  texel.f = __ockl_image_sample_lod_2Da(
10226  i, s, float4(x, y, layer, 0.0f).data, level);
10227  TEXTURE_RETURN_USHORT_XYZW;
10228 }
10229 
10230 template <int texType, enum hipTextureReadMode mode>
10231 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture<ushort4, texType, mode> texRef,
10232  hipTextureObject_t textureObject, float x,
10233  float y, int layer, float level) {
10234  TEXTURE_PARAMETERS_INIT;
10235  texel.f = __ockl_image_sample_lod_2Da(
10236  i, s, float4(x, y, layer, 0.0f).data, level);
10237  TEXTURE_RETURN_USHORT_XYZW;
10238 }
10239 
10240 template <int texType, enum hipTextureReadMode mode>
10241 __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture<int, texType, mode> texRef, float x, float y,
10242  int layer, float level) {
10243  TEXTURE_REF_PARAMETERS_INIT;
10244  texel.f = __ockl_image_sample_lod_2Da(
10245  i, s, float4(x, y, layer, 0.0f).data, level);
10246  TEXTURE_RETURN_INT;
10247 }
10248 
10249 template <int texType, enum hipTextureReadMode mode>
10250 __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture<int, texType, mode> texRef,
10251  hipTextureObject_t textureObject, float x, float y,
10252  int layer, float level) {
10253  TEXTURE_PARAMETERS_INIT;
10254  texel.f = __ockl_image_sample_lod_2Da(
10255  i, s, float4(x, y, layer, 0.0f).data, level);
10256  TEXTURE_RETURN_INT;
10257 }
10258 
10259 template <int texType, enum hipTextureReadMode mode>
10260 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture<int1, texType, mode> texRef, float x,
10261  float y, int layer, float level) {
10262  TEXTURE_REF_PARAMETERS_INIT;
10263  texel.f = __ockl_image_sample_lod_2Da(
10264  i, s, float4(x, y, layer, 0.0f).data, level);
10265  TEXTURE_RETURN_INT_X;
10266 }
10267 
10268 template <int texType, enum hipTextureReadMode mode>
10269 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture<int1, texType, mode> texRef,
10270  hipTextureObject_t textureObject, float x, float y,
10271  int layer, float level) {
10272  TEXTURE_PARAMETERS_INIT;
10273  texel.f = __ockl_image_sample_lod_2Da(
10274  i, s, float4(x, y, layer, 0.0f).data, level);
10275  TEXTURE_RETURN_INT_X;
10276 }
10277 
10278 template <int texType, enum hipTextureReadMode mode>
10279 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture<int2, texType, mode> texRef, float x,
10280  float y, int layer, float level) {
10281  TEXTURE_REF_PARAMETERS_INIT;
10282  texel.f = __ockl_image_sample_lod_2Da(
10283  i, s, float4(x, y, layer, 0.0f).data, level);
10284  TEXTURE_RETURN_INT_XY;
10285 }
10286 
10287 template <int texType, enum hipTextureReadMode mode>
10288 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture<int2, texType, mode> texRef,
10289  hipTextureObject_t textureObject, float x, float y,
10290  int layer, float level) {
10291  TEXTURE_PARAMETERS_INIT;
10292  texel.f = __ockl_image_sample_lod_2Da(
10293  i, s, float4(x, y, layer, 0.0f).data, level);
10294  TEXTURE_RETURN_INT_XY;
10295 }
10296 
10297 template <int texType, enum hipTextureReadMode mode>
10298 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture<int4, texType, mode> texRef, float x,
10299  float y, int layer, float level) {
10300  TEXTURE_REF_PARAMETERS_INIT;
10301  texel.f = __ockl_image_sample_lod_2Da(
10302  i, s, float4(x, y, layer, 0.0f).data, level);
10303  TEXTURE_RETURN_INT_XYZW;
10304 }
10305 
10306 template <int texType, enum hipTextureReadMode mode>
10307 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture<int4, texType, mode> texRef,
10308  hipTextureObject_t textureObject, float x, float y,
10309  int layer, float level) {
10310  TEXTURE_PARAMETERS_INIT;
10311  texel.f = __ockl_image_sample_lod_2Da(
10312  i, s, float4(x, y, layer, 0.0f).data, level);
10313  TEXTURE_RETURN_INT_XYZW;
10314 }
10315 
10316 template <int texType, enum hipTextureReadMode mode>
10317 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture<unsigned int, texType, mode> texRef,
10318  float x, float y, int layer, float level) {
10319  TEXTURE_REF_PARAMETERS_INIT;
10320  texel.f = __ockl_image_sample_lod_2Da(
10321  i, s, float4(x, y, layer, 0.0f).data, level);
10322  TEXTURE_RETURN_UINT;
10323 }
10324 
10325 template <int texType, enum hipTextureReadMode mode>
10326 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture<unsigned int, texType, mode> texRef,
10327  hipTextureObject_t textureObject, float x,
10328  float y, int layer, float level) {
10329  TEXTURE_PARAMETERS_INIT;
10330  texel.f = __ockl_image_sample_lod_2Da(
10331  i, s, float4(x, y, layer, 0.0f).data, level);
10332  TEXTURE_RETURN_UINT;
10333 }
10334 
10335 template <int texType, enum hipTextureReadMode mode>
10336 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture<uint1, texType, mode> texRef, float x,
10337  float y, int layer, float level) {
10338  TEXTURE_REF_PARAMETERS_INIT;
10339  texel.f = __ockl_image_sample_lod_2Da(
10340  i, s, float4(x, y, layer, 0.0f).data, level);
10341  TEXTURE_RETURN_UINT_X;
10342 }
10343 
10344 template <int texType, enum hipTextureReadMode mode>
10345 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture<uint1, texType, mode> texRef,
10346  hipTextureObject_t textureObject, float x, float y,
10347  int layer, float level) {
10348  TEXTURE_PARAMETERS_INIT;
10349  texel.f = __ockl_image_sample_lod_2Da(
10350  i, s, float4(x, y, layer, 0.0f).data, level);
10351  TEXTURE_RETURN_UINT_X;
10352 }
10353 
10354 template <int texType, enum hipTextureReadMode mode>
10355 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture<uint2, texType, mode> texRef, float x,
10356  float y, int layer, float level) {
10357  TEXTURE_REF_PARAMETERS_INIT;
10358  texel.f = __ockl_image_sample_lod_2Da(
10359  i, s, float4(x, y, layer, 0.0f).data, level);
10360  TEXTURE_RETURN_UINT_XY;
10361 }
10362 
10363 template <int texType, enum hipTextureReadMode mode>
10364 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture<uint2, texType, mode> texRef,
10365  hipTextureObject_t textureObject, float x, float y,
10366  int layer, float level) {
10367  TEXTURE_PARAMETERS_INIT;
10368  texel.f = __ockl_image_sample_lod_2Da(
10369  i, s, float4(x, y, layer, 0.0f).data, level);
10370  TEXTURE_RETURN_UINT_XY;
10371 }
10372 
10373 template <int texType, enum hipTextureReadMode mode>
10374 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture<uint4, texType, mode> texRef, float x,
10375  float y, int layer, float level) {
10376  TEXTURE_REF_PARAMETERS_INIT;
10377  texel.f = __ockl_image_sample_lod_2Da(
10378  i, s, float4(x, y, layer, 0.0f).data, level);
10379  TEXTURE_RETURN_UINT_XYZW;
10380 }
10381 
10382 template <int texType, enum hipTextureReadMode mode>
10383 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture<uint4, texType, mode> texRef,
10384  hipTextureObject_t textureObject, float x, float y,
10385  int layer, float level) {
10386  TEXTURE_PARAMETERS_INIT;
10387  texel.f = __ockl_image_sample_lod_2Da(
10388  i, s, float4(x, y, layer, 0.0f).data, level);
10389  TEXTURE_RETURN_UINT_XYZW;
10390 }
10391 
10392 template <int texType, enum hipTextureReadMode mode>
10393 __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture<float, texType, mode> texRef, float x,
10394  float y, int layer, float level) {
10395  TEXTURE_REF_PARAMETERS_INIT;
10396  texel.f = __ockl_image_sample_lod_2Da(
10397  i, s, float4(x, y, layer, 0.0f).data, level);
10398  TEXTURE_RETURN_FLOAT;
10399 }
10400 
10401 template <int texType, enum hipTextureReadMode mode>
10402 __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture<float, texType, mode> texRef,
10403  hipTextureObject_t textureObject, float x, float y,
10404  int layer, float level) {
10405  TEXTURE_PARAMETERS_INIT;
10406  texel.f = __ockl_image_sample_lod_2Da(
10407  i, s, float4(x, y, layer, 0.0f).data, level);
10408  TEXTURE_RETURN_FLOAT;
10409 }
10410 
10411 template <int texType, enum hipTextureReadMode mode>
10412 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture<float1, texType, mode> texRef, float x,
10413  float y, int layer, float level) {
10414  TEXTURE_REF_PARAMETERS_INIT;
10415  texel.f = __ockl_image_sample_lod_2Da(
10416  i, s, float4(x, y, layer, 0.0f).data, level);
10417  TEXTURE_RETURN_FLOAT_X;
10418 }
10419 
10420 template <int texType, enum hipTextureReadMode mode>
10421 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture<float1, texType, mode> texRef,
10422  hipTextureObject_t textureObject, float x,
10423  float y, int layer, float level) {
10424  TEXTURE_PARAMETERS_INIT;
10425  texel.f = __ockl_image_sample_lod_2Da(
10426  i, s, float4(x, y, layer, 0.0f).data, level);
10427  TEXTURE_RETURN_FLOAT_X;
10428 }
10429 
10430 template <int texType, enum hipTextureReadMode mode>
10431 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture<float2, texType, mode> texRef, float x,
10432  float y, int layer, float level) {
10433  TEXTURE_REF_PARAMETERS_INIT;
10434  texel.f = __ockl_image_sample_lod_2Da(
10435  i, s, float4(x, y, layer, 0.0f).data, level);
10436  TEXTURE_RETURN_FLOAT_XY;
10437 }
10438 
10439 template <int texType, enum hipTextureReadMode mode>
10440 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture<float2, texType, mode> texRef,
10441  hipTextureObject_t textureObject, float x,
10442  float y, int layer, float level) {
10443  TEXTURE_PARAMETERS_INIT;
10444  texel.f = __ockl_image_sample_lod_2Da(
10445  i, s, float4(x, y, layer, 0.0f).data, level);
10446  TEXTURE_RETURN_FLOAT_XY;
10447 }
10448 
10449 template <int texType, enum hipTextureReadMode mode>
10450 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture<float4, texType, mode> texRef, float x,
10451  float y, int layer, float level) {
10452  TEXTURE_REF_PARAMETERS_INIT;
10453  texel.f = __ockl_image_sample_lod_2Da(
10454  i, s, float4(x, y, layer, 0.0f).data, level);
10455  TEXTURE_RETURN_FLOAT_XYZW;
10456 }
10457 
10458 template <int texType, enum hipTextureReadMode mode>
10459 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture<float4, texType, mode> texRef,
10460  hipTextureObject_t textureObject, float x,
10461  float y, int layer, float level) {
10462  TEXTURE_PARAMETERS_INIT;
10463  texel.f = __ockl_image_sample_lod_2Da(
10464  i, s, float4(x, y, layer, 0.0f).data, level);
10465  TEXTURE_RETURN_FLOAT_XYZW;
10466 }
10467 
10469 
10470 template <int texType, enum hipTextureReadMode mode>
10471 __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture<char, texType, mode> texRef, float x,
10472  float y, int layer, float2 dx, float2 dy) {
10473  TEXTURE_REF_PARAMETERS_INIT;
10474  texel.f =
10475  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10476  float2(dx.x, dx.y).data,
10477  float2(dy.x, dy.y).data);
10478  TEXTURE_RETURN_CHAR;
10479 }
10480 
10481 template <int texType, enum hipTextureReadMode mode>
10482 __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture<char, texType, mode> texRef,
10483  hipTextureObject_t textureObject, float x, float y,
10484  int layer, float2 dx, float2 dy) {
10485  TEXTURE_PARAMETERS_INIT;
10486  texel.f =
10487  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10488  float2(dx.x, dx.y).data,
10489  float2(dy.x, dy.y).data);
10490  TEXTURE_RETURN_CHAR;
10491 }
10492 
10493 template <int texType, enum hipTextureReadMode mode>
10494 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture<char1, texType, mode> texRef, float x,
10495  float y, int layer, float2 dx, float2 dy) {
10496  TEXTURE_REF_PARAMETERS_INIT;
10497  texel.f =
10498  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10499  float2(dx.x, dx.y).data,
10500  float2(dy.x, dy.y).data);
10501  TEXTURE_RETURN_CHAR_X;
10502 }
10503 
10504 template <int texType, enum hipTextureReadMode mode>
10505 __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture<char1, texType, mode> texRef,
10506  hipTextureObject_t textureObject, float x,
10507  float y, int layer, float2 dx, float2 dy) {
10508  TEXTURE_PARAMETERS_INIT;
10509  texel.f =
10510  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10511  float2(dx.x, dx.y).data,
10512  float2(dy.x, dy.y).data);
10513  TEXTURE_RETURN_CHAR_X;
10514 }
10515 
10516 template <int texType, enum hipTextureReadMode mode>
10517 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture<char2, texType, mode> texRef, float x,
10518  float y, int layer, float2 dx, float2 dy) {
10519  TEXTURE_REF_PARAMETERS_INIT;
10520  texel.f =
10521  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10522  float2(dx.x, dx.y).data,
10523  float2(dy.x, dy.y).data);
10524  TEXTURE_RETURN_CHAR_XY;
10525 }
10526 
10527 template <int texType, enum hipTextureReadMode mode>
10528 __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture<char2, texType, mode> texRef,
10529  hipTextureObject_t textureObject, float x,
10530  float y, int layer, float2 dx, float2 dy) {
10531  TEXTURE_PARAMETERS_INIT;
10532  texel.f =
10533  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10534  float2(dx.x, dx.y).data,
10535  float2(dy.x, dy.y).data);
10536  TEXTURE_RETURN_CHAR_XY;
10537 }
10538 
10539 template <int texType, enum hipTextureReadMode mode>
10540 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture<char4, texType, mode> texRef, float x,
10541  float y, int layer, float2 dx, float2 dy) {
10542  TEXTURE_REF_PARAMETERS_INIT;
10543  texel.f =
10544  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10545  float2(dx.x, dx.y).data,
10546  float2(dy.x, dy.y).data);
10547  TEXTURE_RETURN_CHAR_XYZW;
10548 }
10549 
10550 template <int texType, enum hipTextureReadMode mode>
10551 __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture<char4, texType, mode> texRef,
10552  hipTextureObject_t textureObject, float x,
10553  float y, int layer, float2 dx, float2 dy) {
10554  TEXTURE_PARAMETERS_INIT;
10555  texel.f =
10556  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10557  float2(dx.x, dx.y).data,
10558  float2(dy.x, dy.y).data);
10559  TEXTURE_RETURN_CHAR_XYZW;
10560 }
10561 
10562 template <int texType, enum hipTextureReadMode mode>
10563 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad(
10564  texture<unsigned char, texType, mode> texRef, float x, float y, int layer, float2 dx,
10565  float2 dy) {
10566  TEXTURE_REF_PARAMETERS_INIT;
10567  texel.f =
10568  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10569  float2(dx.x, dx.y).data,
10570  float2(dy.x, dy.y).data);
10571  TEXTURE_RETURN_UCHAR;
10572 }
10573 
10574 template <int texType, enum hipTextureReadMode mode>
10575 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad(
10576  texture<unsigned char, texType, mode> texRef, hipTextureObject_t textureObject, float x,
10577  float y, int layer, float2 dx, float2 dy) {
10578  TEXTURE_PARAMETERS_INIT;
10579  texel.f =
10580  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10581  float2(dx.x, dx.y).data,
10582  float2(dy.x, dy.y).data);
10583  TEXTURE_RETURN_UCHAR;
10584 }
10585 
10586 template <int texType, enum hipTextureReadMode mode>
10587 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture<uchar1, texType, mode> texRef, float x,
10588  float y, int layer, float2 dx, float2 dy) {
10589  TEXTURE_REF_PARAMETERS_INIT;
10590  texel.f =
10591  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10592  float2(dx.x, dx.y).data,
10593  float2(dy.x, dy.y).data);
10594  TEXTURE_RETURN_UCHAR_X;
10595 }
10596 
10597 template <int texType, enum hipTextureReadMode mode>
10598 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture<uchar1, texType, mode> texRef,
10599  hipTextureObject_t textureObject, float x,
10600  float y, int layer, float2 dx, float2 dy) {
10601  TEXTURE_PARAMETERS_INIT;
10602  texel.f =
10603  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10604  float2(dx.x, dx.y).data,
10605  float2(dy.x, dy.y).data);
10606  TEXTURE_RETURN_UCHAR_X;
10607 }
10608 
10609 template <int texType, enum hipTextureReadMode mode>
10610 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture<uchar2, texType, mode> texRef, float x,
10611  float y, int layer, float2 dx, float2 dy) {
10612  TEXTURE_REF_PARAMETERS_INIT;
10613  texel.f =
10614  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10615  float2(dx.x, dx.y).data,
10616  float2(dy.x, dy.y).data);
10617  TEXTURE_RETURN_UCHAR_XY;
10618 }
10619 
10620 template <int texType, enum hipTextureReadMode mode>
10621 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture<uchar2, texType, mode> texRef,
10622  hipTextureObject_t textureObject, float x,
10623  float y, int layer, float2 dx, float2 dy) {
10624  TEXTURE_PARAMETERS_INIT;
10625  texel.f =
10626  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10627  float2(dx.x, dx.y).data,
10628  float2(dy.x, dy.y).data);
10629  TEXTURE_RETURN_UCHAR_XY;
10630 }
10631 
10632 template <int texType, enum hipTextureReadMode mode>
10633 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture<uchar4, texType, mode> texRef, float x,
10634  float y, int layer, float2 dx, float2 dy) {
10635  TEXTURE_REF_PARAMETERS_INIT;
10636  texel.f =
10637  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10638  float2(dx.x, dx.y).data,
10639  float2(dy.x, dy.y).data);
10640  TEXTURE_RETURN_UCHAR_XYZW;
10641 }
10642 
10643 template <int texType, enum hipTextureReadMode mode>
10644 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture<uchar4, texType, mode> texRef,
10645  hipTextureObject_t textureObject, float x,
10646  float y, int layer, float2 dx, float2 dy) {
10647  TEXTURE_PARAMETERS_INIT;
10648  texel.f =
10649  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10650  float2(dx.x, dx.y).data,
10651  float2(dy.x, dy.y).data);
10652  TEXTURE_RETURN_UCHAR_XYZW;
10653 }
10654 
10655 template <int texType, enum hipTextureReadMode mode>
10656 __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture<short, texType, mode> texRef, float x,
10657  float y, int layer, float2 dx, float2 dy) {
10658  TEXTURE_REF_PARAMETERS_INIT;
10659  texel.f =
10660  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10661  float2(dx.x, dx.y).data,
10662  float2(dy.x, dy.y).data);
10663  TEXTURE_RETURN_SHORT;
10664 }
10665 
10666 template <int texType, enum hipTextureReadMode mode>
10667 __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture<short, texType, mode> texRef,
10668  hipTextureObject_t textureObject, float x,
10669  float y, int layer, float2 dx, float2 dy) {
10670  TEXTURE_PARAMETERS_INIT;
10671  texel.f =
10672  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10673  float2(dx.x, dx.y).data,
10674  float2(dy.x, dy.y).data);
10675  TEXTURE_RETURN_SHORT;
10676 }
10677 
10678 template <int texType, enum hipTextureReadMode mode>
10679 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture<short1, texType, mode> texRef, float x,
10680  float y, int layer, float2 dx, float2 dy) {
10681  TEXTURE_REF_PARAMETERS_INIT;
10682  texel.f =
10683  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10684  float2(dx.x, dx.y).data,
10685  float2(dy.x, dy.y).data);
10686  TEXTURE_RETURN_SHORT_X;
10687 }
10688 
10689 template <int texType, enum hipTextureReadMode mode>
10690 __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture<short1, texType, mode> texRef,
10691  hipTextureObject_t textureObject, float x,
10692  float y, int layer, float2 dx, float2 dy) {
10693  TEXTURE_PARAMETERS_INIT;
10694  texel.f =
10695  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10696  float2(dx.x, dx.y).data,
10697  float2(dy.x, dy.y).data);
10698  TEXTURE_RETURN_SHORT_X;
10699 }
10700 
10701 template <int texType, enum hipTextureReadMode mode>
10702 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture<short2, texType, mode> texRef, float x,
10703  float y, int layer, float2 dx, float2 dy) {
10704  TEXTURE_REF_PARAMETERS_INIT;
10705  texel.f =
10706  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10707  float2(dx.x, dx.y).data,
10708  float2(dy.x, dy.y).data);
10709  TEXTURE_RETURN_SHORT_XY;
10710 }
10711 
10712 template <int texType, enum hipTextureReadMode mode>
10713 __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture<short2, texType, mode> texRef,
10714  hipTextureObject_t textureObject, float x,
10715  float y, int layer, float2 dx, float2 dy) {
10716  TEXTURE_PARAMETERS_INIT;
10717  texel.f =
10718  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10719  float2(dx.x, dx.y).data,
10720  float2(dy.x, dy.y).data);
10721  TEXTURE_RETURN_SHORT_XY;
10722 }
10723 
10724 template <int texType, enum hipTextureReadMode mode>
10725 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture<short4, texType, mode> texRef, float x,
10726  float y, int layer, float2 dx, float2 dy) {
10727  TEXTURE_REF_PARAMETERS_INIT;
10728  texel.f =
10729  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10730  float2(dx.x, dx.y).data,
10731  float2(dy.x, dy.y).data);
10732  TEXTURE_RETURN_SHORT_XYZW;
10733 }
10734 
10735 template <int texType, enum hipTextureReadMode mode>
10736 __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture<short4, texType, mode> texRef,
10737  hipTextureObject_t textureObject, float x,
10738  float y, int layer, float2 dx, float2 dy) {
10739  TEXTURE_PARAMETERS_INIT;
10740  texel.f =
10741  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10742  float2(dx.x, dx.y).data,
10743  float2(dy.x, dy.y).data);
10744  TEXTURE_RETURN_SHORT_XYZW;
10745 }
10746 
10747 template <int texType, enum hipTextureReadMode mode>
10748 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad(
10749  texture<unsigned short, texType, mode> texRef, float x, float y, int layer, float2 dx,
10750  float2 dy) {
10751  TEXTURE_REF_PARAMETERS_INIT;
10752  texel.f =
10753  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10754  float2(dx.x, dx.y).data,
10755  float2(dy.x, dy.y).data);
10756  TEXTURE_RETURN_USHORT;
10757 }
10758 
10759 template <int texType, enum hipTextureReadMode mode>
10760 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad(
10761  texture<unsigned short, texType, mode> texRef, hipTextureObject_t textureObject, float x,
10762  float y, int layer, float2 dx, float2 dy) {
10763  TEXTURE_PARAMETERS_INIT;
10764  texel.f =
10765  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10766  float2(dx.x, dx.y).data,
10767  float2(dy.x, dy.y).data);
10768  TEXTURE_RETURN_USHORT;
10769 }
10770 
10771 template <int texType, enum hipTextureReadMode mode>
10772 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture<ushort1, texType, mode> texRef, float x,
10773  float y, int layer, float2 dx, float2 dy) {
10774  TEXTURE_REF_PARAMETERS_INIT;
10775  texel.f =
10776  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10777  float2(dx.x, dx.y).data,
10778  float2(dy.x, dy.y).data);
10779  TEXTURE_RETURN_USHORT_X;
10780 }
10781 
10782 template <int texType, enum hipTextureReadMode mode>
10783 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture<ushort1, texType, mode> texRef,
10784  hipTextureObject_t textureObject, float x,
10785  float y, int layer, float2 dx, float2 dy) {
10786  TEXTURE_PARAMETERS_INIT;
10787  texel.f =
10788  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10789  float2(dx.x, dx.y).data,
10790  float2(dy.x, dy.y).data);
10791  TEXTURE_RETURN_USHORT_X;
10792 }
10793 
10794 template <int texType, enum hipTextureReadMode mode>
10795 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture<ushort2, texType, mode> texRef, float x,
10796  float y, int layer, float2 dx, float2 dy) {
10797  TEXTURE_REF_PARAMETERS_INIT;
10798  texel.f =
10799  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10800  float2(dx.x, dx.y).data,
10801  float2(dy.x, dy.y).data);
10802  TEXTURE_RETURN_USHORT_XY;
10803 }
10804 
10805 template <int texType, enum hipTextureReadMode mode>
10806 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture<ushort2, texType, mode> texRef,
10807  hipTextureObject_t textureObject, float x,
10808  float y, int layer, float2 dx, float2 dy) {
10809  TEXTURE_PARAMETERS_INIT;
10810  texel.f =
10811  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10812  float2(dx.x, dx.y).data,
10813  float2(dy.x, dy.y).data);
10814  TEXTURE_RETURN_USHORT_XY;
10815 }
10816 
10817 template <int texType, enum hipTextureReadMode mode>
10818 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture<ushort4, texType, mode> texRef, float x,
10819  float y, int layer, float2 dx, float2 dy) {
10820  TEXTURE_REF_PARAMETERS_INIT;
10821  texel.f =
10822  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10823  float2(dx.x, dx.y).data,
10824  float2(dy.x, dy.y).data);
10825  TEXTURE_RETURN_USHORT_XYZW;
10826 }
10827 
10828 template <int texType, enum hipTextureReadMode mode>
10829 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture<ushort4, texType, mode> texRef,
10830  hipTextureObject_t textureObject, float x,
10831  float y, int layer, float2 dx, float2 dy) {
10832  TEXTURE_PARAMETERS_INIT;
10833  texel.f =
10834  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10835  float2(dx.x, dx.y).data,
10836  float2(dy.x, dy.y).data);
10837  TEXTURE_RETURN_USHORT_XYZW;
10838 }
10839 
10840 template <int texType, enum hipTextureReadMode mode>
10841 __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture<int, texType, mode> texRef, float x,
10842  float y, int layer, float2 dx, float2 dy) {
10843  TEXTURE_REF_PARAMETERS_INIT;
10844  texel.f =
10845  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10846  float2(dx.x, dx.y).data,
10847  float2(dy.x, dy.y).data);
10848  TEXTURE_RETURN_INT;
10849 }
10850 
10851 template <int texType, enum hipTextureReadMode mode>
10852 __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture<int, texType, mode> texRef,
10853  hipTextureObject_t textureObject, float x, float y,
10854  int layer, float2 dx, float2 dy) {
10855  TEXTURE_PARAMETERS_INIT;
10856  texel.f =
10857  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10858  float2(dx.x, dx.y).data,
10859  float2(dy.x, dy.y).data);
10860  TEXTURE_RETURN_INT;
10861 }
10862 
10863 template <int texType, enum hipTextureReadMode mode>
10864 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture<int1, texType, mode> texRef, float x,
10865  float y, int layer, float2 dx, float2 dy) {
10866  TEXTURE_REF_PARAMETERS_INIT;
10867  texel.f =
10868  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10869  float2(dx.x, dx.y).data,
10870  float2(dy.x, dy.y).data);
10871  TEXTURE_RETURN_INT_X;
10872 }
10873 
10874 template <int texType, enum hipTextureReadMode mode>
10875 __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture<int1, texType, mode> texRef,
10876  hipTextureObject_t textureObject, float x, float y,
10877  int layer, float2 dx, float2 dy) {
10878  TEXTURE_PARAMETERS_INIT;
10879  texel.f =
10880  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10881  float2(dx.x, dx.y).data,
10882  float2(dy.x, dy.y).data);
10883  TEXTURE_RETURN_INT_X;
10884 }
10885 
10886 template <int texType, enum hipTextureReadMode mode>
10887 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture<int2, texType, mode> texRef, float x,
10888  float y, int layer, float2 dx, float2 dy) {
10889  TEXTURE_REF_PARAMETERS_INIT;
10890  texel.f =
10891  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10892  float2(dx.x, dx.y).data,
10893  float2(dy.x, dy.y).data);
10894  TEXTURE_RETURN_INT_XY;
10895 }
10896 
10897 template <int texType, enum hipTextureReadMode mode>
10898 __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture<int2, texType, mode> texRef,
10899  hipTextureObject_t textureObject, float x, float y,
10900  int layer, float2 dx, float2 dy) {
10901  TEXTURE_PARAMETERS_INIT;
10902  texel.f =
10903  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10904  float2(dx.x, dx.y).data,
10905  float2(dy.x, dy.y).data);
10906  TEXTURE_RETURN_INT_XY;
10907 }
10908 
10909 template <int texType, enum hipTextureReadMode mode>
10910 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture<int4, texType, mode> texRef, float x,
10911  float y, int layer, float2 dx, float2 dy) {
10912  TEXTURE_REF_PARAMETERS_INIT;
10913  texel.f =
10914  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10915  float2(dx.x, dx.y).data,
10916  float2(dy.x, dy.y).data);
10917  TEXTURE_RETURN_INT_XYZW;
10918 }
10919 
10920 template <int texType, enum hipTextureReadMode mode>
10921 __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture<int4, texType, mode> texRef,
10922  hipTextureObject_t textureObject, float x, float y,
10923  int layer, float2 dx, float2 dy) {
10924  TEXTURE_PARAMETERS_INIT;
10925  texel.f =
10926  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10927  float2(dx.x, dx.y).data,
10928  float2(dy.x, dy.y).data);
10929  TEXTURE_RETURN_INT_XYZW;
10930 }
10931 
10932 template <int texType, enum hipTextureReadMode mode>
10933 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad(
10934  texture<unsigned int, texType, mode> texRef, float x, float y, int layer, float2 dx,
10935  float2 dy) {
10936  TEXTURE_REF_PARAMETERS_INIT;
10937  texel.f =
10938  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10939  float2(dx.x, dx.y).data,
10940  float2(dy.x, dy.y).data);
10941  TEXTURE_RETURN_UINT;
10942 }
10943 
10944 template <int texType, enum hipTextureReadMode mode>
10945 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad(
10946  texture<unsigned int, texType, mode> texRef, hipTextureObject_t textureObject, float x, float y,
10947  int layer, float2 dx, float2 dy) {
10948  TEXTURE_PARAMETERS_INIT;
10949  texel.f =
10950  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10951  float2(dx.x, dx.y).data,
10952  float2(dy.x, dy.y).data);
10953  TEXTURE_RETURN_UINT;
10954 }
10955 
10956 template <int texType, enum hipTextureReadMode mode>
10957 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture<uint1, texType, mode> texRef, float x,
10958  float y, int layer, float2 dx, float2 dy) {
10959  TEXTURE_REF_PARAMETERS_INIT;
10960  texel.f =
10961  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10962  float2(dx.x, dx.y).data,
10963  float2(dy.x, dy.y).data);
10964  TEXTURE_RETURN_UINT_X;
10965 }
10966 
10967 template <int texType, enum hipTextureReadMode mode>
10968 __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture<uint1, texType, mode> texRef,
10969  hipTextureObject_t textureObject, float x,
10970  float y, int layer, float2 dx, float2 dy) {
10971  TEXTURE_PARAMETERS_INIT;
10972  texel.f =
10973  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10974  float2(dx.x, dx.y).data,
10975  float2(dy.x, dy.y).data);
10976  TEXTURE_RETURN_UINT_X;
10977 }
10978 
10979 template <int texType, enum hipTextureReadMode mode>
10980 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture<uint2, texType, mode> texRef, float x,
10981  float y, int layer, float2 dx, float2 dy) {
10982  TEXTURE_REF_PARAMETERS_INIT;
10983  texel.f =
10984  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10985  float2(dx.x, dx.y).data,
10986  float2(dy.x, dy.y).data);
10987  TEXTURE_RETURN_UINT_XY;
10988 }
10989 
10990 template <int texType, enum hipTextureReadMode mode>
10991 __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture<uint2, texType, mode> texRef,
10992  hipTextureObject_t textureObject, float x,
10993  float y, int layer, float2 dx, float2 dy) {
10994  TEXTURE_PARAMETERS_INIT;
10995  texel.f =
10996  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
10997  float2(dx.x, dx.y).data,
10998  float2(dy.x, dy.y).data);
10999  TEXTURE_RETURN_UINT_XY;
11000 }
11001 
11002 template <int texType, enum hipTextureReadMode mode>
11003 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture<uint4, texType, mode> texRef, float x,
11004  float y, int layer, float2 dx, float2 dy) {
11005  TEXTURE_REF_PARAMETERS_INIT;
11006  texel.f =
11007  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11008  float2(dx.x, dx.y).data,
11009  float2(dy.x, dy.y).data);
11010  TEXTURE_RETURN_UINT_XYZW;
11011 }
11012 
11013 template <int texType, enum hipTextureReadMode mode>
11014 __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture<uint4, texType, mode> texRef,
11015  hipTextureObject_t textureObject, float x,
11016  float y, int layer, float2 dx, float2 dy) {
11017  TEXTURE_PARAMETERS_INIT;
11018  texel.f =
11019  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11020  float2(dx.x, dx.y).data,
11021  float2(dy.x, dy.y).data);
11022  TEXTURE_RETURN_UINT_XYZW;
11023 }
11024 
11025 template <int texType, enum hipTextureReadMode mode>
11026 __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture<float, texType, mode> texRef, float x,
11027  float y, int layer, float2 dx, float2 dy) {
11028  TEXTURE_REF_PARAMETERS_INIT;
11029  texel.f =
11030  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11031  float2(dx.x, dx.y).data,
11032  float2(dy.x, dy.y).data);
11033  TEXTURE_RETURN_FLOAT;
11034 }
11035 
11036 template <int texType, enum hipTextureReadMode mode>
11037 __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture<float, texType, mode> texRef,
11038  hipTextureObject_t textureObject, float x,
11039  float y, int layer, float2 dx, float2 dy) {
11040  TEXTURE_PARAMETERS_INIT;
11041  texel.f =
11042  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11043  float2(dx.x, dx.y).data,
11044  float2(dy.x, dy.y).data);
11045  TEXTURE_RETURN_FLOAT;
11046 }
11047 
11048 template <int texType, enum hipTextureReadMode mode>
11049 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture<float1, texType, mode> texRef, float x,
11050  float y, int layer, float2 dx, float2 dy) {
11051  TEXTURE_REF_PARAMETERS_INIT;
11052  texel.f =
11053  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11054  float2(dx.x, dx.y).data,
11055  float2(dy.x, dy.y).data);
11056  TEXTURE_RETURN_FLOAT_X;
11057 }
11058 
11059 template <int texType, enum hipTextureReadMode mode>
11060 __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture<float1, texType, mode> texRef,
11061  hipTextureObject_t textureObject, float x,
11062  float y, int layer, float2 dx, float2 dy) {
11063  TEXTURE_PARAMETERS_INIT;
11064  texel.f =
11065  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11066  float2(dx.x, dx.y).data,
11067  float2(dy.x, dy.y).data);
11068  TEXTURE_RETURN_FLOAT_X;
11069 }
11070 
11071 template <int texType, enum hipTextureReadMode mode>
11072 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture<float2, texType, mode> texRef, float x,
11073  float y, int layer, float2 dx, float2 dy) {
11074  TEXTURE_REF_PARAMETERS_INIT;
11075  texel.f =
11076  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11077  float2(dx.x, dx.y).data,
11078  float2(dy.x, dy.y).data);
11079  TEXTURE_RETURN_FLOAT_XY;
11080 }
11081 
11082 template <int texType, enum hipTextureReadMode mode>
11083 __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture<float2, texType, mode> texRef,
11084  hipTextureObject_t textureObject, float x,
11085  float y, int layer, float2 dx, float2 dy) {
11086  TEXTURE_PARAMETERS_INIT;
11087  texel.f =
11088  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11089  float2(dx.x, dx.y).data,
11090  float2(dy.x, dy.y).data);
11091  TEXTURE_RETURN_FLOAT_XY;
11092 }
11093 
11094 template <int texType, enum hipTextureReadMode mode>
11095 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture<float4, texType, mode> texRef, float x,
11096  float y, int layer, float2 dx, float2 dy) {
11097  TEXTURE_REF_PARAMETERS_INIT;
11098  texel.f =
11099  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11100  float2(dx.x, dx.y).data,
11101  float2(dy.x, dy.y).data);
11102  TEXTURE_RETURN_FLOAT_XYZW;
11103 }
11104 
11105 template <int texType, enum hipTextureReadMode mode>
11106 __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture<float4, texType, mode> texRef,
11107  hipTextureObject_t textureObject, float x,
11108  float y, int layer, float2 dx, float2 dy) {
11109  TEXTURE_PARAMETERS_INIT;
11110  texel.f =
11111  __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data,
11112  float2(dx.x, dx.y).data,
11113  float2(dy.x, dy.y).data);
11114  TEXTURE_RETURN_FLOAT_XYZW;
11115 }
11116 #endif
Defines the different newt vector types for HIP runtime.
Defines the different newt vector types for HIP runtime.
Definition: texture_functions.h:43