error in CUDA program

hi. i m new in cuda and tried to write a simple .c extension code even copy from a page: ) . but i get errormessage on “global” and <<<…>>> part. also get error message like “threadIdx undefined”. i was include cuda.h only. i used visual studio 2005 to compile it. what is the problem with this?

also CUDA has an emulator on CPU. my graphic card does not multi-core so i must run CUDA programs on CPU. but how i differentiate it run on CPU or GPU.

i need your helps friend.


it looks like that you use normal c++ compiler instead of nvcc. Maybe you can check your build rule…

i build CUDA and i could run by Visual Studio. and another problem occured. i wanted to test runnig thread by writing thread number to the screen but now error became from printf function. i also tried to use cout function but both of them failed. is there a different function to print on the screen something

one more question i set up cuda sdk and cuda tookit (not driver because my graphic card is not support cuda i try to use cuda on cpu). i have read that nvcc is in tookit but i can t found it how can i get and use it