PTX File and Texture

Program successfully fetched 2D textures before I switched to using ptx file to input the kernel code. Do I need to do something special with the ptx file to get textures to work?

Using Cuda 4.2. current driver.

here is the include file used for both the host and the kernel routines:
/////////////// "textureDefs.cuh" file ///////////////////////////////////////////
#ifndef _TEXTUREDEFS_CUH
#define _TEXTUREDEFS_CUH
texture < float, cudaTextureType2D, cudaReadModeElementType> texRefEachRes_1;
texture <float, cudaTextureType2D, cudaReadModeElementType> texRefEachResPrev;

Here is the host code:

///////////////////////////////////////////////////////////////////////////////
///       myBind.cu
/////////////////////////////////////////////////

#include &quot;cuda.h&quot;
#include &quot;textureDefs.cuh&quot;
extern cudaPitchedPtr gYAllFramesForEachRes[ME_NUM_RES], gPrevYForEachRes[ME_NUM_RES];
//
extern &quot;C&quot;  cudaError_t bindTextures(int resNum)
{
    cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(32, 0, 0, 0, cudaChannelFormatKindFloat); // x is 32 bit float
    
    size_t offset;
    texRefEachResPrev.addressMode[0] = cudaAddressModeClamp;
    texRefEachResPrev.addressMode[1] = cudaAddressModeClamp;
    texRefEachResPrev.filterMode = cudaFilterModeLinear;
    texRefEachResPrev.normalized = false;
    cudaError_t err = cudaBindTexture2D(&offset, &texRefEachResPrev, 
            (unsigned char *)gPrevYForEachRes[resNum].ptr, &channelDesc, 
                    gPrevYForEachRes[resNum].xsize, gPrevYForEachRes[resNum].ysize,   
           gPrevYForEachRes[resNum].pitch);  // jm bug 1/5
        return err;
}

Upon compilation i have a myBind.ptx file. should i be doing something with this?

My kernel codes are in a file called myKernel.cu which compiles out to myKernel.ptx

Where is my problem in using textures?