Hi All,

I’m new with CUDA programming. I have tried to write a simple program of multiply two matrices (e.g. M and N) but no success so far.

The main error that I have obtained is:

error C2065: ‘threadIdx’: undeclared identifier error C2228: left of ‘.x’ must have class/struct/union

## I have did the following to build my program:

I have installed CUDA toolkit 3.0 and then CUDA SDK

I have tested the installation by running some CUDA example and it is work.

Im trying to write simple program to multiple two matrices (M and N).

- Using Microsoft Visual Studio C\C++, I have created new project—> Win32 Console Application.
- Identify the path of CUDA toolkit and CUDA SDK libraries (include and lib) files in the VC++ directory as the following VC++ -->Tools—>Options—>project and solutions–>VC++ directories 3. Write a program for two matrices multiplication. The structure of the program as the following

Main program (cpp extension) consists from:

(1) matrix parameters identification ( for example width= height=8)

(2) input the matrices element values

(3) Allocate host memories for the needed matrices (i.e. M, N and P)

(4) Call the multiplication function

(5)Free host Matrices (M and N).

Multiplication function (cu extension) consists from:

(1) Allocate device memory for the needed matrices(Md, Nd and Pd)

(2) Copy the two matrices that want to be multiplied from host to device

(3) Setup the execution configuration

(4) invoke the (the kernal) that would multiply the two matrices in parallel. The Kernel in cu extension.

(5) Copy the result matrix from device to host

(6) Free device matrices

Kernel consists from

## (1) Identify the thread

(2) Do the multiplication condition

The errors that I got are:

Error

Fatal error C1083: cannot open include file: ‘shrUtils.h’: No such file or directory when I remove #include <shrUtils.h> from the program, I get:

Error

error C2065: ‘threadIdx’: undeclared identifier error C2228: left of ‘.x’ must have class/struct/union

the same error for threadIdx.y

error C2059: syntax error: ‘<’

Any Help would be appreciated.

Thanks

Hus