Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
texture_fetch_functions.h224 linesDownload Raw Back to include
1/*
2 * Copyright 1993-2022 NVIDIA Corporation.  All rights reserved.
3 *
4 * NOTICE TO LICENSEE:
5 *
6 * This source code and/or documentation ("Licensed Deliverables") are
7 * subject to NVIDIA intellectual property rights under U.S. and
8 * international Copyright laws.
9 *
10 * These Licensed Deliverables contained herein is PROPRIETARY and
11 * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12 * conditions of a form of NVIDIA software license agreement by and
13 * between NVIDIA and Licensee ("License Agreement") or electronically
14 * accepted by Licensee.  Notwithstanding any terms or conditions to
15 * the contrary in the License Agreement, reproduction or disclosure
16 * of the Licensed Deliverables to any third party without the express
17 * written consent of NVIDIA is prohibited.
18 *
19 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20 * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21 * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE.  IT IS
22 * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23 * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24 * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25 * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27 * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28 * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32 * OF THESE LICENSED DELIVERABLES.
33 *
34 * U.S. Government End Users.  These Licensed Deliverables are a
35 * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36 * 1995), consisting of "commercial computer software" and "commercial
37 * computer software documentation" as such terms are used in 48
38 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39 * only as a commercial end item.  Consistent with 48 C.F.R.12.212 and
40 * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41 * U.S. Government End Users acquire the Licensed Deliverables with
42 * only those rights set forth herein.
43 *
44 * Any use of the Licensed Deliverables in individual and commercial
45 * software must include, in the user documentation and internal
46 * comments to the code, the above Disclaimer and U.S. Government End
47 * Users Notice.
48 */
49
50#if !defined(__TEXTURE_FETCH_FUNCTIONS_H__)
51#define __TEXTURE_FETCH_FUNCTIONS_H__
52
53
54#if defined(__cplusplus) && defined(__CUDACC__)
55
56/*******************************************************************************
57*                                                                              *
58*                                                                              *
59*                                                                              *
60*******************************************************************************/
61
62#include "cuda_runtime_api.h"
63#include "cuda_texture_types.h"
64
65#if defined(_WIN32)
66# define __DEPRECATED__ __declspec(deprecated)
67#else
68# define __DEPRECATED__  __attribute__((deprecated))
69#endif
70
71
72template <typename T>
73struct __nv_tex_rmet_ret { };
74
75template<> struct __nv_tex_rmet_ret<char> { typedef char type; };
76template<> struct __nv_tex_rmet_ret<signed char> { typedef signed char type; };
77template<> struct __nv_tex_rmet_ret<unsigned char> { typedef unsigned char type; };
78template<> struct __nv_tex_rmet_ret<char1> { typedef char1 type; };
79template<> struct __nv_tex_rmet_ret<uchar1> { typedef uchar1 type; };
80template<> struct __nv_tex_rmet_ret<char2> { typedef char2 type; };
81template<> struct __nv_tex_rmet_ret<uchar2> { typedef uchar2 type; };
82template<> struct __nv_tex_rmet_ret<char4> { typedef char4 type; };
83template<> struct __nv_tex_rmet_ret<uchar4> { typedef uchar4 type; };
84
85template<> struct __nv_tex_rmet_ret<short> { typedef short type; };
86template<> struct __nv_tex_rmet_ret<unsigned short> { typedef unsigned short type; };
87template<> struct __nv_tex_rmet_ret<short1> { typedef short1 type; };
88template<> struct __nv_tex_rmet_ret<ushort1> { typedef ushort1 type; };
89template<> struct __nv_tex_rmet_ret<short2> { typedef short2 type; };
90template<> struct __nv_tex_rmet_ret<ushort2> { typedef ushort2 type; };
91template<> struct __nv_tex_rmet_ret<short4> { typedef short4 type; };
92template<> struct __nv_tex_rmet_ret<ushort4> { typedef ushort4 type; };
93
94template<> struct __nv_tex_rmet_ret<int> { typedef int type; };
95template<> struct __nv_tex_rmet_ret<unsigned int> { typedef unsigned int type; };
96template<> struct __nv_tex_rmet_ret<int1> { typedef int1 type; };
97template<> struct __nv_tex_rmet_ret<uint1> { typedef uint1 type; };
98template<> struct __nv_tex_rmet_ret<int2> { typedef int2 type; };
99template<> struct __nv_tex_rmet_ret<uint2> { typedef uint2 type; };
100template<> struct __nv_tex_rmet_ret<int4> { typedef int4 type; };
101template<> struct __nv_tex_rmet_ret<uint4> { typedef uint4 type; };
102
103#if !defined(__LP64__)
104template<> struct __nv_tex_rmet_ret<long> { typedef long type; };
105template<> struct __nv_tex_rmet_ret<unsigned long> { typedef unsigned long type; };
106template<> struct __nv_tex_rmet_ret<long1> { typedef long1 type; };
107template<> struct __nv_tex_rmet_ret<ulong1> { typedef ulong1 type; };
108template<> struct __nv_tex_rmet_ret<long2> { typedef long2 type; };
109template<> struct __nv_tex_rmet_ret<ulong2> { typedef ulong2 type; };
110template<> struct __nv_tex_rmet_ret<long4> { typedef long4 type; };
111template<> struct __nv_tex_rmet_ret<ulong4> { typedef ulong4 type; };
112#endif /* !__LP64__ */
113template<> struct __nv_tex_rmet_ret<float> { typedef float type; };
114template<> struct __nv_tex_rmet_ret<float1> { typedef float1 type; };
115template<> struct __nv_tex_rmet_ret<float2> { typedef float2 type; };
116template<> struct __nv_tex_rmet_ret<float4> { typedef float4 type; };
117
118
119template <typename T> struct __nv_tex_rmet_cast { typedef T* type;  };
120#if !defined(__LP64__)
121template<> struct __nv_tex_rmet_cast<long> { typedef int *type; };
122template<> struct __nv_tex_rmet_cast<unsigned long> { typedef unsigned int *type; };
123template<> struct __nv_tex_rmet_cast<long1> { typedef int1 *type; };
124template<> struct __nv_tex_rmet_cast<ulong1> { typedef uint1 *type; };
125template<> struct __nv_tex_rmet_cast<long2> { typedef int2 *type; };
126template<> struct __nv_tex_rmet_cast<ulong2> { typedef uint2 *type; };
127template<> struct __nv_tex_rmet_cast<long4> { typedef int4 *type; };
128template<> struct __nv_tex_rmet_cast<ulong4> { typedef uint4 *type; };
129#endif /* !__LP64__ */
130
131template <typename T>
132struct __nv_tex_rmnf_ret { };
133
134template <> struct __nv_tex_rmnf_ret<char> { typedef float type; };
135template <> struct __nv_tex_rmnf_ret<signed char> { typedef float type; };
136template <> struct __nv_tex_rmnf_ret<unsigned char> { typedef float type; };
137template <> struct __nv_tex_rmnf_ret<short> { typedef float type; };
138template <> struct __nv_tex_rmnf_ret<unsigned short> { typedef float type; };
139template <> struct __nv_tex_rmnf_ret<char1> { typedef float1 type; };
140template <> struct __nv_tex_rmnf_ret<uchar1> { typedef float1 type; };
141template <> struct __nv_tex_rmnf_ret<short1> { typedef float1 type; };
142template <> struct __nv_tex_rmnf_ret<ushort1> { typedef float1 type; };
143template <> struct __nv_tex_rmnf_ret<char2> { typedef float2 type; };
144template <> struct __nv_tex_rmnf_ret<uchar2> { typedef float2 type; };
145template <> struct __nv_tex_rmnf_ret<short2> { typedef float2 type; };
146template <> struct __nv_tex_rmnf_ret<ushort2> { typedef float2 type; };
147template <> struct __nv_tex_rmnf_ret<char4> { typedef float4 type; };
148template <> struct __nv_tex_rmnf_ret<uchar4> { typedef float4 type; };
149template <> struct __nv_tex_rmnf_ret<short4> { typedef float4 type; };
150template <> struct __nv_tex_rmnf_ret<ushort4> { typedef float4 type; };
151
152
153template <typename T>
154struct __nv_tex2dgather_ret { };
155template <> struct __nv_tex2dgather_ret<char> { typedef char4 type; };
156template <> struct __nv_tex2dgather_ret<signed char> { typedef char4 type; };
157template <> struct __nv_tex2dgather_ret<char1> { typedef char4 type; };
158template <> struct __nv_tex2dgather_ret<char2> { typedef char4 type; };
159template <> struct __nv_tex2dgather_ret<char3> { typedef char4 type; };
160template <> struct __nv_tex2dgather_ret<char4> { typedef char4 type; };
161template <> struct __nv_tex2dgather_ret<unsigned char> { typedef uchar4 type; };
162template <> struct __nv_tex2dgather_ret<uchar1> { typedef uchar4 type; };
163template <> struct __nv_tex2dgather_ret<uchar2> { typedef uchar4 type; };
164template <> struct __nv_tex2dgather_ret<uchar3> { typedef uchar4 type; };
165template <> struct __nv_tex2dgather_ret<uchar4> { typedef uchar4 type; };
166
167template <> struct __nv_tex2dgather_ret<short> { typedef short4 type; };
168template <> struct __nv_tex2dgather_ret<short1> { typedef short4 type; };
169template <> struct __nv_tex2dgather_ret<short2> { typedef short4 type; };
170template <> struct __nv_tex2dgather_ret<short3> { typedef short4 type; };
171template <> struct __nv_tex2dgather_ret<short4> { typedef short4 type; };
172template <> struct __nv_tex2dgather_ret<unsigned short> { typedef ushort4 type; };
173template <> struct __nv_tex2dgather_ret<ushort1> { typedef ushort4 type; };
174template <> struct __nv_tex2dgather_ret<ushort2> { typedef ushort4 type; };
175template <> struct __nv_tex2dgather_ret<ushort3> { typedef ushort4 type; };
176template <> struct __nv_tex2dgather_ret<ushort4> { typedef ushort4 type; };
177
178template <> struct __nv_tex2dgather_ret<int> { typedef int4 type; };
179template <> struct __nv_tex2dgather_ret<int1> { typedef int4 type; };
180template <> struct __nv_tex2dgather_ret<int2> { typedef int4 type; };
181template <> struct __nv_tex2dgather_ret<int3> { typedef int4 type; };
182template <> struct __nv_tex2dgather_ret<int4> { typedef int4 type; };
183template <> struct __nv_tex2dgather_ret<unsigned int> { typedef uint4 type; };
184template <> struct __nv_tex2dgather_ret<uint1> { typedef uint4 type; };
185template <> struct __nv_tex2dgather_ret<uint2> { typedef uint4 type; };
186template <> struct __nv_tex2dgather_ret<uint3> { typedef uint4 type; };
187template <> struct __nv_tex2dgather_ret<uint4> { typedef uint4 type; };
188
189template <> struct __nv_tex2dgather_ret<float> { typedef float4 type; };
190template <> struct __nv_tex2dgather_ret<float1> { typedef float4 type; };
191template <> struct __nv_tex2dgather_ret<float2> { typedef float4 type; };
192template <> struct __nv_tex2dgather_ret<float3> { typedef float4 type; };
193template <> struct __nv_tex2dgather_ret<float4> { typedef float4 type; };
194
195
196template<typename T> struct __nv_tex2dgather_rmnf_ret { };
197template<> struct __nv_tex2dgather_rmnf_ret<char> { typedef float4 type; };
198template<> struct __nv_tex2dgather_rmnf_ret<signed char> { typedef float4 type; };
199template<> struct __nv_tex2dgather_rmnf_ret<unsigned char> { typedef float4 type; };
200template<> struct __nv_tex2dgather_rmnf_ret<char1> { typedef float4 type; };
201template<> struct __nv_tex2dgather_rmnf_ret<uchar1> { typedef float4 type; };
202template<> struct __nv_tex2dgather_rmnf_ret<char2> { typedef float4 type; };
203template<> struct __nv_tex2dgather_rmnf_ret<uchar2> { typedef float4 type; };
204template<> struct __nv_tex2dgather_rmnf_ret<char3> { typedef float4 type; };
205template<> struct __nv_tex2dgather_rmnf_ret<uchar3> { typedef float4 type; };
206template<> struct __nv_tex2dgather_rmnf_ret<char4> { typedef float4 type; };
207template<> struct __nv_tex2dgather_rmnf_ret<uchar4> { typedef float4 type; };
208template<> struct __nv_tex2dgather_rmnf_ret<signed short> { typedef float4 type; };
209template<> struct __nv_tex2dgather_rmnf_ret<unsigned short> { typedef float4 type; };
210template<> struct __nv_tex2dgather_rmnf_ret<short1> { typedef float4 type; };
211template<> struct __nv_tex2dgather_rmnf_ret<ushort1> { typedef float4 type; };
212template<> struct __nv_tex2dgather_rmnf_ret<short2> { typedef float4 type; };
213template<> struct __nv_tex2dgather_rmnf_ret<ushort2> { typedef float4 type; };
214template<> struct __nv_tex2dgather_rmnf_ret<short3> { typedef float4 type; };
215template<> struct __nv_tex2dgather_rmnf_ret<ushort3> { typedef float4 type; };
216template<> struct __nv_tex2dgather_rmnf_ret<short4> { typedef float4 type; };
217template<> struct __nv_tex2dgather_rmnf_ret<ushort4> { typedef float4 type; };
218
219#undef __DEPRECATED__
220
221#endif /* __cplusplus && __CUDACC__ */
222
223#endif /* !__TEXTURE_FETCH_FUNCTIONS_H__ */
224 
codekingpro/portable-devtools · Team Ai