OSDN Git Service

new file: Integration/Tomography/Makefile.recent
[eos/hostdependX86LINUX64.git] / hostdepend / X86MAC64 / util / X86MAC64 / cuda / samples / 2_Graphics / bindlessTexture / bindlessTexture.h
1 /*
2  * Copyright 1993-2013 NVIDIA Corporation.  All rights reserved.
3  *
4  * Please refer to the NVIDIA end user license agreement (EULA) associated
5  * with this source code for terms and conditions that govern your use of
6  * this software. Any use, reproduction, disclosure, or distribution of
7  * this software and related documentation outside the terms of the EULA
8  * is strictly prohibited.
9  *
10  */
11
12 #ifndef _BINDLESSTEXTURE_CU_
13 #define _BINDLESSTEXTURE_CU_
14
15 // includes, cuda
16 #include <vector_types.h>
17 #include <driver_functions.h>
18 #include <cuda_runtime.h>
19
20 // CUDA utilities and system includes
21 #include <helper_cuda.h>
22 #include <vector_types.h>
23
24 typedef unsigned int  uint;
25 typedef unsigned char uchar;
26
27 #pragma pack(push,4)
28 struct Image
29 {
30     void                   *h_data;
31     cudaExtent              size;
32     cudaResourceType        type;
33     cudaArray_t             dataArray;
34     cudaMipmappedArray_t    mipmapArray;
35     cudaTextureObject_t     textureObject;
36
37     Image()
38     {
39         memset(this,0,sizeof(Image));
40     }
41 };
42 #pragma pack(pop)
43
44 inline void _checkHost(bool test, const char *condition, const char *file, int line, const char *func)
45 {
46     if (!test)
47     {
48         fprintf(stderr, "HOST error at %s:%d (%s) \"%s\" \n",
49                 file, line, condition, func);
50         exit(EXIT_FAILURE);
51     }
52 }
53
54 #define checkHost(condition)   _checkHost(condition, #condition,__FILE__,__LINE__,__FUNCTION__)
55
56 #endif
57