Blender V2.61 - r43446
|
00001 /* 00002 * Copyright 2011, Blender Foundation. 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef __KERNEL_COMPAT_CUDA_H__ 00020 #define __KERNEL_COMPAT_CUDA_H__ 00021 00022 #define __KERNEL_GPU__ 00023 #define __KERNEL_CUDA__ 00024 #define CCL_NAMESPACE_BEGIN 00025 #define CCL_NAMESPACE_END 00026 00027 #include <cuda.h> 00028 #include <float.h> 00029 00030 #include "util_types.h" 00031 00032 /* Qualifier wrappers for different names on different devices */ 00033 00034 #define __device __device__ __inline__ 00035 #define __device_inline __device__ __inline__ 00036 #define __device_noinline __device__ __noinline__ 00037 #define __global 00038 #define __shared __shared__ 00039 #define __constant 00040 00041 /* No assert supported for CUDA */ 00042 00043 #define kernel_assert(cond) 00044 00045 /* Textures */ 00046 00047 typedef texture<float4, 1> texture_float4; 00048 typedef texture<float, 1> texture_float; 00049 typedef texture<uint, 1> texture_uint; 00050 typedef texture<int, 1> texture_int; 00051 typedef texture<uint4, 1> texture_uint4; 00052 typedef texture<float4, 2> texture_image_float4; 00053 typedef texture<uchar4, 2, cudaReadModeNormalizedFloat> texture_image_uchar4; 00054 00055 /* Macros to handle different memory storage on different devices */ 00056 00057 #define kernel_tex_fetch(t, index) tex1Dfetch(t, index) 00058 #define kernel_tex_interp(t, x, size) tex1D(t, x) 00059 #define kernel_tex_image_interp(t, x, y) tex2D(t, x, y) 00060 00061 #define kernel_data __data 00062 00063 #endif /* __KERNEL_COMPAT_CUDA_H__ */ 00064