I am using Nvidia sdk to run the opencl prorgams. The codes provided as samples are running fine, but in my code, shrFindFilePath(cSourceCL) is returning NULL everytime. Even if I copy paste the codes exactly as the sample itself, it is retuning null.
This is my code as of the cpp file
#include<oclUtils.h>
#include<shrQATest.h>
const char* cSourceFile="./test.cl";//name of the cl file
void *srcA,*srcB,*C;//host buffers



//open cl type variables
cl_platform_id cpPlatform;//Opencl platform
cl_device_id cdDevice;//Opencl device
cl_context cxGPUContext;//opencl context
cl_command_queue cqCommandQueue;//opencl commandque
cl_program cpProgram;//opencl program
cl_kernel ckKernel;//Opencl Kernel
cl_mem cmDevSrcA;//opencl deice source buifffer for A;
cl_mem cmDevSrcB;//"
cl_mem cmDevSrcC;
size_t szGlobalWorkSize;
size_t szLocalWorkSize;
size_t szKernelLength;
cl_int ciErr;
char *cPathName=NULL;
char *cSourceCL=NULL;
const char* cExecutableName=NULL;

int iNumEl=256;


void Cleanup(int iExitCode);
void (*pCleanup)(int) = &Cleanup;

int main(int argc,char **argv){


//int ii=0;
shrQAStart(argc,argv);
cExecutableName=argv[0];
shrSetLogFileName("pkAddcl.txt");
shrLog("%s Starting...\n\n# of float elements per Array \t= %u\n", argv[0], iNumEl);
szLocalWorkSize=256;
szGlobalWorkSize=shrRoundUp((int)szLocalWorkSize,i NumEl);
shrLog("Global Work Size \t\t= %u\nLocal Work Size \t\t= %u\n# of Work Groups \t\t= %u\n\n",szGlobalWorkSize, szLocalWorkSize, (szGlobalWorkSize % szLocalWorkSize + szGlobalWorkSize/szLocalWorkSize));

//allocating host memory
shrLog("allocating Host and Init mems....\n");
srcA=(void*)malloc(sizeof(cl_float4)*szGlobalWorkS ize);
srcB=(void*)malloc(sizeof(cl_float4)*szGlobalWorkS ize);
C=(void*)malloc(sizeof(cl_float4)*szGlobalWorkSize );
shrFillArray((float*)srcA,4*iNumEl);
shrFillArray((float*)srcB,5*iNumEl);
char buff[2048];
//Create everything
//get platform
ciErr=oclGetPlatformID(&cpPlatform);
oclCheckError(ciErr, CL_SUCCESS);
ciErr=clGetPlatformInfo (cpPlatform, CL_PLATFORM_NAME, sizeof(buff), buff, NULL);
shrLog( "the platform is....%s ",buff);
//get a GPU dev


ciErr=clGetDeviceIDs(cpPlatform,CL_DEVICE_TYPE_GPU ,1,&cdDevice,NULL);
oclCheckError(ciErr, CL_SUCCESS);
shrLog("\n\nthe value of CL_SUCCESSs is ..%d",CL_SUCCESS);
//create context
cxGPUContext=clCreateContext(0,1,&cdDevice,NULL,NU LL,&ciErr);
oclCheckError(ciErr, CL_SUCCESS);
//creatint a command u
cqCommandQueue=clCreateCommandQueue(cxGPUContext,c dDevice,0,&ciErr);
oclCheckError(ciErr, CL_SUCCESS);
//allocating mem at the device
shrLog("\n\ncreating and allocating memory on the device");

cmDevSrcA=clCreateBuffer(cxGPUContext,CL_MEM_READ_ ONLY,sizeof(cl_float)*szGlobalWorkSize*4,NULL,&ciE rr);
oclCheckError(ciErr, CL_SUCCESS);
shrLog("\nfirst buffer A %d",ciErr);

cmDevSrcB=clCreateBuffer(cxGPUContext,CL_MEM_READ_ ONLY,sizeof(cl_float)*szGlobalWorkSize*4,NULL,&ciE rr);
oclCheckError(ciErr, CL_SUCCESS);
shrLog("\n 2 buffer B %d",ciErr);
cmDevSrcC=clCreateBuffer(cxGPUContext,CL_MEM_WRITE _ONLY,sizeof(cl_float)*szGlobalWorkSize,NULL,&ciEr r);
oclCheckError(ciErr, CL_SUCCESS);
shrLog("\n3 buffer C %d",ciErr);

//read the Open cl file to form the kernel
shrLog("\n reading from file callLoadProgWithSource....%s",cSourceFile);
cPathName=shrFindFilePath(cSourceFile,argv[0]);
///////////////////////////////////////////////////////////////////////////////////////////////

shrLog("\nthe cPathName value is....%s",cPathName);

oclCheckError(ciErr, CL_SUCCESS);
cSourceCL=oclLoadProgSource(cPathName,"",&szKernel Length);
oclCheckError(ciErr, CL_SUCCESS);
shrLog("\nthe cSourceCL value is...%s ",cSourceCL);

//create program
shrLog("\nclCreateProgramWithSource....creating program with source\n");
cpProgram=clCreateProgramWithSource(cxGPUContext,1 ,(const char**)&cSourceCL,&szKernelLength,&ciErr);
shrLog("the cpProgram is %s",cpProgram);


//Building the program

shrLog("\nbuilding the program...clBuildProgram\n");
ciErr=clBuildProgram(cpProgram,0,NULL,NULL,NULL,NU LL);
shrLog("\n\nEror at program = %d",ciErr);
if(ciErr!=CL_SUCCESS){
shrLog("\nprinted Upto here");
shrLogEx(LOGBOTH|ERRORMSG,ciErr,STDERROR);
oclLogBuildInfo(cpProgram,oclGetFirstDev(cxGPUCont ext));
oclLogPtx(cpProgram,oclGetFirstDev(cxGPUContext)," pkAddcl.ptx");
}
//create kernel
shrLog("\nCreating kernel....clCreateKernel\n\n");
ckKernel=clCreateKernel(cpProgram,"add",&ciErr);
//setting the args
ciErr=clSetKernelArg(ckKernel,0,sizeof(cl_mem),(vo id*)&cmDevSrcA);
ciErr|=clSetKernelArg(ckKernel,1,sizeof(cl_mem),(v oid*)&cmDevSrcB);
ciErr|=clSetKernelArg(ckKernel,2,sizeof(cl_mem),(v oid*)&cmDevSrcC);
oclCheckError(ciErr, CL_SUCCESS);
//core seq....copy iput to GPU and Results back to host
//asynch write of data to GPU
shrLog("\nclEnqueue....srcA and srcB\n");
ciErr=clEnqueueWriteBuffer(cqCommandQueue,cmDevSrc A,CL_FALSE,0,sizeof(cl_float)*szGlobalWorkSize*4,s rcA,0,NULL,NULL);
ciErr|=clEnqueueWriteBuffer(cqCommandQueue,cmDevSr cB,CL_FALSE,0,sizeof(cl_float)*szGlobalWorkSize*4, srcB,0,NULL,NULL);
oclCheckError(ciErr, CL_SUCCESS);
//launch kernel
shrLog("\nclEnqueueNDRangeKernel...\n");
ciErr=clEnqueueNDRangeKernel(cqCommandQueue,ckKern el,1,NULL,&szGlobalWorkSize,&szLocalWorkSize,0,NUL L,NULL);
oclCheckError(ciErr, CL_SUCCESS);

//read back the results
shrLog("\nclEnqueueReadBuffer.....read the results from the buffer\n");
ciErr=clEnqueueReadBuffer(cqCommandQueue,cmDevSrcC ,CL_TRUE,0,sizeof(cl_float)*szGlobalWorkSize,C,0,N ULL,NULL);
oclCheckErrorEX(ciErr, CL_SUCCESS,pCleanup);

Cleanup(EXIT_SUCCESS);
}
void Cleanup(int iExitCode)
{
// Cleanup allocated objects
shrLog("Starting Cleanup...\n\n");
if(cPathName)free(cPathName);
if(cSourceCL)free(cSourceCL);
if(ckKernel)clReleaseKernel(ckKernel);
if(cpProgram)clReleaseProgram(cpProgram);
if(cqCommandQueue)clReleaseCommandQueue(cqCommandQ ueue);
if(cxGPUContext)clReleaseContext(cxGPUContext);
if (cmDevSrcA)clReleaseMemObject(cmDevSrcA);
if (cmDevSrcB)clReleaseMemObject(cmDevSrcB);
if (cmDevSrcC)clReleaseMemObject(cmDevSrcC);

// Free host memory
free(srcA);
free(srcB);
free (C);



}



And This is the cl file
__kernel void add(__global const float* a, __global const float* b, __global float* c, int iNumElements)
{
unsigned int i=get_global_id(0);
c[i]=a[i]+b[i];
}



Both the files are in the same dir , test and are located at /piyush/NVIDIA_GPU_Computing_SDK/OpenCL/src/test



Any help on the matter will be appreciated.
Thanks

Piyush