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