"texture is not a template" Error? MVS 2010

Hey guys,

I am getting “Error:texture is not a template” when I write:

texture<float>  def_tensor;

I am running MVS 2010, CUDA 4.0, compute capability 1.3

MVS knows where this template is defined : cuda_texture_types.h (and some others)

I tried including these header files with no luck. Also tried copying these and putting them in with my local header files with no luck either. Any suggestions?

Cheers,

Andrew

Is your texture declaration in a .cu file compiled by nvcc? It needs to be

Try filling out all parameters:

texture<float, 1, cudaReadModeElementType> def_tensor;

Is this an intellisense error, but not a compile error? If so, I’ve not been able to rid myself all it either. I’ve managed to hack a file to trick the IDE to ignore most symbols. YMMV. See below:

#ifdef __INTELLISENSE__

#define __launch_bounds__(x)

#define __restrict__

#define __device__

#define __global__

#define __inline__

#define __shared__

#define __constant__

#define __texture_type__

#define __float2half_rn(x) 1

#define __align__(x)

#define __saturatef(x) 1

#define __syncthreads(x)

#define __int_as_float(x) 1

//#define tex1D(t,x) 1

//#define tex2D(t,x,y) 1

//struct int3 { int x,y,z; };

//struct uint3 { unsigned int x,y,z; };

static struct _blockIdx { unsigned int x,y,z; } blockIdx;

static struct _threadIdx { unsigned int x,y,z; } threadIdx;

static struct _blockDim { unsigned int x,y,z; } blockDim;

static struct _blockIdx { unsigned int x,y,z; } blockIdx;

typedef int warpSize;

#endif