- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#include "iostream"
#include "vector"
#include "string"
#include "fstream"
#include "iomanip"
#include
const string SAfter="D:\DEMO\SAfter.txt";
const string PAfter="D:\DEMO\PAfter.txt";
{
int i,j,k;
for(i=0;i
Vec[i*nsize+j]=i*N+j;
}
}
{
ofstream ofs(str.c_str());
ofs<
for(i=0;i
ofs.precision(4);
if((i*nsize+j)%8==0)
ofs<
}
}
{
int i,j,first,ix,xi,jy,yj;
for(i=1;i
first=i*nsize+j;//A
ix=(i-1)*nsize+j;//A[i-1]
xi=(i+1)*nsize+j;//A[i+1]
jy=first-1; //A[j-1]
yj=first+1; //A[j+1]
Vec[first]=(Vec[ix]+Vec[xi]+Vec[jy]+Vec[yj])/2.0f;
}
}
{
int i,j,first,ix,xi,jy,yj;
for(i=1;i
first=i*nsize+j;//A
yj=first+1; //A[j+1]
if(lock[ix]==1) //if the A[i-1]
Vec[first]=(Vec[ix]+Vec[xi]+Vec[jy]+Vec[yj])/2.0f;
lock[first]=1;
}
}
}
int main(int argc, char* argv[])
{
vector
vector
Init(N,fVec);
Calculation(N,fVec);
OutPut(SAfter,N,fVec);
OutPut(Before,N,fVect);
P_Calculation(N,fVect,mylock);
OutPut(PAfter,N,fVect);
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The example you posted has numerous syntax errors:
C:>icl -Qopenmp simple.cpp
Intel C++ Compiler for 32-bit applications, Version 8.1 Build 20060606Z Package ID: w_cc_pc_8.1.038
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
simple.cpp
simple.cpp(19): error: argument list for class template "std::vector" is missing
void Init(int nsize,vector &Vec)
^
simple.cpp(22): error: expected a ";"
for(i=0;i for (j=0;j {
^
simple.cpp(54): error: this pragma must immediately precede a statement
#pragma omp parallel for private(i,j,first,ix,xi,jy,yj) default(shared) num_th
reads(2)
^
simple.cpp(71): warning #12: parsing restarts here after previous syntax error
vector fVect(N*N,0);
^
simple.cpp(72): error: argument list for class template "std::vector" is missing
vector mylock(N*N,0);
^
simple.cpp(72): error: expected a ")"
vector mylock(N*N,0);
^
simple.cpp(84): warning #12: parsing restarts here after previous syntax error
}
^
simple.cpp(84): error: expected a statement
}
^
compilation aborted for simple.cpp (code 2)
If you will please file an IntelPremier Support issue, and attach (not copy/paste) a test case that we can compile and run, we will be happy to investigate your issue. Please ask that the issue be directed to Patrick.
Thank you,
Intel Compiler Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page