HIP: Heterogenous-computing Interface for Portability
texture_functions.h
1 /*
2 Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_TEXTURE_FUNCTIONS_H
24 #define HIP_INCLUDE_HIP_HCC_DETAIL_TEXTURE_FUNCTIONS_H
27 
28 #pragma push_macro("TYPEDEF_VECTOR_VALUE_TYPE")
29 #define TYPEDEF_VECTOR_VALUE_TYPE(SCALAR_TYPE) \
30 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##2_vector_value_type __attribute__((ext_vector_type(2))); \
31 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##3_vector_value_type __attribute__((ext_vector_type(3))); \
32 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##4_vector_value_type __attribute__((ext_vector_type(4))); \
33 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##8_vector_value_type __attribute__((ext_vector_type(8))); \
34 typedef SCALAR_TYPE __hip_##SCALAR_TYPE##16_vector_value_type __attribute__((ext_vector_type(16)));
35 
36 TYPEDEF_VECTOR_VALUE_TYPE(float);
37 TYPEDEF_VECTOR_VALUE_TYPE(int);
38 TYPEDEF_VECTOR_VALUE_TYPE(uint);
39 
40 #undef TYPEDEF_VECTOR_VALUE_TYPE
41 #pragma pop_macro("TYPEDEF_VECTOR_VALUE_TYPE")
42 
43 union TData {
44  __hip_float4_vector_value_type f;
45  __hip_int4_vector_value_type i;
46  __hip_uint4_vector_value_type u;
47 };
48 
49 #define __TEXTURE_FUNCTIONS_DECL__ static inline __device__
50 
51 
52 #if (__hcc_workweek__ >= 18114) || __clang__
53 #define ADDRESS_SPACE_CONSTANT __attribute__((address_space(4)))
54 #else
55 #define ADDRESS_SPACE_CONSTANT __attribute__((address_space(2)))
56 #endif
57 
58 #define TEXTURE_PARAMETERS_INIT \
59  unsigned int ADDRESS_SPACE_CONSTANT* i = (unsigned int ADDRESS_SPACE_CONSTANT*)textureObject; \
60  unsigned int ADDRESS_SPACE_CONSTANT* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \
61  TData texel;
62 #define TEXTURE_REF_PARAMETERS_INIT \
63  unsigned int ADDRESS_SPACE_CONSTANT* i = (unsigned int ADDRESS_SPACE_CONSTANT*)texRef.textureObject; \
64  unsigned int ADDRESS_SPACE_CONSTANT* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \
65  TData texel;
66 #define TEXTURE_SET_FLOAT *retVal = texel.f.x;
67 
68 #define TEXTURE_SET_SIGNED *retVal = texel.i.x;
69 
70 #define TEXTURE_SET_UNSIGNED *retVal = texel.u.x;
71 
72 #define TEXTURE_SET_FLOAT_X retVal->x = texel.f.x;
73 
74 #define TEXTURE_SET_SIGNED_X retVal->x = texel.i.x;
75 
76 #define TEXTURE_SET_UNSIGNED_X retVal->x = texel.u.x;
77 
78 #define TEXTURE_SET_FLOAT_XY \
79  retVal->x = texel.f.x; \
80  retVal->y = texel.f.y;
81 
82 #define TEXTURE_SET_SIGNED_XY \
83  retVal->x = texel.i.x; \
84  retVal->y = texel.i.y;
85 
86 #define TEXTURE_SET_UNSIGNED_XY \
87  retVal->x = texel.u.x; \
88  retVal->y = texel.u.y;
89 
90 #define TEXTURE_SET_FLOAT_XYZW \
91  retVal->x = texel.f.x; \
92  retVal->y = texel.f.y; \
93  retVal->z = texel.f.z; \
94  retVal->w = texel.f.w;
95 
96 #define TEXTURE_SET_SIGNED_XYZW \
97  retVal->x = texel.i.x; \
98  retVal->y = texel.i.y; \
99  retVal->z = texel.i.z; \
100  retVal->w = texel.i.w;
101 
102 #define TEXTURE_SET_UNSIGNED_XYZW \
103  retVal->x = texel.u.x; \
104  retVal->y = texel.u.y; \
105  retVal->z = texel.u.z; \
106  retVal->w = texel.u.w;
107 
108 #define TEXTURE_RETURN_CHAR return texel.i.x;
109 
110 #define TEXTURE_RETURN_UCHAR return texel.u.x;
111 
112 #define TEXTURE_RETURN_SHORT return texel.i.x;
113 
114 #define TEXTURE_RETURN_USHORT return texel.u.x;
115 
116 #define TEXTURE_RETURN_INT return texel.i.x;
117 
118 #define TEXTURE_RETURN_UINT return texel.u.x;
119 
120 #define TEXTURE_RETURN_SIGNED return texel.i.x;
121 
122 #define TEXTURE_RETURN_UNSIGNED return texel.u.x;
123 
124 #define TEXTURE_RETURN_CHAR_X return make_char1(texel.i.x);
125 
126 #define TEXTURE_RETURN_UCHAR_X return make_uchar1(texel.u.x);
127 
128 #define TEXTURE_RETURN_SHORT_X return make_short1(texel.i.x);
129 
130 #define TEXTURE_RETURN_USHORT_X return make_ushort1(texel.u.x);
131 
132 #define TEXTURE_RETURN_INT_X return make_int1(texel.i.x);
133 
134 #define TEXTURE_RETURN_UINT_X return make_uint1(texel.u.x);
135 
136 #define TEXTURE_RETURN_CHAR_XY return make_char2(texel.i.x, texel.i.y);
137 
138 #define TEXTURE_RETURN_UCHAR_XY return make_uchar2(texel.u.x, texel.u.y);
139 
140 #define TEXTURE_RETURN_SHORT_XY return make_short2(texel.i.x, texel.i.y);
141 
142 #define TEXTURE_RETURN_USHORT_XY return make_ushort2(texel.u.x, texel.u.y);
143 
144 #define TEXTURE_RETURN_INT_XY return make_int2(texel.i.x, texel.i.y);
145 
146 #define TEXTURE_RETURN_UINT_XY return make_uint2(texel.u.x, texel.u.y);
147 
148 #define TEXTURE_RETURN_CHAR_XYZW return make_char4(texel.i.x, texel.i.y, texel.i.z, texel.i.w);
149 
150 #define TEXTURE_RETURN_UCHAR_XYZW return make_uchar4(texel.u.x, texel.u.y, texel.u.z, texel.u.w);
151 
152 #define TEXTURE_RETURN_SHORT_XYZW return make_short4(texel.i.x, texel.i.y, texel.i.z, texel.i.w);
153 
154 #define TEXTURE_RETURN_USHORT_XYZW return make_ushort4(texel.u.x, texel.u.y, texel.u.z, texel.u.w);
155 
156 #define TEXTURE_RETURN_INT_XYZW return make_int4(texel.i.x, texel.i.y, texel.i.z, texel.i.w);
157 
158 #define TEXTURE_RETURN_UINT_XYZW return make_uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w);
159 
160 #define TEXTURE_RETURN_FLOAT return texel.f.x;
161 
162 #define TEXTURE_RETURN_FLOAT_X return make_float1(texel.f.x);
163 
164 #define TEXTURE_RETURN_FLOAT_XY return make_float2(texel.f.x, texel.f.y);
165 
166 #define TEXTURE_RETURN_FLOAT_XYZW return make_float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w);
167 
168 extern "C" {
169 
170 __device__
171 __hip_float4_vector_value_type __ockl_image_sample_1D(
172  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
173  float c);
174 
175 __device__
176 __hip_float4_vector_value_type __ockl_image_sample_1Da(
177  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
178  __hip_float2_vector_value_type c);
179 
180 __device__
181 __hip_float4_vector_value_type __ockl_image_sample_2D(
182  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
183  __hip_float2_vector_value_type c);
184 
185 
186 __device__
187 __hip_float4_vector_value_type __ockl_image_sample_2Da(
188  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
189  __hip_float4_vector_value_type c);
190 
191 __device__
192 float __ockl_image_sample_2Dad(
193  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
194  __hip_float4_vector_value_type c);
195 
196 __device__
197 float __ockl_image_sample_2Dd(
198  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
199  __hip_float2_vector_value_type c);
200 
201 __device__
202 __hip_float4_vector_value_type __ockl_image_sample_3D(
203  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
204  __hip_float4_vector_value_type c);
205 
206 __device__
207 __hip_float4_vector_value_type __ockl_image_sample_grad_1D(
208  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
209  float c, float dx, float dy);
210 
211 __device__
212 __hip_float4_vector_value_type __ockl_image_sample_grad_1Da(
213  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
214  __hip_float2_vector_value_type c, float dx, float dy);
215 
216 __device__
217 __hip_float4_vector_value_type __ockl_image_sample_grad_2D(
218  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
219  __hip_float2_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
220 
221 __device__
222 __hip_float4_vector_value_type __ockl_image_sample_grad_2Da(
223  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
224  __hip_float4_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
225 
226 __device__
227 float __ockl_image_sample_grad_2Dad(
228  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
229  __hip_float4_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
230 
231 __device__
232 float __ockl_image_sample_grad_2Dd(
233  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
234  __hip_float2_vector_value_type c, __hip_float2_vector_value_type dx, __hip_float2_vector_value_type dy);
235 
236 __device__
237 __hip_float4_vector_value_type __ockl_image_sample_grad_3D(
238  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
239  __hip_float4_vector_value_type c, __hip_float4_vector_value_type dx, __hip_float4_vector_value_type dy);
240 
241 __device__
242 __hip_float4_vector_value_type __ockl_image_sample_lod_1D(
243  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
244  float c, float l);
245 
246 __device__
247 __hip_float4_vector_value_type __ockl_image_sample_lod_1Da(
248  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
249  __hip_float2_vector_value_type c, float l);
250 
251 __device__
252 __hip_float4_vector_value_type __ockl_image_sample_lod_2D(
253  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
254  __hip_float2_vector_value_type c, float l);
255 
256 __device__
257 __hip_float4_vector_value_type __ockl_image_sample_lod_2Da(
258  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
259  __hip_float4_vector_value_type c, float l);
260 
261 __device__
262 float __ockl_image_sample_lod_2Dad(
263  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
264  __hip_float4_vector_value_type c, float l);
265 
266 __device__
267 float __ockl_image_sample_lod_2Dd(
268  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
269  __hip_float2_vector_value_type c, float l);
270 
271 __device__
272 __hip_float4_vector_value_type __ockl_image_sample_lod_3D(
273  unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
274  __hip_float4_vector_value_type c, float l);
275 }
276 
278 // Texture object APIs
280 
281 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char* retVal, hipTextureObject_t textureObject, int x) {
282  TEXTURE_PARAMETERS_INIT;
283  texel.f = __ockl_image_sample_1D(i, s, x);
284  TEXTURE_SET_SIGNED;
285 }
286 
287 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char1* retVal, hipTextureObject_t textureObject, int x) {
288  TEXTURE_PARAMETERS_INIT;
289  texel.f = __ockl_image_sample_1D(i, s, x);
290  TEXTURE_SET_SIGNED_X;
291 }
292 
293 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char2* retVal, hipTextureObject_t textureObject, int x) {
294  TEXTURE_PARAMETERS_INIT;
295  texel.f = __ockl_image_sample_1D(i, s, x);
296  TEXTURE_SET_SIGNED_XY;
297 }
298 
299 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char4* retVal, hipTextureObject_t textureObject, int x) {
300  TEXTURE_PARAMETERS_INIT;
301  texel.f = __ockl_image_sample_1D(i, s, x);
302  TEXTURE_SET_SIGNED_XYZW;
303 }
304 
305 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned char* retVal, hipTextureObject_t textureObject,
306  int x) {
307  TEXTURE_PARAMETERS_INIT;
308  texel.f = __ockl_image_sample_1D(i, s, x);
309  TEXTURE_SET_UNSIGNED;
310 }
311 
312 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar1* retVal, hipTextureObject_t textureObject,
313  int x) {
314  TEXTURE_PARAMETERS_INIT;
315  texel.f = __ockl_image_sample_1D(i, s, x);
316  TEXTURE_SET_UNSIGNED_X;
317 }
318 
319 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar2* retVal, hipTextureObject_t textureObject,
320  int x) {
321  TEXTURE_PARAMETERS_INIT;
322  texel.f = __ockl_image_sample_1D(i, s, x);
323  TEXTURE_SET_UNSIGNED_XY;
324 }
325 
326 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar4* retVal, hipTextureObject_t textureObject,
327  int x) {
328  TEXTURE_PARAMETERS_INIT;
329  texel.f = __ockl_image_sample_1D(i, s, x);
330  TEXTURE_SET_UNSIGNED_XYZW;
331 }
332 
333 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short* retVal, hipTextureObject_t textureObject, int x) {
334  TEXTURE_PARAMETERS_INIT;
335  texel.f = __ockl_image_sample_1D(i, s, x);
336  TEXTURE_SET_SIGNED;
337 }
338 
339 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short1* retVal, hipTextureObject_t textureObject,
340  int x) {
341  TEXTURE_PARAMETERS_INIT;
342  texel.f = __ockl_image_sample_1D(i, s, x);
343  TEXTURE_SET_SIGNED_X;
344 }
345 
346 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short2* retVal, hipTextureObject_t textureObject,
347  int x) {
348  TEXTURE_PARAMETERS_INIT;
349  texel.f = __ockl_image_sample_1D(i, s, x);
350  TEXTURE_SET_SIGNED_XY;
351 }
352 
353 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short4* retVal, hipTextureObject_t textureObject,
354  int x) {
355  TEXTURE_PARAMETERS_INIT;
356  texel.f = __ockl_image_sample_1D(i, s, x);
357  TEXTURE_SET_SIGNED_XYZW;
358 }
359 
360 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned short* retVal, hipTextureObject_t textureObject,
361  int x) {
362  TEXTURE_PARAMETERS_INIT;
363  texel.f = __ockl_image_sample_1D(i, s, x);
364  TEXTURE_SET_SIGNED;
365 }
366 
367 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort1* retVal, hipTextureObject_t textureObject,
368  int x) {
369  TEXTURE_PARAMETERS_INIT;
370  texel.f = __ockl_image_sample_1D(i, s, x);
371  TEXTURE_SET_UNSIGNED_X;
372 }
373 
374 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort2* retVal, hipTextureObject_t textureObject,
375  int x) {
376  TEXTURE_PARAMETERS_INIT;
377  texel.f = __ockl_image_sample_1D(i, s, x);
378  TEXTURE_SET_UNSIGNED_XY;
379 }
380 
381 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort4* retVal, hipTextureObject_t textureObject,
382  int x) {
383  TEXTURE_PARAMETERS_INIT;
384  texel.f = __ockl_image_sample_1D(i, s, x);
385  TEXTURE_SET_UNSIGNED_XYZW;
386 }
387 
388 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int* retVal, hipTextureObject_t textureObject, int x) {
389  TEXTURE_PARAMETERS_INIT;
390  texel.f = __ockl_image_sample_1D(i, s, x);
391  TEXTURE_SET_SIGNED;
392 }
393 
394 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int1* retVal, hipTextureObject_t textureObject, int x) {
395  TEXTURE_PARAMETERS_INIT;
396  texel.f = __ockl_image_sample_1D(i, s, x);
397  TEXTURE_SET_SIGNED_X;
398 }
399 
400 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int2* retVal, hipTextureObject_t textureObject, int x) {
401  TEXTURE_PARAMETERS_INIT;
402  texel.f = __ockl_image_sample_1D(i, s, x);
403  TEXTURE_SET_SIGNED_XY;
404 }
405 
406 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int4* retVal, hipTextureObject_t textureObject, int x) {
407  TEXTURE_PARAMETERS_INIT;
408  texel.f = __ockl_image_sample_1D(i, s, x);
409  TEXTURE_SET_SIGNED_XYZW;
410 }
411 
412 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned int* retVal, hipTextureObject_t textureObject,
413  int x) {
414  TEXTURE_PARAMETERS_INIT;
415  texel.f = __ockl_image_sample_1D(i, s, x);
416  TEXTURE_SET_UNSIGNED;
417 }
418 
419 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint1* retVal, hipTextureObject_t textureObject, int x) {
420  TEXTURE_PARAMETERS_INIT;
421  texel.f = __ockl_image_sample_1D(i, s, x);
422  TEXTURE_SET_UNSIGNED_X;
423 }
424 
425 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint2* retVal, hipTextureObject_t textureObject, int x) {
426  TEXTURE_PARAMETERS_INIT;
427  texel.f = __ockl_image_sample_1D(i, s, x);
428  TEXTURE_SET_UNSIGNED_XY;
429 }
430 
431 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint4* retVal, hipTextureObject_t textureObject, int x) {
432  TEXTURE_PARAMETERS_INIT;
433  texel.f = __ockl_image_sample_1D(i, s, x);
434  TEXTURE_SET_UNSIGNED_XYZW;
435 }
436 
437 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float* retVal, hipTextureObject_t textureObject, int x) {
438  TEXTURE_PARAMETERS_INIT;
439  texel.f = __ockl_image_sample_1D(i, s, x);
440  TEXTURE_SET_FLOAT;
441 }
442 
443 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float1* retVal, hipTextureObject_t textureObject,
444  int x) {
445  TEXTURE_PARAMETERS_INIT;
446  texel.f = __ockl_image_sample_1D(i, s, x);
447  TEXTURE_SET_FLOAT_X;
448 }
449 
450 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float2* retVal, hipTextureObject_t textureObject,
451  int x) {
452  TEXTURE_PARAMETERS_INIT;
453  texel.f = __ockl_image_sample_1D(i, s, x);
454  TEXTURE_SET_FLOAT_XY;
455 }
456 
457 __TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float4* retVal, hipTextureObject_t textureObject,
458  int x) {
459  TEXTURE_PARAMETERS_INIT;
460  texel.f = __ockl_image_sample_1D(i, s, x);
461  TEXTURE_SET_FLOAT_XYZW;
462 }
463 
464 template <class T>
465 __TEXTURE_FUNCTIONS_DECL__ T tex1Dfetch(hipTextureObject_t textureObject, int x) {
466  T ret;
467  tex1Dfetch(&ret, textureObject, x);
468  return ret;
469 }
470 
472 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char* retVal, hipTextureObject_t textureObject, float x) {
473  TEXTURE_PARAMETERS_INIT;
474  texel.f = __ockl_image_sample_1D(i, s, x);
475  TEXTURE_SET_SIGNED;
476 }
477 
478 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char1* retVal, hipTextureObject_t textureObject, float x) {
479  TEXTURE_PARAMETERS_INIT;
480  texel.f = __ockl_image_sample_1D(i, s, x);
481  TEXTURE_SET_SIGNED_X;
482 }
483 
484 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char2* retVal, hipTextureObject_t textureObject, float x) {
485  TEXTURE_PARAMETERS_INIT;
486  texel.f = __ockl_image_sample_1D(i, s, x);
487  TEXTURE_SET_SIGNED_XY;
488 }
489 
490 __TEXTURE_FUNCTIONS_DECL__ void tex1D(char4* retVal, hipTextureObject_t textureObject, float x) {
491  TEXTURE_PARAMETERS_INIT;
492  texel.f = __ockl_image_sample_1D(i, s, x);
493  TEXTURE_SET_SIGNED_XYZW;
494 }
495 
496 __TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned char* retVal, hipTextureObject_t textureObject,
497  float x) {
498  TEXTURE_PARAMETERS_INIT;
499  texel.f = __ockl_image_sample_1D(i, s, x);
500  TEXTURE_SET_UNSIGNED;
501 }
502 
503 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar1* retVal, hipTextureObject_t textureObject, float x) {
504  TEXTURE_PARAMETERS_INIT;
505  texel.f = __ockl_image_sample_1D(i, s, x);
506  TEXTURE_SET_UNSIGNED_X;
507 }
508 
509 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar2* retVal, hipTextureObject_t textureObject, float x) {
510  TEXTURE_PARAMETERS_INIT;
511  texel.f = __ockl_image_sample_1D(i, s, x);
512  TEXTURE_SET_UNSIGNED_XY;
513 }
514 
515 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar4* retVal, hipTextureObject_t textureObject, float x) {
516  TEXTURE_PARAMETERS_INIT;
517  texel.f = __ockl_image_sample_1D(i, s, x);
518  TEXTURE_SET_UNSIGNED_XYZW;
519 }
520 
521 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short* retVal, hipTextureObject_t textureObject, float x) {
522  TEXTURE_PARAMETERS_INIT;
523  texel.f = __ockl_image_sample_1D(i, s, x);
524  TEXTURE_SET_SIGNED;
525 }
526 
527 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short1* retVal, hipTextureObject_t textureObject, float x) {
528  TEXTURE_PARAMETERS_INIT;
529  texel.f = __ockl_image_sample_1D(i, s, x);
530  TEXTURE_SET_SIGNED_X;
531 }
532 
533 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short2* retVal, hipTextureObject_t textureObject, float x) {
534  TEXTURE_PARAMETERS_INIT;
535  texel.f = __ockl_image_sample_1D(i, s, x);
536  TEXTURE_SET_SIGNED_XY;
537 }
538 
539 __TEXTURE_FUNCTIONS_DECL__ void tex1D(short4* retVal, hipTextureObject_t textureObject, float x) {
540  TEXTURE_PARAMETERS_INIT;
541  texel.f = __ockl_image_sample_1D(i, s, x);
542  TEXTURE_SET_SIGNED_XYZW;
543 }
544 
545 __TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned short* retVal, hipTextureObject_t textureObject,
546  float x) {
547  TEXTURE_PARAMETERS_INIT;
548  texel.f = __ockl_image_sample_1D(i, s, x);
549  TEXTURE_SET_UNSIGNED;
550 }
551 
552 __TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort1* retVal, hipTextureObject_t textureObject, float x) {
553  TEXTURE_PARAMETERS_INIT;
554  texel.f = __ockl_image_sample_1D(i, s, x);
555  TEXTURE_SET_UNSIGNED_X;
556 }
557 
558 __TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort2* retVal, hipTextureObject_t textureObject, float x) {
559  TEXTURE_PARAMETERS_INIT;
560  texel.f = __ockl_image_sample_1D(i, s, x);
561  TEXTURE_SET_UNSIGNED_XY;
562 }
563 
564 __TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort4* retVal, hipTextureObject_t textureObject, float x) {
565  TEXTURE_PARAMETERS_INIT;
566  texel.f = __ockl_image_sample_1D(i, s, x);
567  TEXTURE_SET_UNSIGNED_XYZW;
568 }
569 
570 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int* retVal, hipTextureObject_t textureObject, float x) {
571  TEXTURE_PARAMETERS_INIT;
572  texel.f = __ockl_image_sample_1D(i, s, x);
573  TEXTURE_SET_SIGNED;
574 }
575 
576 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int1* retVal, hipTextureObject_t textureObject, float x) {
577  TEXTURE_PARAMETERS_INIT;
578  texel.f = __ockl_image_sample_1D(i, s, x);
579  TEXTURE_SET_SIGNED_X;
580 }
581 
582 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int2* retVal, hipTextureObject_t textureObject, float x) {
583  TEXTURE_PARAMETERS_INIT;
584  texel.f = __ockl_image_sample_1D(i, s, x);
585  TEXTURE_SET_SIGNED_XY;
586 }
587 
588 __TEXTURE_FUNCTIONS_DECL__ void tex1D(int4* retVal, hipTextureObject_t textureObject, float x) {
589  TEXTURE_PARAMETERS_INIT;
590  texel.f = __ockl_image_sample_1D(i, s, x);
591  TEXTURE_SET_SIGNED_XYZW;
592 }
593 
594 __TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned int* retVal, hipTextureObject_t textureObject,
595  float x) {
596  TEXTURE_PARAMETERS_INIT;
597  texel.f = __ockl_image_sample_1D(i, s, x);
598  TEXTURE_SET_UNSIGNED;
599 }
600 
601 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uint1* retVal, hipTextureObject_t textureObject, float x) {
602  TEXTURE_PARAMETERS_INIT;
603  texel.f = __ockl_image_sample_1D(i, s, x);
604  TEXTURE_SET_UNSIGNED_X;
605 }
606 
607 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uint2* retVal, hipTextureObject_t textureObject, float x) {
608  TEXTURE_PARAMETERS_INIT;
609  texel.f = __ockl_image_sample_1D(i, s, x);
610  TEXTURE_SET_UNSIGNED_XY;
611 }
612 
613 __TEXTURE_FUNCTIONS_DECL__ void tex1D(uint4* retVal, hipTextureObject_t textureObject, float x) {
614  TEXTURE_PARAMETERS_INIT;
615  texel.f = __ockl_image_sample_1D(i, s, x);
616  TEXTURE_SET_UNSIGNED_XYZW;
617 }
618 
619 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float* retVal, hipTextureObject_t textureObject, float x) {
620  TEXTURE_PARAMETERS_INIT;
621  texel.f = __ockl_image_sample_1D(i, s, x);
622  TEXTURE_SET_FLOAT;
623 }
624 
625 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float1* retVal, hipTextureObject_t textureObject, float x) {
626  TEXTURE_PARAMETERS_INIT;
627  texel.f = __ockl_image_sample_1D(i, s, x);
628  TEXTURE_SET_FLOAT_X;
629 }
630 
631 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float2* retVal, hipTextureObject_t textureObject, float x) {
632  TEXTURE_PARAMETERS_INIT;
633  texel.f = __ockl_image_sample_1D(i, s, x);
634  TEXTURE_SET_FLOAT_XY;
635 }
636 
637 __TEXTURE_FUNCTIONS_DECL__ void tex1D(float4* retVal, hipTextureObject_t textureObject, float x) {
638  TEXTURE_PARAMETERS_INIT;
639  texel.f = __ockl_image_sample_1D(i, s, x);
640  TEXTURE_SET_FLOAT_XYZW;
641 }
642 template <class T>
643 __TEXTURE_FUNCTIONS_DECL__ T tex1D(hipTextureObject_t textureObject, float x) {
644  T ret;
645  tex1D(&ret, textureObject, x);
646  return ret;
647 }
648 
650 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char* retVal, hipTextureObject_t textureObject, float x,
651  float level) {
652  TEXTURE_PARAMETERS_INIT;
653  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
654  TEXTURE_SET_SIGNED;
655 }
656 
657 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char1* retVal, hipTextureObject_t textureObject, float x,
658  float level) {
659  TEXTURE_PARAMETERS_INIT;
660  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
661  TEXTURE_SET_SIGNED_X;
662 }
663 
664 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char2* retVal, hipTextureObject_t textureObject, float x,
665  float level) {
666  TEXTURE_PARAMETERS_INIT;
667  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
668  TEXTURE_SET_SIGNED_XY;
669 }
670 
671 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char4* retVal, hipTextureObject_t textureObject, float x,
672  float level) {
673  TEXTURE_PARAMETERS_INIT;
674  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
675  TEXTURE_SET_SIGNED_XYZW;
676 }
677 
678 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned char* retVal, hipTextureObject_t textureObject,
679  float x, float level) {
680  TEXTURE_PARAMETERS_INIT;
681  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
682  TEXTURE_SET_UNSIGNED;
683 }
684 
685 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar1* retVal, hipTextureObject_t textureObject, float x,
686  float level) {
687  TEXTURE_PARAMETERS_INIT;
688  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
689  TEXTURE_SET_UNSIGNED_X;
690 }
691 
692 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar2* retVal, hipTextureObject_t textureObject, float x,
693  float level) {
694  TEXTURE_PARAMETERS_INIT;
695  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
696  TEXTURE_SET_UNSIGNED_XY;
697 }
698 
699 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar4* retVal, hipTextureObject_t textureObject, float x,
700  float level) {
701  TEXTURE_PARAMETERS_INIT;
702  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
703  TEXTURE_SET_UNSIGNED_XYZW;
704 }
705 
706 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short* retVal, hipTextureObject_t textureObject, float x,
707  float level) {
708  TEXTURE_PARAMETERS_INIT;
709  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
710  TEXTURE_SET_SIGNED;
711 }
712 
713 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short1* retVal, hipTextureObject_t textureObject, float x,
714  float level) {
715  TEXTURE_PARAMETERS_INIT;
716  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
717  TEXTURE_SET_SIGNED_X;
718 }
719 
720 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short2* retVal, hipTextureObject_t textureObject, float x,
721  float level) {
722  TEXTURE_PARAMETERS_INIT;
723  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
724  TEXTURE_SET_SIGNED_XY;
725 }
726 
727 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short4* retVal, hipTextureObject_t textureObject, float x,
728  float level) {
729  TEXTURE_PARAMETERS_INIT;
730  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
731  TEXTURE_SET_SIGNED_XYZW;
732 }
733 
734 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned short* retVal, hipTextureObject_t textureObject,
735  float x, float level) {
736  TEXTURE_PARAMETERS_INIT;
737  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
738  TEXTURE_SET_UNSIGNED;
739 }
740 
741 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort1* retVal, hipTextureObject_t textureObject, float x,
742  float level) {
743  TEXTURE_PARAMETERS_INIT;
744  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
745  TEXTURE_SET_UNSIGNED_X;
746 }
747 
748 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort2* retVal, hipTextureObject_t textureObject, float x,
749  float level) {
750  TEXTURE_PARAMETERS_INIT;
751  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
752  TEXTURE_SET_UNSIGNED_XY;
753 }
754 
755 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort4* retVal, hipTextureObject_t textureObject, float x,
756  float level) {
757  TEXTURE_PARAMETERS_INIT;
758  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
759  TEXTURE_SET_UNSIGNED_XYZW;
760 }
761 
762 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int* retVal, hipTextureObject_t textureObject, float x,
763  float level) {
764  TEXTURE_PARAMETERS_INIT;
765  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
766  TEXTURE_SET_SIGNED;
767 }
768 
769 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int1* retVal, hipTextureObject_t textureObject, float x,
770  float level) {
771  TEXTURE_PARAMETERS_INIT;
772  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
773  TEXTURE_SET_SIGNED_X;
774 }
775 
776 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int2* retVal, hipTextureObject_t textureObject, float x,
777  float level) {
778  TEXTURE_PARAMETERS_INIT;
779  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
780  TEXTURE_SET_SIGNED_XY;
781 }
782 
783 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int4* retVal, hipTextureObject_t textureObject, float x,
784  float level) {
785  TEXTURE_PARAMETERS_INIT;
786  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
787  TEXTURE_SET_SIGNED_XYZW;
788 }
789 
790 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned int* retVal, hipTextureObject_t textureObject,
791  float x, float level) {
792  TEXTURE_PARAMETERS_INIT;
793  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
794  TEXTURE_SET_UNSIGNED;
795 }
796 
797 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint1* retVal, hipTextureObject_t textureObject, float x,
798  float level) {
799  TEXTURE_PARAMETERS_INIT;
800  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
801  TEXTURE_SET_UNSIGNED_X;
802 }
803 
804 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint2* retVal, hipTextureObject_t textureObject, float x,
805  float level) {
806  TEXTURE_PARAMETERS_INIT;
807  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
808  TEXTURE_SET_UNSIGNED_XY;
809 }
810 
811 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint4* retVal, hipTextureObject_t textureObject, float x,
812  float level) {
813  TEXTURE_PARAMETERS_INIT;
814  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
815  TEXTURE_SET_UNSIGNED_XYZW;
816 }
817 
818 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float* retVal, hipTextureObject_t textureObject, float x,
819  float level) {
820  TEXTURE_PARAMETERS_INIT;
821  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
822  TEXTURE_SET_FLOAT;
823 }
824 
825 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float1* retVal, hipTextureObject_t textureObject, float x,
826  float level) {
827  TEXTURE_PARAMETERS_INIT;
828  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
829  TEXTURE_SET_FLOAT_X;
830 }
831 
832 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float2* retVal, hipTextureObject_t textureObject, float x,
833  float level) {
834  TEXTURE_PARAMETERS_INIT;
835  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
836  TEXTURE_SET_FLOAT_XY;
837 }
838 
839 __TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float4* retVal, hipTextureObject_t textureObject, float x,
840  float level) {
841  TEXTURE_PARAMETERS_INIT;
842  texel.f = __ockl_image_sample_lod_1D(i, s, x, level);
843  TEXTURE_SET_FLOAT_XYZW;
844 }
845 
846 template <class T>
847 __TEXTURE_FUNCTIONS_DECL__ T tex1DLod(hipTextureObject_t textureObject, float x, float level) {
848  T ret;
849  tex1DLod(&ret, textureObject, x, level);
850  return ret;
851 }
852 
854 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char* retVal, hipTextureObject_t textureObject, float x,
855  float dx, float dy) {
856  TEXTURE_PARAMETERS_INIT;
857  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
858  TEXTURE_SET_SIGNED;
859 }
860 
861 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char1* retVal, hipTextureObject_t textureObject, float x,
862  float dx, float dy) {
863  TEXTURE_PARAMETERS_INIT;
864  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
865  TEXTURE_SET_SIGNED_X;
866 }
867 
868 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char2* retVal, hipTextureObject_t textureObject, float x,
869  float dx, float dy) {
870  TEXTURE_PARAMETERS_INIT;
871  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
872  TEXTURE_SET_SIGNED_XY;
873 }
874 
875 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char4* retVal, hipTextureObject_t textureObject, float x,
876  float dx, float dy) {
877  TEXTURE_PARAMETERS_INIT;
878  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
879  TEXTURE_SET_SIGNED_XYZW;
880 }
881 
882 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned char* retVal, hipTextureObject_t textureObject,
883  float x, float dx, float dy) {
884  TEXTURE_PARAMETERS_INIT;
885  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
886  TEXTURE_SET_UNSIGNED;
887 }
888 
889 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar1* retVal, hipTextureObject_t textureObject, float x,
890  float dx, float dy) {
891  TEXTURE_PARAMETERS_INIT;
892  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
893  TEXTURE_SET_UNSIGNED_X;
894 }
895 
896 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar2* retVal, hipTextureObject_t textureObject, float x,
897  float dx, float dy) {
898  TEXTURE_PARAMETERS_INIT;
899  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
900  TEXTURE_SET_UNSIGNED_XY;
901 }
902 
903 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar4* retVal, hipTextureObject_t textureObject, float x,
904  float dx, float dy) {
905  TEXTURE_PARAMETERS_INIT;
906  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
907  TEXTURE_SET_UNSIGNED_XYZW;
908 }
909 
910 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short* retVal, hipTextureObject_t textureObject, float x,
911  float dx, float dy) {
912  TEXTURE_PARAMETERS_INIT;
913  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
914  TEXTURE_SET_SIGNED;
915 }
916 
917 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short1* retVal, hipTextureObject_t textureObject, float x,
918  float dx, float dy) {
919  TEXTURE_PARAMETERS_INIT;
920  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
921  TEXTURE_SET_SIGNED_X;
922 }
923 
924 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short2* retVal, hipTextureObject_t textureObject, float x,
925  float dx, float dy) {
926  TEXTURE_PARAMETERS_INIT;
927  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
928  TEXTURE_SET_SIGNED_XY;
929 }
930 
931 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short4* retVal, hipTextureObject_t textureObject, float x,
932  float dx, float dy) {
933  TEXTURE_PARAMETERS_INIT;
934  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
935  TEXTURE_SET_SIGNED_XYZW;
936 }
937 
938 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned short* retVal, hipTextureObject_t textureObject,
939  float x, float dx, float dy) {
940  TEXTURE_PARAMETERS_INIT;
941  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
942  TEXTURE_SET_UNSIGNED;
943 }
944 
945 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort1* retVal, hipTextureObject_t textureObject,
946  float x, float dx, float dy) {
947  TEXTURE_PARAMETERS_INIT;
948  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
949  TEXTURE_SET_UNSIGNED_X;
950 }
951 
952 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort2* retVal, hipTextureObject_t textureObject,
953  float x, float dx, float dy) {
954  TEXTURE_PARAMETERS_INIT;
955  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
956  TEXTURE_SET_UNSIGNED_XY;
957 }
958 
959 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort4* retVal, hipTextureObject_t textureObject,
960  float x, float dx, float dy) {
961  TEXTURE_PARAMETERS_INIT;
962  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
963  TEXTURE_SET_UNSIGNED_XYZW;
964 }
965 
966 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int* retVal, hipTextureObject_t textureObject, float x,
967  float dx, float dy) {
968  TEXTURE_PARAMETERS_INIT;
969  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
970  TEXTURE_SET_SIGNED;
971 }
972 
973 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int1* retVal, hipTextureObject_t textureObject, float x,
974  float dx, float dy) {
975  TEXTURE_PARAMETERS_INIT;
976  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
977  TEXTURE_SET_SIGNED_X;
978 }
979 
980 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int2* retVal, hipTextureObject_t textureObject, float x,
981  float dx, float dy) {
982  TEXTURE_PARAMETERS_INIT;
983  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
984  TEXTURE_SET_SIGNED_XY;
985 }
986 
987 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int4* retVal, hipTextureObject_t textureObject, float x,
988  float dx, float dy) {
989  TEXTURE_PARAMETERS_INIT;
990  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
991  TEXTURE_SET_SIGNED_XYZW;
992 }
993 
994 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned int* retVal, hipTextureObject_t textureObject,
995  float x, float dx, float dy) {
996  TEXTURE_PARAMETERS_INIT;
997  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
998  TEXTURE_SET_UNSIGNED;
999 }
1000 
1001 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint1* retVal, hipTextureObject_t textureObject, float x,
1002  float dx, float dy) {
1003  TEXTURE_PARAMETERS_INIT;
1004  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1005  TEXTURE_SET_UNSIGNED_X;
1006 }
1007 
1008 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint2* retVal, hipTextureObject_t textureObject, float x,
1009  float dx, float dy) {
1010  TEXTURE_PARAMETERS_INIT;
1011  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1012  TEXTURE_SET_UNSIGNED_XY;
1013 }
1014 
1015 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint4* retVal, hipTextureObject_t textureObject, float x,
1016  float dx, float dy) {
1017  TEXTURE_PARAMETERS_INIT;
1018  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1019  TEXTURE_SET_UNSIGNED_XYZW;
1020 }
1021 
1022 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float* retVal, hipTextureObject_t textureObject, float x,
1023  float dx, float dy) {
1024  TEXTURE_PARAMETERS_INIT;
1025  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1026  TEXTURE_SET_FLOAT;
1027 }
1028 
1029 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float1* retVal, hipTextureObject_t textureObject, float x,
1030  float dx, float dy) {
1031  TEXTURE_PARAMETERS_INIT;
1032  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1033  TEXTURE_SET_FLOAT_X;
1034 }
1035 
1036 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float2* retVal, hipTextureObject_t textureObject, float x,
1037  float dx, float dy) {
1038  TEXTURE_PARAMETERS_INIT;
1039  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1040  TEXTURE_SET_FLOAT_XY;
1041 }
1042 
1043 __TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float4* retVal, hipTextureObject_t textureObject, float x,
1044  float dx, float dy) {
1045  TEXTURE_PARAMETERS_INIT;
1046  texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy);
1047  TEXTURE_SET_FLOAT_XYZW;
1048 }
1049 
1050 template <class T>
1051 __TEXTURE_FUNCTIONS_DECL__ T tex1DGrad(hipTextureObject_t textureObject, float x, float dx,
1052  float dy) {
1053  T ret;
1054  tex1DLod(&ret, textureObject, x, dx, dy);
1055  return ret;
1056 }
1057 
1059 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char* retVal, hipTextureObject_t textureObject, float x,
1060  float y) {
1061  TEXTURE_PARAMETERS_INIT;
1062  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1063  TEXTURE_SET_SIGNED;
1064 }
1065 
1066 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char1* retVal, hipTextureObject_t textureObject, float x,
1067  float y) {
1068  TEXTURE_PARAMETERS_INIT;
1069  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1070  TEXTURE_SET_SIGNED_X;
1071 }
1072 
1073 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char2* retVal, hipTextureObject_t textureObject, float x,
1074  float y) {
1075  TEXTURE_PARAMETERS_INIT;
1076  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1077  TEXTURE_SET_SIGNED_XY;
1078 }
1079 
1080 __TEXTURE_FUNCTIONS_DECL__ void tex2D(char4* retVal, hipTextureObject_t textureObject, float x,
1081  float y) {
1082  TEXTURE_PARAMETERS_INIT;
1083  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1084  TEXTURE_SET_SIGNED_XYZW;
1085 }
1086 
1087 __TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned char* retVal, hipTextureObject_t textureObject,
1088  float x, float y) {
1089  TEXTURE_PARAMETERS_INIT;
1090  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1091  TEXTURE_SET_UNSIGNED;
1092 }
1093 
1094 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar1* retVal, hipTextureObject_t textureObject, float x,
1095  float y) {
1096  TEXTURE_PARAMETERS_INIT;
1097  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1098  TEXTURE_SET_UNSIGNED_X;
1099 }
1100 
1101 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar2* retVal, hipTextureObject_t textureObject, float x,
1102  float y) {
1103  TEXTURE_PARAMETERS_INIT;
1104  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1105  TEXTURE_SET_UNSIGNED_XY;
1106 }
1107 
1108 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar4* retVal, hipTextureObject_t textureObject, float x,
1109  float y) {
1110  TEXTURE_PARAMETERS_INIT;
1111  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1112  TEXTURE_SET_UNSIGNED_XYZW;
1113 }
1114 
1115 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short* retVal, hipTextureObject_t textureObject, float x,
1116  float y) {
1117  TEXTURE_PARAMETERS_INIT;
1118  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1119  TEXTURE_SET_SIGNED;
1120 }
1121 
1122 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short1* retVal, hipTextureObject_t textureObject, float x,
1123  float y) {
1124  TEXTURE_PARAMETERS_INIT;
1125  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1126  TEXTURE_SET_SIGNED_X;
1127 }
1128 
1129 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short2* retVal, hipTextureObject_t textureObject, float x,
1130  float y) {
1131  TEXTURE_PARAMETERS_INIT;
1132  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1133  TEXTURE_SET_SIGNED_XY;
1134 }
1135 
1136 __TEXTURE_FUNCTIONS_DECL__ void tex2D(short4* retVal, hipTextureObject_t textureObject, float x,
1137  float y) {
1138  TEXTURE_PARAMETERS_INIT;
1139  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1140  TEXTURE_SET_SIGNED_XYZW;
1141 }
1142 
1143 __TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned short* retVal, hipTextureObject_t textureObject,
1144  float x, float y) {
1145  TEXTURE_PARAMETERS_INIT;
1146  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1147  TEXTURE_SET_UNSIGNED;
1148 }
1149 
1150 __TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort1* retVal, hipTextureObject_t textureObject, float x,
1151  float y) {
1152  TEXTURE_PARAMETERS_INIT;
1153  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1154  TEXTURE_SET_UNSIGNED_X;
1155 }
1156 
1157 __TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort2* retVal, hipTextureObject_t textureObject, float x,
1158  float y) {
1159  TEXTURE_PARAMETERS_INIT;
1160  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1161  TEXTURE_SET_UNSIGNED_XY;
1162 }
1163 
1164 __TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort4* retVal, hipTextureObject_t textureObject, float x,
1165  float y) {
1166  TEXTURE_PARAMETERS_INIT;
1167  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1168  TEXTURE_SET_UNSIGNED_XYZW;
1169 }
1170 
1171 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int* retVal, hipTextureObject_t textureObject, float x,
1172  float y) {
1173  TEXTURE_PARAMETERS_INIT;
1174  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1175  TEXTURE_SET_SIGNED;
1176 }
1177 
1178 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int1* retVal, hipTextureObject_t textureObject, float x,
1179  float y) {
1180  TEXTURE_PARAMETERS_INIT;
1181  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1182  TEXTURE_SET_SIGNED_X;
1183 }
1184 
1185 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int2* retVal, hipTextureObject_t textureObject, float x,
1186  float y) {
1187  TEXTURE_PARAMETERS_INIT;
1188  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1189  TEXTURE_SET_SIGNED_XY;
1190 }
1191 
1192 __TEXTURE_FUNCTIONS_DECL__ void tex2D(int4* retVal, hipTextureObject_t textureObject, float x,
1193  float y) {
1194  TEXTURE_PARAMETERS_INIT;
1195  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1196  TEXTURE_SET_SIGNED_XYZW;
1197 }
1198 
1199 __TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned int* retVal, hipTextureObject_t textureObject,
1200  float x, float y) {
1201  TEXTURE_PARAMETERS_INIT;
1202  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1203  TEXTURE_SET_UNSIGNED;
1204 }
1205 
1206 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uint1* retVal, hipTextureObject_t textureObject, float x,
1207  float y) {
1208  TEXTURE_PARAMETERS_INIT;
1209  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1210  TEXTURE_SET_UNSIGNED_X;
1211 }
1212 
1213 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uint2* retVal, hipTextureObject_t textureObject, float x,
1214  float y) {
1215  TEXTURE_PARAMETERS_INIT;
1216  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1217  TEXTURE_SET_UNSIGNED_XY;
1218 }
1219 
1220 __TEXTURE_FUNCTIONS_DECL__ void tex2D(uint4* retVal, hipTextureObject_t textureObject, float x,
1221  float y) {
1222  TEXTURE_PARAMETERS_INIT;
1223  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1224  TEXTURE_SET_UNSIGNED_XYZW;
1225 }
1226 
1227 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float* retVal, hipTextureObject_t textureObject, float x,
1228  float y) {
1229  TEXTURE_PARAMETERS_INIT;
1230  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1231  TEXTURE_SET_FLOAT;
1232 }
1233 
1234 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float1* retVal, hipTextureObject_t textureObject, float x,
1235  float y) {
1236  TEXTURE_PARAMETERS_INIT;
1237  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1238  TEXTURE_SET_FLOAT_X;
1239 }
1240 
1241 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float2* retVal, hipTextureObject_t textureObject, float x,
1242  float y) {
1243  TEXTURE_PARAMETERS_INIT;
1244  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1245  TEXTURE_SET_FLOAT_XY;
1246 }
1247 
1248 __TEXTURE_FUNCTIONS_DECL__ void tex2D(float4* retVal, hipTextureObject_t textureObject, float x,
1249  float y) {
1250  TEXTURE_PARAMETERS_INIT;
1251  texel.f = __ockl_image_sample_2D(i, s, float2(x, y).data);
1252  TEXTURE_SET_FLOAT_XYZW;
1253 }
1254 
1255 template <class T>
1256 __TEXTURE_FUNCTIONS_DECL__ T tex2D(hipTextureObject_t textureObject, float x, float y) {
1257  T ret;
1258  tex2D(&ret, textureObject, x, y);
1259  return ret;
1260 }
1261 
1263 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char* retVal, hipTextureObject_t textureObject, float x,
1264  float y, float level) {
1265  TEXTURE_PARAMETERS_INIT;
1266  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1267  TEXTURE_SET_SIGNED;
1268 }
1269 
1270 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char1* retVal, hipTextureObject_t textureObject, float x,
1271  float y, float level) {
1272  TEXTURE_PARAMETERS_INIT;
1273  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1274  TEXTURE_SET_SIGNED_X;
1275 }
1276 
1277 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char2* retVal, hipTextureObject_t textureObject, float x,
1278  float y, float level) {
1279  TEXTURE_PARAMETERS_INIT;
1280  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1281  TEXTURE_SET_SIGNED_XY;
1282 }
1283 
1284 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char4* retVal, hipTextureObject_t textureObject, float x,
1285  float y, float level) {
1286  TEXTURE_PARAMETERS_INIT;
1287  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1288  TEXTURE_SET_SIGNED_XYZW;
1289 }
1290 
1291 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned char* retVal, hipTextureObject_t textureObject,
1292  float x, float y, float level) {
1293  TEXTURE_PARAMETERS_INIT;
1294  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1295  TEXTURE_SET_UNSIGNED;
1296 }
1297 
1298 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar1* retVal, hipTextureObject_t textureObject, float x,
1299  float y, float level) {
1300  TEXTURE_PARAMETERS_INIT;
1301  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1302  TEXTURE_SET_UNSIGNED_X;
1303 }
1304 
1305 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar2* retVal, hipTextureObject_t textureObject, float x,
1306  float y, float level) {
1307  TEXTURE_PARAMETERS_INIT;
1308  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1309  TEXTURE_SET_UNSIGNED_XY;
1310 }
1311 
1312 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar4* retVal, hipTextureObject_t textureObject, float x,
1313  float y, float level) {
1314  TEXTURE_PARAMETERS_INIT;
1315  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1316  TEXTURE_SET_UNSIGNED_XYZW;
1317 }
1318 
1319 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short* retVal, hipTextureObject_t textureObject, float x,
1320  float y, float level) {
1321  TEXTURE_PARAMETERS_INIT;
1322  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1323  TEXTURE_SET_SIGNED;
1324 }
1325 
1326 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short1* retVal, hipTextureObject_t textureObject, float x,
1327  float y, float level) {
1328  TEXTURE_PARAMETERS_INIT;
1329  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1330  TEXTURE_SET_SIGNED_X;
1331 }
1332 
1333 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short2* retVal, hipTextureObject_t textureObject, float x,
1334  float y, float level) {
1335  TEXTURE_PARAMETERS_INIT;
1336  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1337  TEXTURE_SET_SIGNED_XY;
1338 }
1339 
1340 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short4* retVal, hipTextureObject_t textureObject, float x,
1341  float y, float level) {
1342  TEXTURE_PARAMETERS_INIT;
1343  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1344  TEXTURE_SET_SIGNED_XYZW;
1345 }
1346 
1347 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned short* retVal, hipTextureObject_t textureObject,
1348  float x, float y, float level) {
1349  TEXTURE_PARAMETERS_INIT;
1350  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1351  TEXTURE_SET_UNSIGNED;
1352 }
1353 
1354 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort1* retVal, hipTextureObject_t textureObject, float x,
1355  float y, float level) {
1356  TEXTURE_PARAMETERS_INIT;
1357  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1358  TEXTURE_SET_UNSIGNED_X;
1359 }
1360 
1361 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort2* retVal, hipTextureObject_t textureObject, float x,
1362  float y, float level) {
1363  TEXTURE_PARAMETERS_INIT;
1364  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1365  TEXTURE_SET_UNSIGNED_XY;
1366 }
1367 
1368 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort4* retVal, hipTextureObject_t textureObject, float x,
1369  float y, float level) {
1370  TEXTURE_PARAMETERS_INIT;
1371  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1372  TEXTURE_SET_UNSIGNED_XYZW;
1373 }
1374 
1375 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int* retVal, hipTextureObject_t textureObject, float x,
1376  float y, float level) {
1377  TEXTURE_PARAMETERS_INIT;
1378  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1379  TEXTURE_SET_SIGNED;
1380 }
1381 
1382 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int1* retVal, hipTextureObject_t textureObject, float x,
1383  float y, float level) {
1384  TEXTURE_PARAMETERS_INIT;
1385  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1386  TEXTURE_SET_SIGNED_X;
1387 }
1388 
1389 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int2* retVal, hipTextureObject_t textureObject, float x,
1390  float y, float level) {
1391  TEXTURE_PARAMETERS_INIT;
1392  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1393  TEXTURE_SET_SIGNED_XY;
1394 }
1395 
1396 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int4* retVal, hipTextureObject_t textureObject, float x,
1397  float y, float level) {
1398  TEXTURE_PARAMETERS_INIT;
1399  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1400  TEXTURE_SET_SIGNED_XYZW;
1401 }
1402 
1403 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned int* retVal, hipTextureObject_t textureObject,
1404  float x, float y, float level) {
1405  TEXTURE_PARAMETERS_INIT;
1406  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1407  TEXTURE_SET_UNSIGNED;
1408 }
1409 
1410 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint1* retVal, hipTextureObject_t textureObject, float x,
1411  float y, float level) {
1412  TEXTURE_PARAMETERS_INIT;
1413  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1414  TEXTURE_SET_UNSIGNED_X;
1415 }
1416 
1417 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint2* retVal, hipTextureObject_t textureObject, float x,
1418  float y, float level) {
1419  TEXTURE_PARAMETERS_INIT;
1420  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1421  TEXTURE_SET_UNSIGNED_XY;
1422 }
1423 
1424 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint4* retVal, hipTextureObject_t textureObject, float x,
1425  float y, float level) {
1426  TEXTURE_PARAMETERS_INIT;
1427  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1428  TEXTURE_SET_UNSIGNED_XYZW;
1429 }
1430 
1431 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float* retVal, hipTextureObject_t textureObject, float x,
1432  float y, float level) {
1433  TEXTURE_PARAMETERS_INIT;
1434  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1435  TEXTURE_SET_FLOAT;
1436 }
1437 
1438 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float1* retVal, hipTextureObject_t textureObject, float x,
1439  float y, float level) {
1440  TEXTURE_PARAMETERS_INIT;
1441  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1442  TEXTURE_SET_FLOAT_X;
1443 }
1444 
1445 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float2* retVal, hipTextureObject_t textureObject, float x,
1446  float y, float level) {
1447  TEXTURE_PARAMETERS_INIT;
1448  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1449  TEXTURE_SET_FLOAT_XY;
1450 }
1451 
1452 __TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float4* retVal, hipTextureObject_t textureObject, float x,
1453  float y, float level) {
1454  TEXTURE_PARAMETERS_INIT;
1455  texel.f = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
1456  TEXTURE_SET_FLOAT_XYZW;
1457 }
1458 
1459 template <class T>
1460 __TEXTURE_FUNCTIONS_DECL__ T tex2DLod(hipTextureObject_t textureObject, float x, float y,
1461  float level) {
1462  T ret;
1463  tex2DLod(&ret, textureObject, x, y, level);
1464  return ret;
1465 }
1466 
1468 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char* retVal, hipTextureObject_t textureObject, float x,
1469  float y, float z) {
1470  TEXTURE_PARAMETERS_INIT;
1471  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1472  TEXTURE_SET_SIGNED;
1473 }
1474 
1475 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char1* retVal, hipTextureObject_t textureObject, float x,
1476  float y, float z) {
1477  TEXTURE_PARAMETERS_INIT;
1478  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1479  TEXTURE_SET_SIGNED_X;
1480 }
1481 
1482 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char2* retVal, hipTextureObject_t textureObject, float x,
1483  float y, float z) {
1484  TEXTURE_PARAMETERS_INIT;
1485  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1486  TEXTURE_SET_SIGNED_XY;
1487 }
1488 
1489 __TEXTURE_FUNCTIONS_DECL__ void tex3D(char4* retVal, hipTextureObject_t textureObject, float x,
1490  float y, float z) {
1491  TEXTURE_PARAMETERS_INIT;
1492  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1493  TEXTURE_SET_SIGNED_XYZW;
1494 }
1495 
1496 __TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned char* retVal, hipTextureObject_t textureObject,
1497  float x, float y, float z) {
1498  TEXTURE_PARAMETERS_INIT;
1499  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1500  TEXTURE_SET_UNSIGNED;
1501 }
1502 
1503 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar1* retVal, hipTextureObject_t textureObject, float x,
1504  float y, float z) {
1505  TEXTURE_PARAMETERS_INIT;
1506  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1507  TEXTURE_SET_UNSIGNED_X;
1508 }
1509 
1510 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar2* retVal, hipTextureObject_t textureObject, float x,
1511  float y, float z) {
1512  TEXTURE_PARAMETERS_INIT;
1513  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1514  TEXTURE_SET_UNSIGNED_XY;
1515 }
1516 
1517 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar4* retVal, hipTextureObject_t textureObject, float x,
1518  float y, float z) {
1519  TEXTURE_PARAMETERS_INIT;
1520  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1521  TEXTURE_SET_UNSIGNED_XYZW;
1522 }
1523 
1524 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short* retVal, hipTextureObject_t textureObject, float x,
1525  float y, float z) {
1526  TEXTURE_PARAMETERS_INIT;
1527  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1528  TEXTURE_SET_SIGNED;
1529 }
1530 
1531 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short1* retVal, hipTextureObject_t textureObject, float x,
1532  float y, float z) {
1533  TEXTURE_PARAMETERS_INIT;
1534  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1535  TEXTURE_SET_SIGNED_X;
1536 }
1537 
1538 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short2* retVal, hipTextureObject_t textureObject, float x,
1539  float y, float z) {
1540  TEXTURE_PARAMETERS_INIT;
1541  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1542  TEXTURE_SET_SIGNED_XY;
1543 }
1544 
1545 __TEXTURE_FUNCTIONS_DECL__ void tex3D(short4* retVal, hipTextureObject_t textureObject, float x,
1546  float y, float z) {
1547  TEXTURE_PARAMETERS_INIT;
1548  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1549  TEXTURE_SET_SIGNED_XYZW;
1550 }
1551 
1552 __TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned short* retVal, hipTextureObject_t textureObject,
1553  float x, float y, float z) {
1554  TEXTURE_PARAMETERS_INIT;
1555  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1556  TEXTURE_SET_UNSIGNED;
1557 }
1558 
1559 __TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort1* retVal, hipTextureObject_t textureObject, float x,
1560  float y, float z) {
1561  TEXTURE_PARAMETERS_INIT;
1562  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1563  TEXTURE_SET_UNSIGNED_X;
1564 }
1565 
1566 __TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort2* retVal, hipTextureObject_t textureObject, float x,
1567  float y, float z) {
1568  TEXTURE_PARAMETERS_INIT;
1569  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1570  TEXTURE_SET_UNSIGNED_XY;
1571 }
1572 
1573 __TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort4* retVal, hipTextureObject_t textureObject, float x,
1574  float y, float z) {
1575  TEXTURE_PARAMETERS_INIT;
1576  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1577  TEXTURE_SET_UNSIGNED_XYZW;
1578 }
1579 
1580 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int* retVal, hipTextureObject_t textureObject, float x,
1581  float y, float z) {
1582  TEXTURE_PARAMETERS_INIT;
1583  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1584  TEXTURE_SET_SIGNED;
1585 }
1586 
1587 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int1* retVal, hipTextureObject_t textureObject, float x,
1588  float y, float z) {
1589  TEXTURE_PARAMETERS_INIT;
1590  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1591  TEXTURE_SET_SIGNED_X;
1592 }
1593 
1594 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int2* retVal, hipTextureObject_t textureObject, float x,
1595  float y, float z) {
1596  TEXTURE_PARAMETERS_INIT;
1597  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1598  TEXTURE_SET_SIGNED_XY;
1599 }
1600 
1601 __TEXTURE_FUNCTIONS_DECL__ void tex3D(int4* retVal, hipTextureObject_t textureObject, float x,
1602  float y, float z) {
1603  TEXTURE_PARAMETERS_INIT;
1604  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1605  TEXTURE_SET_SIGNED_XYZW;
1606 }
1607 
1608 __TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned int* retVal, hipTextureObject_t textureObject,
1609  float x, float y, float z) {
1610  TEXTURE_PARAMETERS_INIT;
1611  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1612  TEXTURE_SET_UNSIGNED;
1613 }
1614 
1615 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uint1* retVal, hipTextureObject_t textureObject, float x,
1616  float y, float z) {
1617  TEXTURE_PARAMETERS_INIT;
1618  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1619  TEXTURE_SET_UNSIGNED_X;
1620 }
1621 
1622 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uint2* retVal, hipTextureObject_t textureObject, float x,
1623  float y, float z) {
1624  TEXTURE_PARAMETERS_INIT;
1625  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1626  TEXTURE_SET_UNSIGNED_XY;
1627 }
1628 
1629 __TEXTURE_FUNCTIONS_DECL__ void tex3D(uint4* retVal, hipTextureObject_t textureObject, float x,
1630  float y, float z) {
1631  TEXTURE_PARAMETERS_INIT;
1632  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1633  TEXTURE_SET_UNSIGNED_XYZW;
1634 }
1635 
1636 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float* retVal, hipTextureObject_t textureObject, float x,
1637  float y, float z) {
1638  TEXTURE_PARAMETERS_INIT;
1639  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1640  TEXTURE_SET_FLOAT;
1641 }
1642 
1643 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float1* retVal, hipTextureObject_t textureObject, float x,
1644  float y, float z) {
1645  TEXTURE_PARAMETERS_INIT;
1646  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1647  TEXTURE_SET_FLOAT_X;
1648 }
1649 
1650 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float2* retVal, hipTextureObject_t textureObject, float x,
1651  float y, float z) {
1652  TEXTURE_PARAMETERS_INIT;
1653  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1654  TEXTURE_SET_FLOAT_XY;
1655 }
1656 
1657 __TEXTURE_FUNCTIONS_DECL__ void tex3D(float4* retVal, hipTextureObject_t textureObject, float x,
1658  float y, float z) {
1659  TEXTURE_PARAMETERS_INIT;
1660  texel.f = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
1661  TEXTURE_SET_FLOAT_XYZW;
1662 }
1663 
1664 template <class T>
1665 __TEXTURE_FUNCTIONS_DECL__ T tex3D(hipTextureObject_t textureObject, float x, float y, float z) {
1666  T ret;
1667  tex3D(&ret, textureObject, x, y, z);
1668  return ret;
1669 }
1670 
1672 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char* retVal, hipTextureObject_t textureObject, float x,
1673  float y, float z, float level) {
1674  TEXTURE_PARAMETERS_INIT;
1675  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1676  level);
1677  TEXTURE_SET_SIGNED;
1678 }
1679 
1680 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char1* retVal, hipTextureObject_t textureObject, float x,
1681  float y, float z, float level) {
1682  TEXTURE_PARAMETERS_INIT;
1683  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1684  level);
1685  TEXTURE_SET_SIGNED_X;
1686 }
1687 
1688 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char2* retVal, hipTextureObject_t textureObject, float x,
1689  float y, float z, float level) {
1690  TEXTURE_PARAMETERS_INIT;
1691  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1692  level);
1693  TEXTURE_SET_SIGNED_XY;
1694 }
1695 
1696 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char4* retVal, hipTextureObject_t textureObject, float x,
1697  float y, float z, float level) {
1698  TEXTURE_PARAMETERS_INIT;
1699  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1700  level);
1701  TEXTURE_SET_SIGNED_XYZW;
1702 }
1703 
1704 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned char* retVal, hipTextureObject_t textureObject,
1705  float x, float y, float z, float level) {
1706  TEXTURE_PARAMETERS_INIT;
1707  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1708  level);
1709  TEXTURE_SET_UNSIGNED;
1710 }
1711 
1712 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar1* retVal, hipTextureObject_t textureObject, float x,
1713  float y, float z, float level) {
1714  TEXTURE_PARAMETERS_INIT;
1715  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1716  level);
1717  TEXTURE_SET_UNSIGNED_X;
1718 }
1719 
1720 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar2* retVal, hipTextureObject_t textureObject, float x,
1721  float y, float z, float level) {
1722  TEXTURE_PARAMETERS_INIT;
1723  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1724  level);
1725  TEXTURE_SET_UNSIGNED_XY;
1726 }
1727 
1728 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar4* retVal, hipTextureObject_t textureObject, float x,
1729  float y, float z, float level) {
1730  TEXTURE_PARAMETERS_INIT;
1731  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1732  level);
1733  TEXTURE_SET_UNSIGNED_XYZW;
1734 }
1735 
1736 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short* retVal, hipTextureObject_t textureObject, float x,
1737  float y, float z, float level) {
1738  TEXTURE_PARAMETERS_INIT;
1739  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1740  level);
1741  TEXTURE_SET_SIGNED;
1742 }
1743 
1744 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short1* retVal, hipTextureObject_t textureObject, float x,
1745  float y, float z, float level) {
1746  TEXTURE_PARAMETERS_INIT;
1747  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1748  level);
1749  TEXTURE_SET_SIGNED_X;
1750 }
1751 
1752 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short2* retVal, hipTextureObject_t textureObject, float x,
1753  float y, float z, float level) {
1754  TEXTURE_PARAMETERS_INIT;
1755  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1756  level);
1757  TEXTURE_SET_SIGNED_XY;
1758 }
1759 
1760 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short4* retVal, hipTextureObject_t textureObject, float x,
1761  float y, float z, float level) {
1762  TEXTURE_PARAMETERS_INIT;
1763  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1764  level);
1765  TEXTURE_SET_SIGNED_XYZW;
1766 }
1767 
1768 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned short* retVal, hipTextureObject_t textureObject,
1769  float x, float y, float z, float level) {
1770  TEXTURE_PARAMETERS_INIT;
1771  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1772  level);
1773  TEXTURE_SET_UNSIGNED;
1774 }
1775 
1776 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort1* retVal, hipTextureObject_t textureObject, float x,
1777  float y, float z, float level) {
1778  TEXTURE_PARAMETERS_INIT;
1779  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1780  level);
1781  TEXTURE_SET_UNSIGNED_X;
1782 }
1783 
1784 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort2* retVal, hipTextureObject_t textureObject, float x,
1785  float y, float z, float level) {
1786  TEXTURE_PARAMETERS_INIT;
1787  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1788  level);
1789  TEXTURE_SET_UNSIGNED_XY;
1790 }
1791 
1792 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort4* retVal, hipTextureObject_t textureObject, float x,
1793  float y, float z, float level) {
1794  TEXTURE_PARAMETERS_INIT;
1795  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1796  level);
1797  TEXTURE_SET_UNSIGNED_XYZW;
1798 }
1799 
1800 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int* retVal, hipTextureObject_t textureObject, float x,
1801  float y, float z, float level) {
1802  TEXTURE_PARAMETERS_INIT;
1803  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1804  level);
1805  TEXTURE_SET_SIGNED;
1806 }
1807 
1808 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int1* retVal, hipTextureObject_t textureObject, float x,
1809  float y, float z, float level) {
1810  TEXTURE_PARAMETERS_INIT;
1811  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1812  level);
1813  TEXTURE_SET_SIGNED_X;
1814 }
1815 
1816 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int2* retVal, hipTextureObject_t textureObject, float x,
1817  float y, float z, float level) {
1818  TEXTURE_PARAMETERS_INIT;
1819  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1820  level);
1821  TEXTURE_SET_SIGNED_XY;
1822 }
1823 
1824 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int4* retVal, hipTextureObject_t textureObject, float x,
1825  float y, float z, float level) {
1826  TEXTURE_PARAMETERS_INIT;
1827  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1828  level);
1829  TEXTURE_SET_SIGNED_XYZW;
1830 }
1831 
1832 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned int* retVal, hipTextureObject_t textureObject,
1833  float x, float y, float z, float level) {
1834  TEXTURE_PARAMETERS_INIT;
1835  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1836  level);
1837  TEXTURE_SET_UNSIGNED;
1838 }
1839 
1840 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint1* retVal, hipTextureObject_t textureObject, float x,
1841  float y, float z, float level) {
1842  TEXTURE_PARAMETERS_INIT;
1843  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1844  level);
1845  TEXTURE_SET_UNSIGNED_X;
1846 }
1847 
1848 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint2* retVal, hipTextureObject_t textureObject, float x,
1849  float y, float z, float level) {
1850  TEXTURE_PARAMETERS_INIT;
1851  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1852  level);
1853  TEXTURE_SET_UNSIGNED_XY;
1854 }
1855 
1856 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint4* retVal, hipTextureObject_t textureObject, float x,
1857  float y, float z, float level) {
1858  TEXTURE_PARAMETERS_INIT;
1859  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1860  level);
1861  TEXTURE_SET_UNSIGNED_XYZW;
1862 }
1863 
1864 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float* retVal, hipTextureObject_t textureObject, float x,
1865  float y, float z, float level) {
1866  TEXTURE_PARAMETERS_INIT;
1867  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1868  level);
1869  TEXTURE_SET_FLOAT;
1870 }
1871 
1872 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float1* retVal, hipTextureObject_t textureObject, float x,
1873  float y, float z, float level) {
1874  TEXTURE_PARAMETERS_INIT;
1875  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1876  level);
1877  TEXTURE_SET_FLOAT_X;
1878 }
1879 
1880 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float2* retVal, hipTextureObject_t textureObject, float x,
1881  float y, float z, float level) {
1882  TEXTURE_PARAMETERS_INIT;
1883  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1884  level);
1885  TEXTURE_SET_FLOAT_XY;
1886 }
1887 
1888 __TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float4* retVal, hipTextureObject_t textureObject, float x,
1889  float y, float z, float level) {
1890  TEXTURE_PARAMETERS_INIT;
1891  texel.f = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data,
1892  level);
1893  TEXTURE_SET_FLOAT_XYZW;
1894 }
1895 
1896 template <class T>
1897 __TEXTURE_FUNCTIONS_DECL__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, float z,
1898  float level) {
1899  T ret;
1900  tex3DLod(&ret, textureObject, x, y, z, level);
1901  return ret;
1902 }
1903 
1905 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char* retVal, hipTextureObject_t textureObject,
1906  float x, int layer) {
1907  TEXTURE_PARAMETERS_INIT;
1908  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1909  TEXTURE_SET_SIGNED;
1910 }
1911 
1912 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char1* retVal, hipTextureObject_t textureObject,
1913  float x, int layer) {
1914  TEXTURE_PARAMETERS_INIT;
1915  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1916  TEXTURE_SET_SIGNED_X;
1917 }
1918 
1919 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char2* retVal, hipTextureObject_t textureObject,
1920  float x, int layer) {
1921  TEXTURE_PARAMETERS_INIT;
1922  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1923  TEXTURE_SET_SIGNED_XY;
1924 }
1925 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char4* retVal, hipTextureObject_t textureObject,
1926  float x, int layer) {
1927  TEXTURE_PARAMETERS_INIT;
1928  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1929  TEXTURE_SET_SIGNED_XYZW;
1930 }
1931 
1932 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned char* retVal,
1933  hipTextureObject_t textureObject, float x, int layer) {
1934  TEXTURE_PARAMETERS_INIT;
1935  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1936  TEXTURE_SET_UNSIGNED;
1937 }
1938 
1939 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar1* retVal, hipTextureObject_t textureObject,
1940  float x, int layer) {
1941  TEXTURE_PARAMETERS_INIT;
1942  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1943  TEXTURE_SET_UNSIGNED_X;
1944 }
1945 
1946 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar2* retVal, hipTextureObject_t textureObject,
1947  float x, int layer) {
1948  TEXTURE_PARAMETERS_INIT;
1949  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1950  TEXTURE_SET_UNSIGNED_XY;
1951 }
1952 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar4* retVal, hipTextureObject_t textureObject,
1953  float x, int layer) {
1954  TEXTURE_PARAMETERS_INIT;
1955  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1956  TEXTURE_SET_UNSIGNED_XYZW;
1957 }
1958 
1959 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short* retVal, hipTextureObject_t textureObject,
1960  float x, int layer) {
1961  TEXTURE_PARAMETERS_INIT;
1962  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1963  TEXTURE_SET_SIGNED;
1964 }
1965 
1966 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short1* retVal, hipTextureObject_t textureObject,
1967  float x, int layer) {
1968  TEXTURE_PARAMETERS_INIT;
1969  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1970  TEXTURE_SET_SIGNED_X;
1971 }
1972 
1973 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short2* retVal, hipTextureObject_t textureObject,
1974  float x, int layer) {
1975  TEXTURE_PARAMETERS_INIT;
1976  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1977  TEXTURE_SET_SIGNED_XY;
1978 }
1979 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short4* retVal, hipTextureObject_t textureObject,
1980  float x, int layer) {
1981  TEXTURE_PARAMETERS_INIT;
1982  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1983  TEXTURE_SET_SIGNED_XYZW;
1984 }
1985 
1986 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned short* retVal,
1987  hipTextureObject_t textureObject, float x, int layer) {
1988  TEXTURE_PARAMETERS_INIT;
1989  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1990  TEXTURE_SET_UNSIGNED;
1991 }
1992 
1993 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort1* retVal, hipTextureObject_t textureObject,
1994  float x, int layer) {
1995  TEXTURE_PARAMETERS_INIT;
1996  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
1997  TEXTURE_SET_UNSIGNED_X;
1998 }
1999 
2000 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort2* retVal, hipTextureObject_t textureObject,
2001  float x, int layer) {
2002  TEXTURE_PARAMETERS_INIT;
2003  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2004  TEXTURE_SET_UNSIGNED_XY;
2005 }
2006 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort4* retVal, hipTextureObject_t textureObject,
2007  float x, int layer) {
2008  TEXTURE_PARAMETERS_INIT;
2009  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2010  TEXTURE_SET_UNSIGNED_XYZW;
2011 }
2012 
2013 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int* retVal, hipTextureObject_t textureObject, float x,
2014  int layer) {
2015  TEXTURE_PARAMETERS_INIT;
2016  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2017  TEXTURE_SET_SIGNED;
2018 }
2019 
2020 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int1* retVal, hipTextureObject_t textureObject,
2021  float x, int layer) {
2022  TEXTURE_PARAMETERS_INIT;
2023  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2024  TEXTURE_SET_SIGNED_X;
2025 }
2026 
2027 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int2* retVal, hipTextureObject_t textureObject,
2028  float x, int layer) {
2029  TEXTURE_PARAMETERS_INIT;
2030  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2031  TEXTURE_SET_SIGNED_XY;
2032 }
2033 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int4* retVal, hipTextureObject_t textureObject,
2034  float x, int layer) {
2035  TEXTURE_PARAMETERS_INIT;
2036  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2037  TEXTURE_SET_SIGNED_XYZW;
2038 }
2039 
2040 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned int* retVal, hipTextureObject_t textureObject,
2041  float x, int layer) {
2042  TEXTURE_PARAMETERS_INIT;
2043  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2044  TEXTURE_SET_UNSIGNED;
2045 }
2046 
2047 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint1* retVal, hipTextureObject_t textureObject,
2048  float x, int layer) {
2049  TEXTURE_PARAMETERS_INIT;
2050  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2051  TEXTURE_SET_UNSIGNED_X;
2052 }
2053 
2054 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint2* retVal, hipTextureObject_t textureObject,
2055  float x, int layer) {
2056  TEXTURE_PARAMETERS_INIT;
2057  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2058  TEXTURE_SET_UNSIGNED_XY;
2059 }
2060 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint4* retVal, hipTextureObject_t textureObject,
2061  float x, int layer) {
2062  TEXTURE_PARAMETERS_INIT;
2063  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2064  TEXTURE_SET_UNSIGNED_XYZW;
2065 }
2066 
2067 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float* retVal, hipTextureObject_t textureObject,
2068  float x, int layer) {
2069  TEXTURE_PARAMETERS_INIT;
2070  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2071  TEXTURE_SET_FLOAT;
2072 }
2073 
2074 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float1* retVal, hipTextureObject_t textureObject,
2075  float x, int layer) {
2076  TEXTURE_PARAMETERS_INIT;
2077  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2078  TEXTURE_SET_FLOAT_X;
2079 }
2080 
2081 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float2* retVal, hipTextureObject_t textureObject,
2082  float x, int layer) {
2083  TEXTURE_PARAMETERS_INIT;
2084  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2085  TEXTURE_SET_FLOAT_XY;
2086 }
2087 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float4* retVal, hipTextureObject_t textureObject,
2088  float x, int layer) {
2089  TEXTURE_PARAMETERS_INIT;
2090  texel.f = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
2091  TEXTURE_SET_FLOAT_XYZW;
2092 }
2093 
2094 template <class T>
2095 __TEXTURE_FUNCTIONS_DECL__ T tex1DLayered(hipTextureObject_t textureObject, float x, int layer) {
2096  T ret;
2097  tex1DLayered(&ret, textureObject, x, layer);
2098  return ret;
2099 }
2100 
2102 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char* retVal, hipTextureObject_t textureObject,
2103  float x, int layer, float level) {
2104  TEXTURE_PARAMETERS_INIT;
2105  texel.f =
2106  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2107  TEXTURE_SET_SIGNED;
2108 }
2109 
2110 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char1* retVal, hipTextureObject_t textureObject,
2111  float x, int layer, float level) {
2112  TEXTURE_PARAMETERS_INIT;
2113  texel.f =
2114  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2115  TEXTURE_SET_SIGNED_X;
2116 }
2117 
2118 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char2* retVal, hipTextureObject_t textureObject,
2119  float x, int layer, float level) {
2120  TEXTURE_PARAMETERS_INIT;
2121  texel.f =
2122  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2123  TEXTURE_SET_SIGNED_XY;
2124 }
2125 
2126 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char4* retVal, hipTextureObject_t textureObject,
2127  float x, int layer, float level) {
2128  TEXTURE_PARAMETERS_INIT;
2129  texel.f =
2130  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2131  TEXTURE_SET_SIGNED_XYZW;
2132 }
2133 
2134 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned char* retVal,
2135  hipTextureObject_t textureObject, float x,
2136  int layer, float level) {
2137  TEXTURE_PARAMETERS_INIT;
2138  texel.f =
2139  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2140  TEXTURE_SET_UNSIGNED;
2141 }
2142 
2143 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject,
2144  float x, int layer, float level) {
2145  TEXTURE_PARAMETERS_INIT;
2146  texel.f =
2147  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2148  TEXTURE_SET_UNSIGNED_X;
2149 }
2150 
2151 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject,
2152  float x, int layer, float level) {
2153  TEXTURE_PARAMETERS_INIT;
2154  texel.f =
2155  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2156  TEXTURE_SET_UNSIGNED_XY;
2157 }
2158 
2159 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject,
2160  float x, int layer, float level) {
2161  TEXTURE_PARAMETERS_INIT;
2162  texel.f =
2163  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2164  TEXTURE_SET_UNSIGNED_XYZW;
2165 }
2166 
2167 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short* retVal, hipTextureObject_t textureObject,
2168  float x, int layer, float level) {
2169  TEXTURE_PARAMETERS_INIT;
2170  texel.f =
2171  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2172  TEXTURE_SET_SIGNED;
2173 }
2174 
2175 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short1* retVal, hipTextureObject_t textureObject,
2176  float x, int layer, float level) {
2177  TEXTURE_PARAMETERS_INIT;
2178  texel.f =
2179  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2180  TEXTURE_SET_SIGNED_X;
2181 }
2182 
2183 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short2* retVal, hipTextureObject_t textureObject,
2184  float x, int layer, float level) {
2185  TEXTURE_PARAMETERS_INIT;
2186  texel.f =
2187  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2188  TEXTURE_SET_SIGNED_XY;
2189 }
2190 
2191 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short4* retVal, hipTextureObject_t textureObject,
2192  float x, int layer, float level) {
2193  TEXTURE_PARAMETERS_INIT;
2194  texel.f =
2195  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2196  TEXTURE_SET_SIGNED_XYZW;
2197 }
2198 
2199 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned short* retVal,
2200  hipTextureObject_t textureObject, float x,
2201  int layer, float level) {
2202  TEXTURE_PARAMETERS_INIT;
2203  texel.f =
2204  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2205  TEXTURE_SET_UNSIGNED;
2206 }
2207 
2208 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject,
2209  float x, int layer, float level) {
2210  TEXTURE_PARAMETERS_INIT;
2211  texel.f =
2212  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2213  TEXTURE_SET_UNSIGNED_X;
2214 }
2215 
2216 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject,
2217  float x, int layer, float level) {
2218  TEXTURE_PARAMETERS_INIT;
2219  texel.f =
2220  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2221  TEXTURE_SET_UNSIGNED_XY;
2222 }
2223 
2224 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject,
2225  float x, int layer, float level) {
2226  TEXTURE_PARAMETERS_INIT;
2227  texel.f =
2228  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2229  TEXTURE_SET_UNSIGNED_XYZW;
2230 }
2231 
2232 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int* retVal, hipTextureObject_t textureObject,
2233  float x, int layer, float level) {
2234  TEXTURE_PARAMETERS_INIT;
2235  texel.f =
2236  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2237  TEXTURE_SET_SIGNED;
2238 }
2239 
2240 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int1* retVal, hipTextureObject_t textureObject,
2241  float x, int layer, float level) {
2242  TEXTURE_PARAMETERS_INIT;
2243  texel.f =
2244  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2245  TEXTURE_SET_SIGNED_X;
2246 }
2247 
2248 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int2* retVal, hipTextureObject_t textureObject,
2249  float x, int layer, float level) {
2250  TEXTURE_PARAMETERS_INIT;
2251  texel.f =
2252  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2253  TEXTURE_SET_SIGNED_XY;
2254 }
2255 
2256 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int4* retVal, hipTextureObject_t textureObject,
2257  float x, int layer, float level) {
2258  TEXTURE_PARAMETERS_INIT;
2259  texel.f =
2260  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2261  TEXTURE_SET_SIGNED_XYZW;
2262 }
2263 
2264 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned int* retVal,
2265  hipTextureObject_t textureObject, float x,
2266  int layer, float level) {
2267  TEXTURE_PARAMETERS_INIT;
2268  texel.f =
2269  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2270  TEXTURE_SET_UNSIGNED;
2271 }
2272 
2273 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint1* retVal, hipTextureObject_t textureObject,
2274  float x, int layer, float level) {
2275  TEXTURE_PARAMETERS_INIT;
2276  texel.f =
2277  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2278  TEXTURE_SET_UNSIGNED_X;
2279 }
2280 
2281 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint2* retVal, hipTextureObject_t textureObject,
2282  float x, int layer, float level) {
2283  TEXTURE_PARAMETERS_INIT;
2284  texel.f =
2285  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2286  TEXTURE_SET_UNSIGNED_XY;
2287 }
2288 
2289 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint4* retVal, hipTextureObject_t textureObject,
2290  float x, int layer, float level) {
2291  TEXTURE_PARAMETERS_INIT;
2292  texel.f =
2293  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2294  TEXTURE_SET_UNSIGNED_XYZW;
2295 }
2296 
2297 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float* retVal, hipTextureObject_t textureObject,
2298  float x, int layer, float level) {
2299  TEXTURE_PARAMETERS_INIT;
2300  texel.f =
2301  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2302  TEXTURE_SET_FLOAT;
2303 }
2304 
2305 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float1* retVal, hipTextureObject_t textureObject,
2306  float x, int layer, float level) {
2307  TEXTURE_PARAMETERS_INIT;
2308  texel.f =
2309  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2310  TEXTURE_SET_FLOAT_X;
2311 }
2312 
2313 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float2* retVal, hipTextureObject_t textureObject,
2314  float x, int layer, float level) {
2315  TEXTURE_PARAMETERS_INIT;
2316  texel.f =
2317  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2318  TEXTURE_SET_FLOAT_XY;
2319 }
2320 
2321 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float4* retVal, hipTextureObject_t textureObject,
2322  float x, int layer, float level) {
2323  TEXTURE_PARAMETERS_INIT;
2324  texel.f =
2325  __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
2326  TEXTURE_SET_FLOAT_XYZW;
2327 }
2328 
2329 template <class T>
2330 __TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, int layer,
2331  float level) {
2332  T ret;
2333  tex1DLayeredLod(&ret, textureObject, x, layer, level);
2334  return ret;
2335 }
2336 
2338 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char* retVal, hipTextureObject_t textureObject,
2339  float x, int layer, float dx, float dy) {
2340  TEXTURE_PARAMETERS_INIT;
2341  texel.f =
2342  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2343  TEXTURE_SET_SIGNED;
2344 }
2345 
2346 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char1* retVal, hipTextureObject_t textureObject,
2347  float x, int layer, float dx, float dy) {
2348  TEXTURE_PARAMETERS_INIT;
2349  texel.f =
2350  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2351  TEXTURE_SET_SIGNED_X;
2352 }
2353 
2354 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char2* retVal, hipTextureObject_t textureObject,
2355  float x, int layer, float dx, float dy) {
2356  TEXTURE_PARAMETERS_INIT;
2357  texel.f =
2358  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2359  TEXTURE_SET_SIGNED_XY;
2360 }
2361 
2362 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char4* retVal, hipTextureObject_t textureObject,
2363  float x, int layer, float dx, float dy) {
2364  TEXTURE_PARAMETERS_INIT;
2365  texel.f =
2366  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2367  TEXTURE_SET_SIGNED_XYZW;
2368 }
2369 
2370 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned char* retVal,
2371  hipTextureObject_t textureObject, float x,
2372  int layer, float dx, float dy) {
2373  TEXTURE_PARAMETERS_INIT;
2374  texel.f =
2375  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2376  TEXTURE_SET_UNSIGNED;
2377 }
2378 
2379 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar1* retVal, hipTextureObject_t textureObject,
2380  float x, int layer, float dx, float dy) {
2381  TEXTURE_PARAMETERS_INIT;
2382  texel.f =
2383  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2384  TEXTURE_SET_UNSIGNED_X;
2385 }
2386 
2387 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar2* retVal, hipTextureObject_t textureObject,
2388  float x, int layer, float dx, float dy) {
2389  TEXTURE_PARAMETERS_INIT;
2390  texel.f =
2391  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2392  TEXTURE_SET_UNSIGNED_XY;
2393 }
2394 
2395 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar4* retVal, hipTextureObject_t textureObject,
2396  float x, int layer, float dx, float dy) {
2397  TEXTURE_PARAMETERS_INIT;
2398  texel.f =
2399  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2400  TEXTURE_SET_UNSIGNED_XYZW;
2401 }
2402 
2403 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short* retVal, hipTextureObject_t textureObject,
2404  float x, int layer, float dx, float dy) {
2405  TEXTURE_PARAMETERS_INIT;
2406  texel.f =
2407  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2408  TEXTURE_SET_SIGNED;
2409 }
2410 
2411 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short1* retVal, hipTextureObject_t textureObject,
2412  float x, int layer, float dx, float dy) {
2413  TEXTURE_PARAMETERS_INIT;
2414  texel.f =
2415  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2416  TEXTURE_SET_SIGNED_X;
2417 }
2418 
2419 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short2* retVal, hipTextureObject_t textureObject,
2420  float x, int layer, float dx, float dy) {
2421  TEXTURE_PARAMETERS_INIT;
2422  texel.f =
2423  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2424  TEXTURE_SET_SIGNED_XY;
2425 }
2426 
2427 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short4* retVal, hipTextureObject_t textureObject,
2428  float x, int layer, float dx, float dy) {
2429  TEXTURE_PARAMETERS_INIT;
2430  texel.f =
2431  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2432  TEXTURE_SET_SIGNED_XYZW;
2433 }
2434 
2435 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned short* retVal,
2436  hipTextureObject_t textureObject, float x,
2437  int layer, float dx, float dy) {
2438  TEXTURE_PARAMETERS_INIT;
2439  texel.f =
2440  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2441  TEXTURE_SET_UNSIGNED;
2442 }
2443 
2444 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort1* retVal, hipTextureObject_t textureObject,
2445  float x, int layer, float dx, float dy) {
2446  TEXTURE_PARAMETERS_INIT;
2447  texel.f =
2448  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2449  TEXTURE_SET_UNSIGNED_X;
2450 }
2451 
2452 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort2* retVal, hipTextureObject_t textureObject,
2453  float x, int layer, float dx, float dy) {
2454  TEXTURE_PARAMETERS_INIT;
2455  texel.f =
2456  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2457  TEXTURE_SET_UNSIGNED_XY;
2458 }
2459 
2460 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort4* retVal, hipTextureObject_t textureObject,
2461  float x, int layer, float dx, float dy) {
2462  TEXTURE_PARAMETERS_INIT;
2463  texel.f =
2464  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2465  TEXTURE_SET_UNSIGNED_XYZW;
2466 }
2467 
2468 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int* retVal, hipTextureObject_t textureObject,
2469  float x, int layer, float dx, float dy) {
2470  TEXTURE_PARAMETERS_INIT;
2471  texel.f =
2472  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2473  TEXTURE_SET_SIGNED;
2474 }
2475 
2476 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int1* retVal, hipTextureObject_t textureObject,
2477  float x, int layer, float dx, float dy) {
2478  TEXTURE_PARAMETERS_INIT;
2479  texel.f =
2480  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2481  TEXTURE_SET_SIGNED_X;
2482 }
2483 
2484 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int2* retVal, hipTextureObject_t textureObject,
2485  float x, int layer, float dx, float dy) {
2486  TEXTURE_PARAMETERS_INIT;
2487  texel.f =
2488  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2489  TEXTURE_SET_SIGNED_XY;
2490 }
2491 
2492 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int4* retVal, hipTextureObject_t textureObject,
2493  float x, int layer, float dx, float dy) {
2494  TEXTURE_PARAMETERS_INIT;
2495  texel.f =
2496  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2497  TEXTURE_SET_SIGNED_XYZW;
2498 }
2499 
2500 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned int* retVal,
2501  hipTextureObject_t textureObject, float x,
2502  int layer, float dx, float dy) {
2503  TEXTURE_PARAMETERS_INIT;
2504  texel.f =
2505  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2506  TEXTURE_SET_UNSIGNED;
2507 }
2508 
2509 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint1* retVal, hipTextureObject_t textureObject,
2510  float x, int layer, float dx, float dy) {
2511  TEXTURE_PARAMETERS_INIT;
2512  texel.f =
2513  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2514  TEXTURE_SET_UNSIGNED_X;
2515 }
2516 
2517 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint2* retVal, hipTextureObject_t textureObject,
2518  float x, int layer, float dx, float dy) {
2519  TEXTURE_PARAMETERS_INIT;
2520  texel.f =
2521  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2522  TEXTURE_SET_UNSIGNED_XY;
2523 }
2524 
2525 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint4* retVal, hipTextureObject_t textureObject,
2526  float x, int layer, float dx, float dy) {
2527  TEXTURE_PARAMETERS_INIT;
2528  texel.f =
2529  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2530  TEXTURE_SET_UNSIGNED_XYZW;
2531 }
2532 
2533 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float* retVal, hipTextureObject_t textureObject,
2534  float x, int layer, float dx, float dy) {
2535  TEXTURE_PARAMETERS_INIT;
2536  texel.f =
2537  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2538  TEXTURE_SET_FLOAT;
2539 }
2540 
2541 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float1* retVal, hipTextureObject_t textureObject,
2542  float x, int layer, float dx, float dy) {
2543  TEXTURE_PARAMETERS_INIT;
2544  texel.f =
2545  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2546  TEXTURE_SET_FLOAT_X;
2547 }
2548 
2549 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float2* retVal, hipTextureObject_t textureObject,
2550  float x, int layer, float dx, float dy) {
2551  TEXTURE_PARAMETERS_INIT;
2552  texel.f =
2553  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2554  TEXTURE_SET_FLOAT_XY;
2555 }
2556 
2557 __TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float4* retVal, hipTextureObject_t textureObject,
2558  float x, int layer, float dx, float dy) {
2559  TEXTURE_PARAMETERS_INIT;
2560  texel.f =
2561  __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dx, dy);
2562  TEXTURE_SET_FLOAT_XYZW;
2563 }
2564 
2565 template <class T>
2566 __TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, int layer,
2567  float dx, float dy) {
2568  T ret;
2569  tex1DLayeredGrad(&ret, textureObject, x, layer, dx, dy);
2570  return ret;
2571 }
2572 
2574 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char* retVal, hipTextureObject_t textureObject,
2575  float x, float y, int layer) {
2576  TEXTURE_PARAMETERS_INIT;
2577  texel.f =
2578  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2579  TEXTURE_SET_SIGNED;
2580 }
2581 
2582 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char1* retVal, hipTextureObject_t textureObject,
2583  float x, float y, int layer) {
2584  TEXTURE_PARAMETERS_INIT;
2585  texel.f =
2586  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2587  TEXTURE_SET_SIGNED_X;
2588 }
2589 
2590 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char2* retVal, hipTextureObject_t textureObject,
2591  float x, float y, int layer) {
2592  TEXTURE_PARAMETERS_INIT;
2593  texel.f =
2594  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2595  TEXTURE_SET_SIGNED_XY;
2596 }
2597 
2598 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char4* retVal, hipTextureObject_t textureObject,
2599  float x, float y, int layer) {
2600  TEXTURE_PARAMETERS_INIT;
2601  texel.f =
2602  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2603  TEXTURE_SET_SIGNED_XYZW;
2604 }
2605 
2606 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned char* retVal,
2607  hipTextureObject_t textureObject, float x, float y,
2608  int layer) {
2609  TEXTURE_PARAMETERS_INIT;
2610  texel.f =
2611  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2612  TEXTURE_SET_UNSIGNED;
2613 }
2614 
2615 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar1* retVal, hipTextureObject_t textureObject,
2616  float x, float y, int layer) {
2617  TEXTURE_PARAMETERS_INIT;
2618  texel.f =
2619  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2620  TEXTURE_SET_UNSIGNED_X;
2621 }
2622 
2623 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar2* retVal, hipTextureObject_t textureObject,
2624  float x, float y, int layer) {
2625  TEXTURE_PARAMETERS_INIT;
2626  texel.f =
2627  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2628  TEXTURE_SET_UNSIGNED_XY;
2629 }
2630 
2631 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar4* retVal, hipTextureObject_t textureObject,
2632  float x, float y, int layer) {
2633  TEXTURE_PARAMETERS_INIT;
2634  texel.f =
2635  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2636  TEXTURE_SET_UNSIGNED_XYZW;
2637 }
2638 
2639 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short* retVal, hipTextureObject_t textureObject,
2640  float x, float y, int layer) {
2641  TEXTURE_PARAMETERS_INIT;
2642  texel.f =
2643  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2644  TEXTURE_SET_SIGNED;
2645 }
2646 
2647 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short1* retVal, hipTextureObject_t textureObject,
2648  float x, float y, int layer) {
2649  TEXTURE_PARAMETERS_INIT;
2650  texel.f =
2651  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2652  TEXTURE_SET_SIGNED_X;
2653 }
2654 
2655 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short2* retVal, hipTextureObject_t textureObject,
2656  float x, float y, int layer) {
2657  TEXTURE_PARAMETERS_INIT;
2658  texel.f =
2659  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2660  TEXTURE_SET_SIGNED_XY;
2661 }
2662 
2663 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short4* retVal, hipTextureObject_t textureObject,
2664  float x, float y, int layer) {
2665  TEXTURE_PARAMETERS_INIT;
2666  texel.f =
2667  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2668  TEXTURE_SET_SIGNED_XYZW;
2669 }
2670 
2671 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned short* retVal,
2672  hipTextureObject_t textureObject, float x, float y,
2673  int layer) {
2674  TEXTURE_PARAMETERS_INIT;
2675  texel.f =
2676  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2677  TEXTURE_SET_UNSIGNED;
2678 }
2679 
2680 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort1* retVal, hipTextureObject_t textureObject,
2681  float x, float y, int layer) {
2682  TEXTURE_PARAMETERS_INIT;
2683  texel.f =
2684  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2685  TEXTURE_SET_UNSIGNED_X;
2686 }
2687 
2688 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort2* retVal, hipTextureObject_t textureObject,
2689  float x, float y, int layer) {
2690  TEXTURE_PARAMETERS_INIT;
2691  texel.f =
2692  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2693  TEXTURE_SET_UNSIGNED_XY;
2694 }
2695 
2696 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort4* retVal, hipTextureObject_t textureObject,
2697  float x, float y, int layer) {
2698  TEXTURE_PARAMETERS_INIT;
2699  texel.f =
2700  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2701  TEXTURE_SET_UNSIGNED_XYZW;
2702 }
2703 
2704 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int* retVal, hipTextureObject_t textureObject, float x,
2705  float y, int layer) {
2706  TEXTURE_PARAMETERS_INIT;
2707  texel.f =
2708  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2709  TEXTURE_SET_SIGNED;
2710 }
2711 
2712 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int1* retVal, hipTextureObject_t textureObject,
2713  float x, float y, int layer) {
2714  TEXTURE_PARAMETERS_INIT;
2715  texel.f =
2716  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2717  TEXTURE_SET_SIGNED_X;
2718 }
2719 
2720 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int2* retVal, hipTextureObject_t textureObject,
2721  float x, float y, int layer) {
2722  TEXTURE_PARAMETERS_INIT;
2723  texel.f =
2724  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2725  TEXTURE_SET_SIGNED_XY;
2726 }
2727 
2728 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int4* retVal, hipTextureObject_t textureObject,
2729  float x, float y, int layer) {
2730  TEXTURE_PARAMETERS_INIT;
2731  texel.f =
2732  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2733  TEXTURE_SET_SIGNED_XYZW;
2734 }
2735 
2736 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned int* retVal, hipTextureObject_t textureObject,
2737  float x, float y, int layer) {
2738  TEXTURE_PARAMETERS_INIT;
2739  texel.f =
2740  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2741  TEXTURE_SET_UNSIGNED;
2742 }
2743 
2744 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint1* retVal, hipTextureObject_t textureObject,
2745  float x, float y, int layer) {
2746  TEXTURE_PARAMETERS_INIT;
2747  texel.f =
2748  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2749  TEXTURE_SET_UNSIGNED_X;
2750 }
2751 
2752 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint2* retVal, hipTextureObject_t textureObject,
2753  float x, float y, int layer) {
2754  TEXTURE_PARAMETERS_INIT;
2755  texel.f =
2756  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2757  TEXTURE_SET_UNSIGNED_XY;
2758 }
2759 
2760 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint4* retVal, hipTextureObject_t textureObject,
2761  float x, float y, int layer) {
2762  TEXTURE_PARAMETERS_INIT;
2763  texel.f =
2764  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2765  TEXTURE_SET_UNSIGNED_XYZW;
2766 }
2767 
2768 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float* retVal, hipTextureObject_t textureObject,
2769  float x, float y, int layer) {
2770  TEXTURE_PARAMETERS_INIT;
2771  texel.f =
2772  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2773  TEXTURE_SET_FLOAT;
2774 }
2775 
2776 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float1* retVal, hipTextureObject_t textureObject,
2777  float x, float y, int layer) {
2778  TEXTURE_PARAMETERS_INIT;
2779  texel.f =
2780  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2781  TEXTURE_SET_FLOAT_X;
2782 }
2783 
2784 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float2* retVal, hipTextureObject_t textureObject,
2785  float x, float y, int layer) {
2786  TEXTURE_PARAMETERS_INIT;
2787  texel.f =
2788  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2789  TEXTURE_SET_FLOAT_XY;
2790 }
2791 
2792 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float4* retVal, hipTextureObject_t textureObject,
2793  float x, float y, int layer) {
2794  TEXTURE_PARAMETERS_INIT;
2795  texel.f =
2796  __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
2797  TEXTURE_SET_FLOAT_XYZW;
2798 }
2799 
2800 template <class T>
2801 __TEXTURE_FUNCTIONS_DECL__ T tex2DLayered(hipTextureObject_t textureObject, float x, float y,
2802  int layer) {
2803  T ret;
2804  tex2DLayered(&ret, textureObject, x, y, layer);
2805  return ret;
2806 }
2807 
2809 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char* retVal, hipTextureObject_t textureObject,
2810  float x, float y, int layer, float level) {
2811  TEXTURE_PARAMETERS_INIT;
2812  texel.f = __ockl_image_sample_lod_2Da(
2813  i, s, float4(x, y, layer, 0.0f).data, level);
2814  TEXTURE_SET_SIGNED;
2815 }
2816 
2817 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char1* retVal, hipTextureObject_t textureObject,
2818  float x, float y, int layer, float level) {
2819  TEXTURE_PARAMETERS_INIT;
2820  texel.f = __ockl_image_sample_lod_2Da(
2821  i, s, float4(x, y, layer, 0.0f).data, level);
2822  TEXTURE_SET_SIGNED_X;
2823 }
2824 
2825 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char2* retVal, hipTextureObject_t textureObject,
2826  float x, float y, int layer, float level) {
2827  TEXTURE_PARAMETERS_INIT;
2828  texel.f = __ockl_image_sample_lod_2Da(
2829  i, s, float4(x, y, layer, 0.0f).data, level);
2830  TEXTURE_SET_SIGNED_XY;
2831 }
2832 
2833 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char4* retVal, hipTextureObject_t textureObject,
2834  float x, float y, int layer, float level) {
2835  TEXTURE_PARAMETERS_INIT;
2836  texel.f = __ockl_image_sample_lod_2Da(
2837  i, s, float4(x, y, layer, 0.0f).data, level);
2838  TEXTURE_SET_SIGNED_XYZW;
2839 }
2840 
2841 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned char* retVal,
2842  hipTextureObject_t textureObject, float x, float y,
2843  int layer, float level) {
2844  TEXTURE_PARAMETERS_INIT;
2845  texel.f = __ockl_image_sample_lod_2Da(
2846  i, s, float4(x, y, layer, 0.0f).data, level);
2847  TEXTURE_SET_UNSIGNED;
2848 }
2849 
2850 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject,
2851  float x, float y, int layer, float level) {
2852  TEXTURE_PARAMETERS_INIT;
2853  texel.f = __ockl_image_sample_lod_2Da(
2854  i, s, float4(x, y, layer, 0.0f).data, level);
2855  TEXTURE_SET_UNSIGNED_X;
2856 }
2857 
2858 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject,
2859  float x, float y, int layer, float level) {
2860  TEXTURE_PARAMETERS_INIT;
2861  texel.f = __ockl_image_sample_lod_2Da(
2862  i, s, float4(x, y, layer, 0.0f).data, level);
2863  TEXTURE_SET_UNSIGNED_XY;
2864 }
2865 
2866 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject,
2867  float x, float y, int layer, float level) {
2868  TEXTURE_PARAMETERS_INIT;
2869  texel.f = __ockl_image_sample_lod_2Da(
2870  i, s, float4(x, y, layer, 0.0f).data, level);
2871  TEXTURE_SET_UNSIGNED_XYZW;
2872 }
2873 
2874 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short* retVal, hipTextureObject_t textureObject,
2875  float x, float y, int layer, float level) {
2876  TEXTURE_PARAMETERS_INIT;
2877  texel.f = __ockl_image_sample_lod_2Da(
2878  i, s, float4(x, y, layer, 0.0f).data, level);
2879  TEXTURE_SET_SIGNED;
2880 }
2881 
2882 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short1* retVal, hipTextureObject_t textureObject,
2883  float x, float y, int layer, float level) {
2884  TEXTURE_PARAMETERS_INIT;
2885  texel.f = __ockl_image_sample_lod_2Da(
2886  i, s, float4(x, y, layer, 0.0f).data, level);
2887  TEXTURE_SET_SIGNED_X;
2888 }
2889 
2890 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short2* retVal, hipTextureObject_t textureObject,
2891  float x, float y, int layer, float level) {
2892  TEXTURE_PARAMETERS_INIT;
2893  texel.f = __ockl_image_sample_lod_2Da(
2894  i, s, float4(x, y, layer, 0.0f).data, level);
2895  TEXTURE_SET_SIGNED_XY;
2896 }
2897 
2898 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short4* retVal, hipTextureObject_t textureObject,
2899  float x, float y, int layer, float level) {
2900  TEXTURE_PARAMETERS_INIT;
2901  texel.f = __ockl_image_sample_lod_2Da(
2902  i, s, float4(x, y, layer, 0.0f).data, level);
2903  TEXTURE_SET_SIGNED_XYZW;
2904 }
2905 
2906 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned short* retVal,
2907  hipTextureObject_t textureObject, float x, float y,
2908  int layer, float level) {
2909  TEXTURE_PARAMETERS_INIT;
2910  texel.f = __ockl_image_sample_lod_2Da(
2911  i, s, float4(x, y, layer, 0.0f).data, level);
2912  TEXTURE_SET_UNSIGNED;
2913 }
2914 
2915 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject,
2916  float x, float y, int layer, float level) {
2917  TEXTURE_PARAMETERS_INIT;
2918  texel.f = __ockl_image_sample_lod_2Da(
2919  i, s, float4(x, y, layer, 0.0f).data, level);
2920  TEXTURE_SET_UNSIGNED_X;
2921 }
2922 
2923 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject,
2924  float x, float y, int layer, float level) {
2925  TEXTURE_PARAMETERS_INIT;
2926  texel.f = __ockl_image_sample_lod_2Da(
2927  i, s, float4(x, y, layer, 0.0f).data, level);
2928  TEXTURE_SET_UNSIGNED_XY;
2929 }
2930 
2931 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject,
2932  float x, float y, int layer, float level) {
2933  TEXTURE_PARAMETERS_INIT;
2934  texel.f = __ockl_image_sample_lod_2Da(
2935  i, s, float4(x, y, layer, 0.0f).data, level);
2936  TEXTURE_SET_UNSIGNED_XYZW;
2937 }
2938 
2939 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int* retVal, hipTextureObject_t textureObject,
2940  float x, float y, int layer, float level) {
2941  TEXTURE_PARAMETERS_INIT;
2942  texel.f = __ockl_image_sample_lod_2Da(
2943  i, s, float4(x, y, layer, 0.0f).data, level);
2944  TEXTURE_SET_SIGNED;
2945 }
2946 
2947 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int1* retVal, hipTextureObject_t textureObject,
2948  float x, float y, int layer, float level) {
2949  TEXTURE_PARAMETERS_INIT;
2950  texel.f = __ockl_image_sample_lod_2Da(
2951  i, s, float4(x, y, layer, 0.0f).data, level);
2952  TEXTURE_SET_SIGNED_X;
2953 }
2954 
2955 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int2* retVal, hipTextureObject_t textureObject,
2956  float x, float y, int layer, float level) {
2957  TEXTURE_PARAMETERS_INIT;
2958  texel.f = __ockl_image_sample_lod_2Da(
2959  i, s, float4(x, y, layer, 0.0f).data, level);
2960  TEXTURE_SET_SIGNED_XY;
2961 }
2962 
2963 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int4* retVal, hipTextureObject_t textureObject,
2964  float x, float y, int layer, float level) {
2965  TEXTURE_PARAMETERS_INIT;
2966  texel.f = __ockl_image_sample_lod_2Da(
2967  i, s, float4(x, y, layer, 0.0f).data, level);
2968  TEXTURE_SET_SIGNED_XYZW;
2969 }
2970 
2971 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned int* retVal,
2972  hipTextureObject_t textureObject, float x, float y,
2973  int layer, float level) {
2974  TEXTURE_PARAMETERS_INIT;
2975  texel.f = __ockl_image_sample_lod_2Da(
2976  i, s, float4(x, y, layer, 0.0f).data, level);
2977  TEXTURE_SET_UNSIGNED;
2978 }
2979 
2980 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint1* retVal, hipTextureObject_t textureObject,
2981  float x, float y, int layer, float level) {
2982  TEXTURE_PARAMETERS_INIT;
2983  texel.f = __ockl_image_sample_lod_2Da(
2984  i, s, float4(x, y, layer, 0.0f).data, level);
2985  TEXTURE_SET_UNSIGNED_X;
2986 }
2987 
2988 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint2* retVal, hipTextureObject_t textureObject,
2989  float x, float y, int layer, float level) {
2990  TEXTURE_PARAMETERS_INIT;
2991  texel.f = __ockl_image_sample_lod_2Da(
2992  i, s, float4(x, y, layer, 0.0f).data, level);
2993  TEXTURE_SET_UNSIGNED_XY;
2994 }
2995 
2996 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint4* retVal, hipTextureObject_t textureObject,
2997  float x, float y, int layer, float level) {
2998  TEXTURE_PARAMETERS_INIT;
2999  texel.f = __ockl_image_sample_lod_2Da(
3000  i, s, float4(x, y, layer, 0.0f).data, level);
3001  TEXTURE_SET_UNSIGNED_XYZW;
3002 }
3003 
3004 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float* retVal, hipTextureObject_t textureObject,
3005  float x, float y, int layer, float level) {
3006  TEXTURE_PARAMETERS_INIT;
3007  texel.f = __ockl_image_sample_lod_2Da(
3008  i, s, float4(x, y, layer, 0.0f).data, level);
3009  TEXTURE_SET_FLOAT;
3010 }
3011 
3012 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float1* retVal, hipTextureObject_t textureObject,
3013  float x, float y, int layer, float level) {
3014  TEXTURE_PARAMETERS_INIT;
3015  texel.f = __ockl_image_sample_lod_2Da(
3016  i, s, float4(x, y, layer, 0.0f).data, level);
3017  TEXTURE_SET_FLOAT_X;
3018 }
3019 
3020 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float2* retVal, hipTextureObject_t textureObject,
3021  float x, float y, int layer, float level) {
3022  TEXTURE_PARAMETERS_INIT;
3023  texel.f = __ockl_image_sample_lod_2Da(
3024  i, s, float4(x, y, layer, 0.0f).data, level);
3025  TEXTURE_SET_FLOAT_XY;
3026 }
3027 
3028 __TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float4* retVal, hipTextureObject_t textureObject,
3029  float x, float y, int layer, float level) {
3030  TEXTURE_PARAMETERS_INIT;
3031  texel.f = __ockl_image_sample_lod_2Da(
3032  i, s, float4(x, y, layer, 0.0f).data, level);
3033  TEXTURE_SET_FLOAT_XYZW;
3034 }
3035 
3036 template <class T>
3037 __TEXTURE_FUNCTIONS_DECL__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, float y,
3038  int layer, float level) {
3039  T ret;
3040  tex2DLayeredLod(&ret, textureObject, x, y, layer, level);
3041  return ret;
3042 }
3043 
3045 // Texture Reference APIs
3047 template <int texType, enum hipTextureReadMode mode>
3048 __TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture<char, texType, mode> texRef, int x) {
3049  TEXTURE_REF_PARAMETERS_INIT;
3050  texel.f = __ockl_image_sample_1D(i, s, x);
3051  TEXTURE_RETURN_CHAR;
3052 }
3053 
3054 template <int texType, enum hipTextureReadMode mode>
3055 __TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture<char1, texType, mode> texRef, int x) {
3056  TEXTURE_REF_PARAMETERS_INIT;
3057  texel.f = __ockl_image_sample_1D(i, s, x);
3058  TEXTURE_RETURN_CHAR_X;
3059 }
3060 
3061 template <int texType, enum hipTextureReadMode mode>
3062 __TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture<char2, texType, mode> texRef, int x) {
3063  TEXTURE_REF_PARAMETERS_INIT;
3064  texel.f = __ockl_image_sample_1D(i, s, x);
3065  TEXTURE_RETURN_CHAR_XY;
3066 }
3067 
3068 template <int texType, enum hipTextureReadMode mode>
3069 __TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture<char4, texType, mode> texRef, int x) {
3070  TEXTURE_REF_PARAMETERS_INIT;
3071  texel.f = __ockl_image_sample_1D(i, s, x);
3072  TEXTURE_RETURN_CHAR_XYZW;
3073 }
3074 
3075 template <int texType, enum hipTextureReadMode mode>
3076 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture<unsigned char, texType, mode> texRef,
3077  int x) {
3078  TEXTURE_REF_PARAMETERS_INIT;
3079  texel.f = __ockl_image_sample_1D(i, s, x);
3080  TEXTURE_RETURN_UCHAR;
3081 }
3082 
3083 template <int texType, enum hipTextureReadMode mode>
3084 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture<uchar1, texType, mode> texRef, int x) {
3085  TEXTURE_REF_PARAMETERS_INIT;
3086  texel.f = __ockl_image_sample_1D(i, s, x);
3087  TEXTURE_RETURN_UCHAR_X;
3088 }
3089 
3090 template <int texType, enum hipTextureReadMode mode>
3091 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture<uchar2, texType, mode> texRef, int x) {
3092  TEXTURE_REF_PARAMETERS_INIT;
3093  texel.f = __ockl_image_sample_1D(i, s, x);
3094  TEXTURE_RETURN_UCHAR_XY;
3095 }
3096 
3097 template <int texType, enum hipTextureReadMode mode>
3098 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture<uchar4, texType, mode> texRef, int x) {
3099  TEXTURE_REF_PARAMETERS_INIT;
3100  texel.f = __ockl_image_sample_1D(i, s, x);
3101  TEXTURE_RETURN_UCHAR_XYZW;
3102 }
3103 
3104 template <int texType, enum hipTextureReadMode mode>
3105 __TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture<short, texType, mode> texRef, int x) {
3106  TEXTURE_REF_PARAMETERS_INIT;
3107  texel.f = __ockl_image_sample_1D(i, s, x);
3108  TEXTURE_RETURN_SHORT;
3109 }
3110 
3111 template <int texType, enum hipTextureReadMode mode>
3112 __TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture<short1, texType, mode> texRef, int x) {
3113  TEXTURE_REF_PARAMETERS_INIT;
3114  texel.f = __ockl_image_sample_1D(i, s, x);
3115  TEXTURE_RETURN_SHORT_X;
3116 }
3117 
3118 template <int texType, enum hipTextureReadMode mode>
3119 __TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture<short2, texType, mode> texRef, int x) {
3120  TEXTURE_REF_PARAMETERS_INIT;
3121  texel.f = __ockl_image_sample_1D(i, s, x);
3122  TEXTURE_RETURN_SHORT_XY;
3123 }
3124 
3125 template <int texType, enum hipTextureReadMode mode>
3126 __TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture<short4, texType, mode> texRef, int x) {
3127  TEXTURE_REF_PARAMETERS_INIT;
3128  texel.f = __ockl_image_sample_1D(i, s, x);
3129  TEXTURE_RETURN_SHORT_XYZW;
3130 }
3131 
3132 template <int texType, enum hipTextureReadMode mode>
3133 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture<ushort1, texType, mode> texRef, int x) {
3134  TEXTURE_REF_PARAMETERS_INIT;
3135  texel.f = __ockl_image_sample_1D(i, s, x);
3136  TEXTURE_RETURN_USHORT_X;
3137 }
3138 
3139 template <int texType, enum hipTextureReadMode mode>
3140 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture<unsigned short, texType, mode> texRef,
3141  int x) {
3142  TEXTURE_REF_PARAMETERS_INIT;
3143  texel.f = __ockl_image_sample_1D(i, s, x);
3144  TEXTURE_RETURN_USHORT;
3145 }
3146 
3147 template <int texType, enum hipTextureReadMode mode>
3148 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture<ushort2, texType, mode> texRef, int x) {
3149  TEXTURE_REF_PARAMETERS_INIT;
3150  texel.f = __ockl_image_sample_1D(i, s, x);
3151  TEXTURE_RETURN_USHORT_XY;
3152 }
3153 
3154 template <int texType, enum hipTextureReadMode mode>
3155 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture<ushort4, texType, mode> texRef, int x) {
3156  TEXTURE_REF_PARAMETERS_INIT;
3157  texel.f = __ockl_image_sample_1D(i, s, x);
3158  TEXTURE_RETURN_USHORT_XYZW;
3159 }
3160 
3161 template <int texType, enum hipTextureReadMode mode>
3162 __TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture<int1, texType, mode> texRef, int x) {
3163  TEXTURE_REF_PARAMETERS_INIT;
3164  texel.f = __ockl_image_sample_1D(i, s, x);
3165  TEXTURE_RETURN_INT_X;
3166 }
3167 
3168 template <int texType, enum hipTextureReadMode mode>
3169 __TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture<int, texType, mode> texRef, int x) {
3170  TEXTURE_REF_PARAMETERS_INIT;
3171  texel.f = __ockl_image_sample_1D(i, s, x);
3172  TEXTURE_RETURN_INT;
3173 }
3174 
3175 template <int texType, enum hipTextureReadMode mode>
3176 __TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture<int2, texType, mode> texRef, int x) {
3177  TEXTURE_REF_PARAMETERS_INIT;
3178  texel.f = __ockl_image_sample_1D(i, s, x);
3179  TEXTURE_RETURN_INT_XY;
3180 }
3181 
3182 template <int texType, enum hipTextureReadMode mode>
3183 __TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture<int4, texType, mode> texRef, int x) {
3184  TEXTURE_REF_PARAMETERS_INIT;
3185  texel.f = __ockl_image_sample_1D(i, s, x);
3186  TEXTURE_RETURN_INT_XYZW;
3187 }
3188 
3189 template <int texType, enum hipTextureReadMode mode>
3190 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture<unsigned int, texType, mode> texRef,
3191  int x) {
3192  TEXTURE_REF_PARAMETERS_INIT;
3193  texel.f = __ockl_image_sample_1D(i, s, x);
3194  TEXTURE_RETURN_UINT;
3195 }
3196 
3197 template <int texType, enum hipTextureReadMode mode>
3198 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture<uint1, texType, mode> texRef, int x) {
3199  TEXTURE_REF_PARAMETERS_INIT;
3200  texel.f = __ockl_image_sample_1D(i, s, x);
3201  TEXTURE_RETURN_UINT_X;
3202 }
3203 
3204 template <int texType, enum hipTextureReadMode mode>
3205 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture<uint2, texType, mode> texRef, int x) {
3206  TEXTURE_REF_PARAMETERS_INIT;
3207  texel.f = __ockl_image_sample_1D(i, s, x);
3208  TEXTURE_RETURN_UINT_XY;
3209 }
3210 
3211 template <int texType, enum hipTextureReadMode mode>
3212 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture<uint4, texType, mode> texRef, int x) {
3213  TEXTURE_REF_PARAMETERS_INIT;
3214  texel.f = __ockl_image_sample_1D(i, s, x);
3215  TEXTURE_RETURN_UINT_XYZW;
3216 }
3217 
3218 template <int texType, enum hipTextureReadMode mode>
3219 __TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture<float, texType, mode> texRef, int x) {
3220  TEXTURE_REF_PARAMETERS_INIT;
3221  texel.f = __ockl_image_sample_1D(i, s, x);
3222  TEXTURE_RETURN_FLOAT;
3223 }
3224 
3225 template <int texType, enum hipTextureReadMode mode>
3226 __TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture<float1, texType, mode> texRef, int x) {
3227  TEXTURE_REF_PARAMETERS_INIT;
3228  texel.f = __ockl_image_sample_1D(i, s, x);
3229  TEXTURE_RETURN_FLOAT_X;
3230 }
3231 
3232 template <int texType, enum hipTextureReadMode mode>
3233 __TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture<float2, texType, mode> texRef, int x) {
3234  TEXTURE_REF_PARAMETERS_INIT;
3235  texel.f = __ockl_image_sample_1D(i, s, x);
3236  TEXTURE_RETURN_FLOAT_XY;
3237 }
3238 
3239 template <int texType, enum hipTextureReadMode mode>
3240 __TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture<float4, texType, mode> texRef, int x) {
3241  TEXTURE_REF_PARAMETERS_INIT;
3242  texel.f = __ockl_image_sample_1D(i, s, x);
3243  TEXTURE_RETURN_FLOAT_XYZW;
3244 }
3245 
3247 
3248 template <int texType, enum hipTextureReadMode mode>
3249 __TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture<char, texType, mode> texRef,
3250  hipTextureObject_t textureObject, int x) {
3251  TEXTURE_PARAMETERS_INIT;
3252  texel.f = __ockl_image_sample_1D(i, s, x);
3253  TEXTURE_RETURN_CHAR;
3254 }
3255 
3256 template <int texType, enum hipTextureReadMode mode>
3257 __TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture<char1, texType, mode> texRef,
3258  hipTextureObject_t textureObject, int x) {
3259  TEXTURE_PARAMETERS_INIT;
3260  texel.f = __ockl_image_sample_1D(i, s, x);
3261  TEXTURE_RETURN_CHAR_X;
3262 }
3263 
3264 template <int texType, enum hipTextureReadMode mode>
3265 __TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture<char2, texType, mode> texRef,
3266  hipTextureObject_t textureObject, int x) {
3267  TEXTURE_PARAMETERS_INIT;
3268  texel.f = __ockl_image_sample_1D(i, s, x);
3269  TEXTURE_RETURN_CHAR_XY;
3270 }
3271 
3272 template <int texType, enum hipTextureReadMode mode>
3273 __TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture<char4, texType, mode> texRef,
3274  hipTextureObject_t textureObject, int x) {
3275  TEXTURE_PARAMETERS_INIT;
3276  texel.f = __ockl_image_sample_1D(i, s, x);
3277  TEXTURE_RETURN_CHAR_XYZW;
3278 }
3279 
3280 template <int texType, enum hipTextureReadMode mode>
3281 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture<unsigned char, texType, mode> texRef,
3282  hipTextureObject_t textureObject, int x) {
3283  TEXTURE_PARAMETERS_INIT;
3284  texel.f = __ockl_image_sample_1D(i, s, x);
3285  TEXTURE_RETURN_UCHAR;
3286 }
3287 
3288 template <int texType, enum hipTextureReadMode mode>
3289 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture<uchar1, texType, mode> texRef,
3290  hipTextureObject_t textureObject, int x) {
3291  TEXTURE_PARAMETERS_INIT;
3292  texel.f = __ockl_image_sample_1D(i, s, x);
3293  TEXTURE_RETURN_UCHAR_X;
3294 }
3295 
3296 template <int texType, enum hipTextureReadMode mode>
3297 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture<uchar2, texType, mode> texRef,
3298  hipTextureObject_t textureObject, int x) {
3299  TEXTURE_PARAMETERS_INIT;
3300  texel.f = __ockl_image_sample_1D(i, s, x);
3301  TEXTURE_RETURN_UCHAR_XY;
3302 }
3303 
3304 template <int texType, enum hipTextureReadMode mode>
3305 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture<uchar4, texType, mode> texRef,
3306  hipTextureObject_t textureObject, int x) {
3307  TEXTURE_PARAMETERS_INIT;
3308  texel.f = __ockl_image_sample_1D(i, s, x);
3309  TEXTURE_RETURN_UCHAR_XYZW;
3310 }
3311 
3312 template <int texType, enum hipTextureReadMode mode>
3313 __TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture<short, texType, mode> texRef,
3314  hipTextureObject_t textureObject, int x) {
3315  TEXTURE_PARAMETERS_INIT;
3316  texel.f = __ockl_image_sample_1D(i, s, x);
3317  TEXTURE_RETURN_SHORT;
3318 }
3319 
3320 template <int texType, enum hipTextureReadMode mode>
3321 __TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture<short1, texType, mode> texRef,
3322  hipTextureObject_t textureObject, int x) {
3323  TEXTURE_PARAMETERS_INIT;
3324  texel.f = __ockl_image_sample_1D(i, s, x);
3325  TEXTURE_RETURN_SHORT_X;
3326 }
3327 
3328 template <int texType, enum hipTextureReadMode mode>
3329 __TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture<short2, texType, mode> texRef,
3330  hipTextureObject_t textureObject, int x) {
3331  TEXTURE_PARAMETERS_INIT;
3332  texel.f = __ockl_image_sample_1D(i, s, x);
3333  TEXTURE_RETURN_SHORT_XY;
3334 }
3335 
3336 template <int texType, enum hipTextureReadMode mode>
3337 __TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture<short4, texType, mode> texRef,
3338  hipTextureObject_t textureObject, int x) {
3339  TEXTURE_PARAMETERS_INIT;
3340  texel.f = __ockl_image_sample_1D(i, s, x);
3341  TEXTURE_RETURN_SHORT_XYZW;
3342 }
3343 
3344 template <int texType, enum hipTextureReadMode mode>
3345 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture<ushort1, texType, mode> texRef,
3346  hipTextureObject_t textureObject, int x) {
3347  TEXTURE_PARAMETERS_INIT;
3348  texel.f = __ockl_image_sample_1D(i, s, x);
3349  TEXTURE_RETURN_USHORT_X;
3350 }
3351 
3352 template <int texType, enum hipTextureReadMode mode>
3353 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture<unsigned short, texType, mode> texRef,
3354  hipTextureObject_t textureObject, int x) {
3355  TEXTURE_PARAMETERS_INIT;
3356  texel.f = __ockl_image_sample_1D(i, s, x);
3357  TEXTURE_RETURN_USHORT;
3358 }
3359 
3360 template <int texType, enum hipTextureReadMode mode>
3361 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture<ushort2, texType, mode> texRef,
3362  hipTextureObject_t textureObject, int x) {
3363  TEXTURE_PARAMETERS_INIT;
3364  texel.f = __ockl_image_sample_1D(i, s, x);
3365  TEXTURE_RETURN_USHORT_XY;
3366 }
3367 
3368 template <int texType, enum hipTextureReadMode mode>
3369 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture<ushort4, texType, mode> texRef,
3370  hipTextureObject_t textureObject, int x) {
3371  TEXTURE_PARAMETERS_INIT;
3372  texel.f = __ockl_image_sample_1D(i, s, x);
3373  TEXTURE_RETURN_USHORT_XYZW;
3374 }
3375 
3376 template <int texType, enum hipTextureReadMode mode>
3377 __TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture<int1, texType, mode> texRef,
3378  hipTextureObject_t textureObject, int x) {
3379  TEXTURE_PARAMETERS_INIT;
3380  texel.f = __ockl_image_sample_1D(i, s, x);
3381  TEXTURE_RETURN_INT_X;
3382 }
3383 
3384 template <int texType, enum hipTextureReadMode mode>
3385 __TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture<int, texType, mode> texRef,
3386  hipTextureObject_t textureObject, int x) {
3387  TEXTURE_PARAMETERS_INIT;
3388  texel.f = __ockl_image_sample_1D(i, s, x);
3389  TEXTURE_RETURN_INT;
3390 }
3391 
3392 template <int texType, enum hipTextureReadMode mode>
3393 __TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture<int2, texType, mode> texRef,
3394  hipTextureObject_t textureObject, int x) {
3395  TEXTURE_PARAMETERS_INIT;
3396  texel.f = __ockl_image_sample_1D(i, s, x);
3397  TEXTURE_RETURN_INT_XY;
3398 }
3399 
3400 template <int texType, enum hipTextureReadMode mode>
3401 __TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture<int4, texType, mode> texRef,
3402  hipTextureObject_t textureObject, int x) {
3403  TEXTURE_PARAMETERS_INIT;
3404  texel.f = __ockl_image_sample_1D(i, s, x);
3405  TEXTURE_RETURN_INT_XYZW;
3406 }
3407 
3408 template <int texType, enum hipTextureReadMode mode>
3409 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture<unsigned int, texType, mode> texRef,
3410  hipTextureObject_t textureObject, int x) {
3411  TEXTURE_PARAMETERS_INIT;
3412  texel.f = __ockl_image_sample_1D(i, s, x);
3413  TEXTURE_RETURN_UINT;
3414 }
3415 
3416 template <int texType, enum hipTextureReadMode mode>
3417 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture<uint1, texType, mode> texRef,
3418  hipTextureObject_t textureObject, int x) {
3419  TEXTURE_PARAMETERS_INIT;
3420  texel.f = __ockl_image_sample_1D(i, s, x);
3421  TEXTURE_RETURN_UINT_X;
3422 }
3423 
3424 template <int texType, enum hipTextureReadMode mode>
3425 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture<uint2, texType, mode> texRef,
3426  hipTextureObject_t textureObject, int x) {
3427  TEXTURE_PARAMETERS_INIT;
3428  texel.f = __ockl_image_sample_1D(i, s, x);
3429  TEXTURE_RETURN_UINT_XY;
3430 }
3431 
3432 template <int texType, enum hipTextureReadMode mode>
3433 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture<uint4, texType, mode> texRef,
3434  hipTextureObject_t textureObject, int x) {
3435  TEXTURE_PARAMETERS_INIT;
3436  texel.f = __ockl_image_sample_1D(i, s, x);
3437  TEXTURE_RETURN_UINT_XYZW;
3438 }
3439 
3440 template <int texType, enum hipTextureReadMode mode>
3441 __TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture<float, texType, mode> texRef,
3442  hipTextureObject_t textureObject, int x) {
3443  TEXTURE_PARAMETERS_INIT;
3444  texel.f = __ockl_image_sample_1D(i, s, x);
3445  TEXTURE_RETURN_FLOAT;
3446 }
3447 
3448 template <int texType, enum hipTextureReadMode mode>
3449 __TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture<float1, texType, mode> texRef,
3450  hipTextureObject_t textureObject, int x) {
3451  TEXTURE_PARAMETERS_INIT;
3452  texel.f = __ockl_image_sample_1D(i, s, x);
3453  TEXTURE_RETURN_FLOAT_X;
3454 }
3455 
3456 template <int texType, enum hipTextureReadMode mode>
3457 __TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture<float2, texType, mode> texRef,
3458  hipTextureObject_t textureObject, int x) {
3459  TEXTURE_PARAMETERS_INIT;
3460  texel.f = __ockl_image_sample_1D(i, s, x);
3461  TEXTURE_RETURN_FLOAT_XY;
3462 }
3463 
3464 template <int texType, enum hipTextureReadMode mode>
3465 __TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture<float4, texType, mode> texRef,
3466  hipTextureObject_t textureObject, int x) {
3467  TEXTURE_PARAMETERS_INIT;
3468  texel.f = __ockl_image_sample_1D(i, s, x);
3469  TEXTURE_RETURN_FLOAT_XYZW;
3470 }
3471 
3473 template <int texType, enum hipTextureReadMode mode>
3474 __TEXTURE_FUNCTIONS_DECL__ char tex1D(texture<char, texType, mode> texRef, float x) {
3475  TEXTURE_REF_PARAMETERS_INIT;
3476  texel.f = __ockl_image_sample_1D(i, s, x);
3477  TEXTURE_RETURN_CHAR;
3478 }
3479 
3480 template <int texType, enum hipTextureReadMode mode>
3481 __TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture<char1, texType, mode> texRef, float x) {
3482  TEXTURE_REF_PARAMETERS_INIT;
3483  texel.f = __ockl_image_sample_1D(i, s, x);
3484  TEXTURE_RETURN_CHAR_X;
3485 }
3486 
3487 template <int texType, enum hipTextureReadMode mode>
3488 __TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture<char2, texType, mode> texRef, float x) {
3489  TEXTURE_REF_PARAMETERS_INIT;
3490  texel.f = __ockl_image_sample_1D(i, s, x);
3491  TEXTURE_RETURN_CHAR_XY;
3492 }
3493 
3494 template <int texType, enum hipTextureReadMode mode>
3495 __TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture<char4, texType, mode> texRef, float x) {
3496  TEXTURE_REF_PARAMETERS_INIT;
3497  texel.f = __ockl_image_sample_1D(i, s, x);
3498  TEXTURE_RETURN_CHAR_XYZW;
3499 }
3500 
3501 template <int texType, enum hipTextureReadMode mode>
3502 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture<unsigned char, texType, mode> texRef,
3503  float x) {
3504  TEXTURE_REF_PARAMETERS_INIT;
3505  texel.f = __ockl_image_sample_1D(i, s, x);
3506  TEXTURE_RETURN_UCHAR;
3507 }
3508 
3509 template <int texType, enum hipTextureReadMode mode>
3510 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture<uchar1, texType, mode> texRef, float x) {
3511  TEXTURE_REF_PARAMETERS_INIT;
3512  texel.f = __ockl_image_sample_1D(i, s, x);
3513  TEXTURE_RETURN_UCHAR_X;
3514 }
3515 
3516 template <int texType, enum hipTextureReadMode mode>
3517 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture<uchar2, texType, mode> texRef, float x) {
3518  TEXTURE_REF_PARAMETERS_INIT;
3519  texel.f = __ockl_image_sample_1D(i, s, x);
3520  TEXTURE_RETURN_UCHAR_XY;
3521 }
3522 
3523 template <int texType, enum hipTextureReadMode mode>
3524 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture<uchar4, texType, mode> texRef, float x) {
3525  TEXTURE_REF_PARAMETERS_INIT;
3526  texel.f = __ockl_image_sample_1D(i, s, x);
3527  TEXTURE_RETURN_UCHAR_XYZW;
3528 }
3529 
3530 template <int texType, enum hipTextureReadMode mode>
3531 __TEXTURE_FUNCTIONS_DECL__ short tex1D(texture<short, texType, mode> texRef, float x) {
3532  TEXTURE_REF_PARAMETERS_INIT;
3533  texel.f = __ockl_image_sample_1D(i, s, x);
3534  TEXTURE_RETURN_SHORT;
3535 }
3536 
3537 template <int texType, enum hipTextureReadMode mode>
3538 __TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture<short1, texType, mode> texRef, float x) {
3539  TEXTURE_REF_PARAMETERS_INIT;
3540  texel.f = __ockl_image_sample_1D(i, s, x);
3541  TEXTURE_RETURN_SHORT_X;
3542 }
3543 
3544 template <int texType, enum hipTextureReadMode mode>
3545 __TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture<short2, texType, mode> texRef, float x) {
3546  TEXTURE_REF_PARAMETERS_INIT;
3547  texel.f = __ockl_image_sample_1D(i, s, x);
3548  TEXTURE_RETURN_SHORT_XY;
3549 }
3550 
3551 template <int texType, enum hipTextureReadMode mode>
3552 __TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture<short4, texType, mode> texRef, float x) {
3553  TEXTURE_REF_PARAMETERS_INIT;
3554  texel.f = __ockl_image_sample_1D(i, s, x);
3555  TEXTURE_RETURN_SHORT_XYZW;
3556 }
3557 
3558 template <int texType, enum hipTextureReadMode mode>
3559 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture<unsigned short, texType, mode> texRef,
3560  float x) {
3561  TEXTURE_REF_PARAMETERS_INIT;
3562  texel.f = __ockl_image_sample_1D(i, s, x);
3563  TEXTURE_RETURN_USHORT;
3564 }
3565 
3566 template <int texType, enum hipTextureReadMode mode>
3567 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture<ushort1, texType, mode> texRef, float x) {
3568  TEXTURE_REF_PARAMETERS_INIT;
3569  texel.f = __ockl_image_sample_1D(i, s, x);
3570  TEXTURE_RETURN_USHORT_X;
3571 }
3572 
3573 template <int texType, enum hipTextureReadMode mode>
3574 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture<ushort2, texType, mode> texRef, float x) {
3575  TEXTURE_REF_PARAMETERS_INIT;
3576  texel.f = __ockl_image_sample_1D(i, s, x);
3577  TEXTURE_RETURN_USHORT_XY;
3578 }
3579 
3580 template <int texType, enum hipTextureReadMode mode>
3581 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture<ushort4, texType, mode> texRef, float x) {
3582  TEXTURE_REF_PARAMETERS_INIT;
3583  texel.f = __ockl_image_sample_1D(i, s, x);
3584  TEXTURE_RETURN_USHORT_XYZW;
3585 }
3586 
3587 template <int texType, enum hipTextureReadMode mode>
3588 __TEXTURE_FUNCTIONS_DECL__ int tex1D(texture<int, texType, mode> texRef, float x) {
3589  TEXTURE_REF_PARAMETERS_INIT;
3590  texel.f = __ockl_image_sample_1D(i, s, x);
3591  TEXTURE_RETURN_INT;
3592 }
3593 
3594 template <int texType, enum hipTextureReadMode mode>
3595 __TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture<int1, texType, mode> texRef, float x) {
3596  TEXTURE_REF_PARAMETERS_INIT;
3597  texel.f = __ockl_image_sample_1D(i, s, x);
3598  TEXTURE_RETURN_INT_X;
3599 }
3600 
3601 template <int texType, enum hipTextureReadMode mode>
3602 __TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture<int2, texType, mode> texRef, float x) {
3603  TEXTURE_REF_PARAMETERS_INIT;
3604  texel.f = __ockl_image_sample_1D(i, s, x);
3605  TEXTURE_RETURN_INT_XY;
3606 }
3607 
3608 template <int texType, enum hipTextureReadMode mode>
3609 __TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture<int4, texType, mode> texRef, float x) {
3610  TEXTURE_REF_PARAMETERS_INIT;
3611  texel.f = __ockl_image_sample_1D(i, s, x);
3612  TEXTURE_RETURN_INT_XYZW;
3613 }
3614 
3615 template <int texType, enum hipTextureReadMode mode>
3616 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture<unsigned int, texType, mode> texRef, float x) {
3617  TEXTURE_REF_PARAMETERS_INIT;
3618  texel.f = __ockl_image_sample_1D(i, s, x);
3619  TEXTURE_RETURN_UINT;
3620 }
3621 
3622 template <int texType, enum hipTextureReadMode mode>
3623 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture<uint1, texType, mode> texRef, float x) {
3624  TEXTURE_REF_PARAMETERS_INIT;
3625  texel.f = __ockl_image_sample_1D(i, s, x);
3626  TEXTURE_RETURN_UINT_X;
3627 }
3628 
3629 template <int texType, enum hipTextureReadMode mode>
3630 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture<uint2, texType, mode> texRef, float x) {
3631  TEXTURE_REF_PARAMETERS_INIT;
3632  texel.f = __ockl_image_sample_1D(i, s, x);
3633  TEXTURE_RETURN_UINT_XY;
3634 }
3635 
3636 template <int texType, enum hipTextureReadMode mode>
3637 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture<uint4, texType, mode> texRef, float x) {
3638  TEXTURE_REF_PARAMETERS_INIT;
3639  texel.f = __ockl_image_sample_1D(i, s, x);
3640  TEXTURE_RETURN_UINT_XYZW;
3641 }
3642 
3643 template <int texType, enum hipTextureReadMode mode>
3644 __TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture<float1, texType, mode> texRef, float x) {
3645  TEXTURE_REF_PARAMETERS_INIT;
3646  texel.f = __ockl_image_sample_1D(i, s, x);
3647  TEXTURE_RETURN_FLOAT_X;
3648 }
3649 
3650 template <int texType, enum hipTextureReadMode mode>
3651 __TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture<float2, texType, mode> texRef, float x) {
3652  TEXTURE_REF_PARAMETERS_INIT;
3653  texel.f = __ockl_image_sample_1D(i, s, x);
3654  TEXTURE_RETURN_FLOAT_XY;
3655 }
3656 
3657 template <int texType, enum hipTextureReadMode mode>
3658 __TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture<float4, texType, mode> texRef, float x) {
3659  TEXTURE_REF_PARAMETERS_INIT;
3660  texel.f = __ockl_image_sample_1D(i, s, x);
3661  TEXTURE_RETURN_FLOAT_XYZW;
3662 }
3663 
3665 template <int texType, enum hipTextureReadMode mode>
3666 __TEXTURE_FUNCTIONS_DECL__ char tex1D(texture<char, texType, mode> texRef,
3667  hipTextureObject_t textureObject, float x) {
3668  TEXTURE_PARAMETERS_INIT;
3669  texel.f = __ockl_image_sample_1D(i, s, x);
3670  TEXTURE_RETURN_CHAR;
3671 }
3672 
3673 template <int texType, enum hipTextureReadMode mode>
3674 __TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture<char1, texType, mode> texRef,
3675  hipTextureObject_t textureObject, float x) {
3676  TEXTURE_PARAMETERS_INIT;
3677  texel.f = __ockl_image_sample_1D(i, s, x);
3678  TEXTURE_RETURN_CHAR_X;
3679 }
3680 
3681 template <int texType, enum hipTextureReadMode mode>
3682 __TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture<char2, texType, mode> texRef,
3683  hipTextureObject_t textureObject, float x) {
3684  TEXTURE_PARAMETERS_INIT;
3685  texel.f = __ockl_image_sample_1D(i, s, x);
3686  TEXTURE_RETURN_CHAR_XY;
3687 }
3688 
3689 template <int texType, enum hipTextureReadMode mode>
3690 __TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture<char4, texType, mode> texRef,
3691  hipTextureObject_t textureObject, float x) {
3692  TEXTURE_PARAMETERS_INIT;
3693  texel.f = __ockl_image_sample_1D(i, s, x);
3694  TEXTURE_RETURN_CHAR_XYZW;
3695 }
3696 
3697 template <int texType, enum hipTextureReadMode mode>
3698 __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture<unsigned char, texType, mode> texRef,
3699  hipTextureObject_t textureObject, float x) {
3700  TEXTURE_PARAMETERS_INIT;
3701  texel.f = __ockl_image_sample_1D(i, s, x);
3702  TEXTURE_RETURN_UCHAR;
3703 }
3704 
3705 template <int texType, enum hipTextureReadMode mode>
3706 __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture<uchar1, texType, mode> texRef,
3707  hipTextureObject_t textureObject, float x) {
3708  TEXTURE_PARAMETERS_INIT;
3709  texel.f = __ockl_image_sample_1D(i, s, x);
3710  TEXTURE_RETURN_UCHAR_X;
3711 }
3712 
3713 template <int texType, enum hipTextureReadMode mode>
3714 __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture<uchar2, texType, mode> texRef,
3715  hipTextureObject_t textureObject, float x) {
3716  TEXTURE_PARAMETERS_INIT;
3717  texel.f = __ockl_image_sample_1D(i, s, x);
3718  TEXTURE_RETURN_UCHAR_XY;
3719 }
3720 
3721 template <int texType, enum hipTextureReadMode mode>
3722 __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture<uchar4, texType, mode> texRef,
3723  hipTextureObject_t textureObject, float x) {
3724  TEXTURE_PARAMETERS_INIT;
3725  texel.f = __ockl_image_sample_1D(i, s, x);
3726  TEXTURE_RETURN_UCHAR_XYZW;
3727 }
3728 
3729 template <int texType, enum hipTextureReadMode mode>
3730 __TEXTURE_FUNCTIONS_DECL__ short tex1D(texture<short, texType, mode> texRef,
3731  hipTextureObject_t textureObject, float x) {
3732  TEXTURE_PARAMETERS_INIT;
3733  texel.f = __ockl_image_sample_1D(i, s, x);
3734  TEXTURE_RETURN_SHORT;
3735 }
3736 
3737 template <int texType, enum hipTextureReadMode mode>
3738 __TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture<short1, texType, mode> texRef,
3739  hipTextureObject_t textureObject, float x) {
3740  TEXTURE_PARAMETERS_INIT;
3741  texel.f = __ockl_image_sample_1D(i, s, x);
3742  TEXTURE_RETURN_SHORT_X;
3743 }
3744 
3745 template <int texType, enum hipTextureReadMode mode>
3746 __TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture<short2, texType, mode> texRef,
3747  hipTextureObject_t textureObject, float x) {
3748  TEXTURE_PARAMETERS_INIT;
3749  texel.f = __ockl_image_sample_1D(i, s, x);
3750  TEXTURE_RETURN_SHORT_XY;
3751 }
3752 
3753 template <int texType, enum hipTextureReadMode mode>
3754 __TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture<short4, texType, mode> texRef,
3755  hipTextureObject_t textureObject, float x) {
3756  TEXTURE_PARAMETERS_INIT;
3757  texel.f = __ockl_image_sample_1D(i, s, x);
3758  TEXTURE_RETURN_SHORT_XYZW;
3759 }
3760 
3761 template <int texType, enum hipTextureReadMode mode>
3762 __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture<unsigned short, texType, mode> texRef,
3763  hipTextureObject_t textureObject, float x) {
3764  TEXTURE_PARAMETERS_INIT;
3765  texel.f = __ockl_image_sample_1D(i, s, x);
3766  TEXTURE_RETURN_USHORT;
3767 }
3768 
3769 template <int texType, enum hipTextureReadMode mode>
3770 __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture<ushort1, texType, mode> texRef,
3771  hipTextureObject_t textureObject, float x) {
3772  TEXTURE_PARAMETERS_INIT;
3773  texel.f = __ockl_image_sample_1D(i, s, x);
3774  TEXTURE_RETURN_USHORT_X;
3775 }
3776 
3777 template <int texType, enum hipTextureReadMode mode>
3778 __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture<ushort2, texType, mode> texRef,
3779  hipTextureObject_t textureObject, float x) {
3780  TEXTURE_PARAMETERS_INIT;
3781  texel.f = __ockl_image_sample_1D(i, s, x);
3782  TEXTURE_RETURN_USHORT_XY;
3783 }
3784 
3785 template <int texType, enum hipTextureReadMode mode>
3786 __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture<ushort4, texType, mode> texRef,
3787  hipTextureObject_t textureObject, float x) {
3788  TEXTURE_PARAMETERS_INIT;
3789  texel.f = __ockl_image_sample_1D(i, s, x);
3790  TEXTURE_RETURN_USHORT_XYZW;
3791 }
3792 
3793 template <int texType, enum hipTextureReadMode mode>
3794 __TEXTURE_FUNCTIONS_DECL__ int tex1D(texture<int, texType, mode> texRef,
3795  hipTextureObject_t textureObject, float x) {
3796  TEXTURE_PARAMETERS_INIT;
3797  texel.f = __ockl_image_sample_1D(i, s, x);
3798  TEXTURE_RETURN_INT;
3799 }
3800 
3801 template <int texType, enum hipTextureReadMode mode>
3802 __TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture<int1, texType, mode> texRef,
3803  hipTextureObject_t textureObject, float x) {
3804  TEXTURE_PARAMETERS_INIT;
3805  texel.f = __ockl_image_sample_1D(i, s, x);
3806  TEXTURE_RETURN_INT_X;
3807 }
3808 
3809 template <int texType, enum hipTextureReadMode mode>
3810 __TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture<int2, texType, mode> texRef,
3811  hipTextureObject_t textureObject, float x) {
3812  TEXTURE_PARAMETERS_INIT;
3813  texel.f = __ockl_image_sample_1D(i, s, x);
3814  TEXTURE_RETURN_INT_XY;
3815 }
3816 
3817 template <int texType, enum hipTextureReadMode mode>
3818 __TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture<int4, texType, mode> texRef,
3819  hipTextureObject_t textureObject, float x) {
3820  TEXTURE_PARAMETERS_INIT;
3821  texel.f = __ockl_image_sample_1D(i, s, x);
3822  TEXTURE_RETURN_INT_XYZW;
3823 }
3824 
3825 template <int texType, enum hipTextureReadMode mode>
3826 __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture<unsigned int, texType, mode> texRef,
3827  hipTextureObject_t textureObject, float x) {
3828  TEXTURE_PARAMETERS_INIT;
3829  texel.f = __ockl_image_sample_1D(i, s, x);
3830  TEXTURE_RETURN_UINT;
3831 }
3832 
3833 template <int texType, enum hipTextureReadMode mode>
3834 __TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture<uint1, texType, mode> texRef,
3835  hipTextureObject_t textureObject, float x) {
3836  TEXTURE_PARAMETERS_INIT;
3837  texel.f = __ockl_image_sample_1D(i, s, x);
3838  TEXTURE_RETURN_UINT_X;
3839 }
3840 
3841 template <int texType, enum hipTextureReadMode mode>
3842 __TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture<uint2, texType, mode> texRef,
3843  hipTextureObject_t textureObject, float x) {
3844  TEXTURE_PARAMETERS_INIT;
3845  texel.f = __ockl_image_sample_1D(i, s, x);
3846  TEXTURE_RETURN_UINT_XY;
3847 }
3848 
3849 template <int texType, enum hipTextureReadMode mode>
3850 __TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture<uint4, texType, mode> texRef,
3851  hipTextureObject_t textureObject, float x) {
3852  TEXTURE_PARAMETERS_INIT;
3853  texel.f = __ockl_image_sample_1D(i, s, x);
3854  TEXTURE_RETURN_UINT_XYZW;
3855 }
3856 
3857 template <int texType, enum hipTextureReadMode mode>
3858 __TEXTURE_FUNCTIONS_DECL__ float tex1D(texture<float, texType, mode> texRef,
3859  hipTextureObject_t textureObject, float x) {
3860  TEXTURE_PARAMETERS_INIT;
3861  texel.f = __ockl_image_sample_1D(i, s, x);
3862  TEXTURE_RETURN_FLOAT;
3863 }
3865 
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:43