OptiX  3.9
NVIDIA OptiX Acceleration Engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
optixu_vector_functions.h
1 
2 /*
3  * Copyright (c) 2010 NVIDIA Corporation. All rights reserved.
4  *
5  * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6  * rights in and to this software, related documentation and any modifications thereto.
7  * Any use, reproduction, disclosure or distribution of this software and related
8  * documentation without an express license agreement from NVIDIA Corporation is strictly
9  * prohibited.
10  *
11  * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12  * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14  * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15  * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16  * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17  * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18  * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19  * SUCH DAMAGES
20  */
21 
22 #ifndef __optixu_optixu_vector_functions_h__
23 #define __optixu_optixu_vector_functions_h__
24 
25 #include "optixu_vector_types.h"
26 
27 
28 #if defined(__cplusplus)
29 
30 /*
31  * We need to check to see if <vector_functions.h> has already been included before we've
32  * had a chance to include it here. If, so that means that the contents will be in the
33  * global namespace, and we will add them to the optix namespace below in order to have
34  * overloaded function in the optix namespace function correctly
35  */
36 
37 # if defined(__VECTOR_FUNCTIONS_H__)
38 # define RT_PULL_IN_VECTOR_FUNCTIONS
39 # endif
40 
41 namespace optix {
42 
43 #endif /* #if defined (__cplusplus) */
44 
45 
46 
47 #include <vector_functions.h>
48 
49 
50 
51 #if defined(__cplusplus)
52 } /* end namespace optix */
53 #endif
54 
55 /* Pull the global namespace CUDA types in CUDA C into the optix namespace. */
56 #if defined(RT_PULL_IN_VECTOR_FUNCTIONS)
57 #define RT_DEFINE_HELPER(type) \
58  using ::make_##type##1; \
59  using ::make_##type##2; \
60  using ::make_##type##3; \
61  using ::make_##type##4;
62 
63 /* Some types didn't exist until CUDA 3.0. CUDA_VERSION isn't defined while
64  * building CUDA code, so we also need to check the CUDART_VERSION value. */
65 #if (CUDA_VERSION >= 3000) || (CUDART_VERSION >= 3000)
66 #define RT_DEFINE_HELPER2(type) RT_DEFINE_HELPER(type)
67 #else
68 #define RT_DEFINE_HELPER2(type) \
69  using ::make_##type##1; \
70  using ::make_##type##2;
71 #endif
72 
73 
74 namespace optix {
75 RT_DEFINE_HELPER(char)
76 RT_DEFINE_HELPER(uchar)
77 RT_DEFINE_HELPER(short)
78 RT_DEFINE_HELPER(ushort)
79 RT_DEFINE_HELPER(int)
80 RT_DEFINE_HELPER(uint)
81 RT_DEFINE_HELPER(long)
82 RT_DEFINE_HELPER(ulong)
83 RT_DEFINE_HELPER(float)
84 RT_DEFINE_HELPER2(longlong)
85 RT_DEFINE_HELPER2(ulonglong)
86 RT_DEFINE_HELPER2(double)
87 } /* end namespace optix */
88 
89 #undef RT_DEFINE_HELPER
90 #undef RT_DEFINE_HELPER2
91 
92 #endif
93 
94 #endif /* #ifndef __optixu_optixu_vector_functions_h__ */
95