merger of two projects

I would like to merge the two projects into one.The main project is " MonteCarlo" in CUDA sdk.The other one is wroten by myself.

The code is :

1.cholesky.cuh

#ifndef TEST_CUH

#define TEST_CUH

void cholesky(float * A_h,float * L_h);

#endif

#define ROW 5

#define ROW2 ROW*ROW

2.MonteCarlo_gold.cpp

#include <cholesky.cuh>

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

float A_h=(float)malloc(sizeof(float)*ROW2);

float L_h=(float)malloc(sizeof(float)*ROW2);

cholesky(A_h,L_h);

}

3.cholesky.cu

#include <cholesky_kernel.cu>

#include <cholesky.cuh>

void cholesky(float * A_h,float *L_h)

{

    float *A_d;

float *L_d;

CUDA_SAFE_CALL(cudaMemcpy(A_d, A_h,sizeof(float) *ROW2,cudaMemcpyHostToDevice) );

matrixMul<<<…>>>(…);

     ....

}

4.cholesky_kernel.cu

#ifndef TEST

#define TEST

#include <stdlib.h>

#include <stdio.h>

#include <cutil.h>

#include <cuda_runtime.h>

#include <math.h>

#endif

#define TEST_CUH

#include <cholesky.cuh>

global void matricMul(…)

{

}

When I run this project,the complier says it can not find struct “threadIdx” .I don’t know what is wrong with it.The small project runs well itself.

Can someone help me,looking forward for your help

threadIdx, blockIdx, blockDim, and gridDim are all reserved keywords in CUDA. They are of type dim3 IIRC.

-Patrick