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