| | |
Loop was vectorized
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 5
Reputation:
Solved Threads: 0
I don't know how to solve this problem in my code
voro.cpp(200): (col. 5) remark: LOOP WAS VECTORIZED
voro.cpp(395): same problem
voro.cpp(423):
voro.cpp(427):
I am using intel compiler 10.1 to compile my code
the code works fine on dev C++ 4.9.9.2 and V C++ 2008
200
395
423
427
Thank you for your time
voro.cpp(200): (col. 5) remark: LOOP WAS VECTORIZED
voro.cpp(395): same problem
voro.cpp(423):
voro.cpp(427):
I am using intel compiler 10.1 to compile my code
the code works fine on dev C++ 4.9.9.2 and V C++ 2008
200
C++ Syntax (Toggle Plain Text)
for(j=0; j<3; j++) { orient_norm[i][j] = orient[i][j]/len; }
395
C++ Syntax (Toggle Plain Text)
for(i=0; i<4; i++) // Normalise quat[i] /= qlen;
423
C++ Syntax (Toggle Plain Text)
for(j=0; j<3; j++) ori_rot[i][j] = orient_norm[i][0]*q_matrix[0][j] + orient_norm[i][1]*q_matrix[1][j] + orient_norm[i][2]*q_matrix[2][j];
427
C++ Syntax (Toggle Plain Text)
for(j=0; j<3; j++) bas_rot[i][j] = basis[i][0]*q_matrix[0][j] + basis[i][1]*q_matrix[1][j] + basis[i][2]*q_matrix[2][j];
Thank you for your time
When one vectorized their code the idea is to have the three or four components processed side by side.
Re-examine your loops as you have a problem. They're all exclusive but some are {0...2} and some are {0...3} for XYZ and XYZW processing. Was that intentional?
You haven't shown your declarations so difficult to tell if you're out of range thus causing your segmentation fault.
Also you only show snippets but do a pre-divide by zero check! Typically in vectors you're just not dividing a vector by a scalar. You are generating a product by multiplying a vector by a reciprocal scalar. If that is the case, if the divisor (typically a magnitude) is very close to zero, then don't do the 'division'. As the divident approaches zero, the result of the reciprocal-square root is negligible thus use the algebraic multiplicative identity (N = N * 1) thus N = N.
Re-examine your loops as you have a problem. They're all exclusive but some are {0...2} and some are {0...3} for XYZ and XYZW processing. Was that intentional?
You haven't shown your declarations so difficult to tell if you're out of range thus causing your segmentation fault.
Also you only show snippets but do a pre-divide by zero check! Typically in vectors you're just not dividing a vector by a scalar. You are generating a product by multiplying a vector by a reciprocal scalar. If that is the case, if the divisor (typically a magnitude) is very close to zero, then don't do the 'division'. As the divident approaches zero, the result of the reciprocal-square root is negligible thus use the algebraic multiplicative identity (N = N * 1) thus N = N.
•
•
Join Date: Jun 2009
Posts: 5
Reputation:
Solved Threads: 0
thank you wildgoose
the loops were intentional one is position the other rotation (quaternions)
I have checked for for
pointing to un-initialised variables
and
pointing to outside of allocated vectors and matrices
what else would cause a segmentation fault
i do have this
would either cause a segmentation error (Unfortunately i get this error at university using the icc 10.1 compiler so i cannot check myself)
the loops were intentional one is position the other rotation (quaternions)
I have checked for for
pointing to un-initialised variables
and
pointing to outside of allocated vectors and matrices
what else would cause a segmentation fault
i do have this
•
•
•
•
string style;
char* output_file;
style = argv[1];
output_file = argv[14];
argv[] You really have 14 command line arguments? [0] is path.
In your matrics [][] you show i as an index but you don't show what it is set to! I'm assuming it contains a valid index?
Other then that I don't spot an indexing error. Provided your vectors are [4] and [4][4].
This is a good time to also make sure your vector's and matrices are properly aligned. The first step is Pseudo Vector code such as you're doing now. The next logical step is using SIMD (Single-Instruction Multiple Data) operands (Assembly Language).
In your matrics [][] you show i as an index but you don't show what it is set to! I'm assuming it contains a valid index?
Other then that I don't spot an indexing error. Provided your vectors are [4] and [4][4].
This is a good time to also make sure your vector's and matrices are properly aligned. The first step is Pseudo Vector code such as you're doing now. The next logical step is using SIMD (Single-Instruction Multiple Data) operands (Assembly Language).
![]() |
Similar Threads
- Help with gui loop. (C)
- Loop...without the loop (Java)
Other Threads in the C++ Forum
- Previous Thread: Add a little Color to your Console Text
- Next Thread: C++ Application Help
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data database delete desktop developer directshow dll download dynamic encryption error file forms fstream function functions game generator getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





