15,893,663 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Manar aysar (Top 3 by date)
Manar aysar
5-Apr-13 11:10am
View
yes i choose console app. and give me this errors :
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals
how can i solve them ?
Manar aysar
5-Apr-13 10:53am
View
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals
how can solve them ,,plz help me!!
Manar aysar
5-Apr-13 10:51am
View
sorry for being late :)
im using vc++ ,,for my graduation project
when iam using this code
#include"stdafx.h"
#include"omp.h"
#include"iostream"
using namespace std;
int main()
{
int **a,**b,**c; // variables to store allocated memory
int a_r,a_c,b_r,b_c, nthreads, tid, chunk =10; //variables to input matrix
//size and variables to be used by OpenMP functions
double dif,st,et; //variable to calculate the time difference between the parallelization
int i,j,n,m; // variables to be used in for loops to
//generate matrices
cout<<"\nenter rows and columns for the matrix:";
cin>>a_r>>a_c;
cout<<"\nenter rows and columns for the mask :";
cin>>b_r>>b_c;
/* allocate memory for matrix one */
a=(int **) malloc(10*a_r);
for( i=0;i<a_c; i++)
{
a[i]="(int" *)="" malloc(10*a_c);
}
="" *="" allocate="" memory="" for="" matrix="" two=""
b="(int" **)="" malloc(10*b_r);
for(="" i="0;i<b_c;" i++)=""
{
b[i]="(int" malloc(10*b_c);
}
="" sum=""
c="(int" malloc(10*a_r);
for(="" a_c;="" i++)
{
c[i]="(int" malloc(10*a_c);
}
cout<<"enter="" the="" index="" of="" center="" mask="" :"<<endl;
cin="">>n;
cin>>m;
#pragma omp parallel num_threads(1) shared(a,b,c,nthreads,chunk) private(tid,i,j)
{
tid = omp_get_thread_num();
if (tid == 0)
{
nthreads = omp_get_num_threads();
cout<<"Starting matrix multiple example with "<<nthreads<<"threads";
}
st =omp_get_wtime();
//initializing first matrix
#pragma omp for schedule (static, chunk)
for(i=0;i<a_r; i++)
{
for(j="0;j<a_c;" j++)
{
a[i][j]="i+j;
}
}
//" initializing="" second="" matrix
#pragma="" omp="" for="" schedule="" (static,="" chunk)
for(i="0;i<b_r;" j++)
{
b[i][j]="i*j;
}
}
/*initialize" product="" matrix="" *=""
#pragma="" b_c;="" j++)
{
c[i][j]="0;
}
}
#pragma" i++)
{
="" printf("thread="%d" did="" row="%d\n",tid,i);
for(j=0;j<a_c;">=0&&j-1>=0)
c[i][j]=c[i][j]+a[i-1][j-1]*b[n-1][m-1];
if(i+1<a_r&&j+1<a_c)
c[i][j]=c[i][j]+a[i+1][j+1]*b[n+1][m+1];
if(i-1>=0)
c[i][j]=c[i][j]+a[i-1][j]*b[n-1][m];
if(i+1<a_r)
c[i][j]=c[i][j]+a[i+1][j]*b[n+1][m];
if(i+1<a_r&&j-1>=0)
c[i][j]=c[i][j]+a[i+1][j-1]*b[n+1][m-1];
if(i-1>=0&&j+1<a_c)
c[i][j]=c[i][j]+a[i-1][j+1]*b[n-1][m+1];
if(j-1>=0)
c[i][j]=c[i][j]+a[i][j-1]*b[n][m-1];
if(j+1<a_c)
c[i][j]=c[i][j]+a[i][j+1]*b[n][m+1];
}
}
} *****end="" of="" parallel="" region*****=""
cout<<"******************************************************\n";
cout<<"done.\n";
="" et="omp_get_wtime();
dif=et-st;
cout<<"Parallelization" took="" "<<dif<<"sec.="" time.\n";
="" *free="" memory*=""
for(i="0;i<a_r;" i++)
{
free(a[i]);
}
free(a);
for(i="0;i<b_c;" i++)
{
free(b[i]);
}
free(b);
for(i="0;i<a_c;" i++)
{
free(c[i]);
}
free(c);
int="" kkk;cin="">>kkk;
return 0;
}
i think i have aproblem in visual studio installation??what do you think