- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure i'm linked to mkl however I am linked to Lapack and Blas in 'project properties' - Linker compile line I have liblapack and libblas , and if I use fortran 90's 'call' as in call SASUM it compiles but I cannot get the return from it , I also solved a system 3 equates in 3 vars call sgesv() and that works but I want to step through the lapack functions one by one and learn them , however I cannot call SASUM() on a vector without the fortran 'call' and so I cannot get it's return!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry here is my code, happy if anyone helps
DISLIN worked not involved here i just commented it out, other lines commented out are attempts I made to call SASUM without Fortran 'Call' so I could receive a return from it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in Intel Communities.
Could you please find the sample example code for sasumx.f in the following path for Linux(/opt/intel/oneapi/mkl/latest/examples/examples_core_f.tgz) and Windows(C:\Users\svarshax\OneDrive - Intel Corporation\Desktop\MKL EXAMPLES\f\blas\)
Please extract the files and another folder as this path has only readable access.
Please find the below commands for compiling and running the codes:
ifx common_func.f sasumx.f -qmkl
./a.out < ../data/sasumx.d
For more details, please find the below screenshot:
Also, please find the below reference for the function sasumx.f:
https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-fortran/2023-2/asum.html
Could you please let us know the OS details, and MKL version you are using? Also, could you please let us know the input data you are using as well as the expected results you need?
Thanks & Regards,
Varsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Varsha , tried changed the vector C to REAL , it holds the numbers 1-12; loaded INTEGER N with 12 INTEGER incx with 1 and called
E=SASUM(N,C,incx) to no avail it will not compile here's the compiler error: "error #6404: This name does not have a type, and must have an explicit type. [SASUM]"
can still compile though with call SASUM(N,C,incx)
My Intel version number I got from 'tools >options'
IFORT
Intel® Fortran Compiler Classic 2021.10.0 [IA-32]
Intel® Fortran Compiler Classic for applications running on IA-32, version 2021.10.0 Package ID: w_oneAPI_2023.2.1.17
IFX
Intel® Fortran Compiler 2023.2.1 [Intel(R) 64]
Intel® Fortran Compiler for applications running on Intel(R) 64, version 2023.2.1 Package ID: w_oneAPI_2023.2.1.17
I think I'm using IFORT
segsv still solves the system of equations alright nothing wrong there
sorry about all the lines commented out!
Here is my code That would not compile:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot Varsha , haven't tried anything yet but for the first time I see the parameters to SASUM include number of locations in the vector, coming from C++ that made sense, but I had no idea where to put it , Let try this and I'll get back
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot Varsha for the website referrals, I solved the problem, must have been these changes most of them I am sure about;
declared sasum REAL because the compiler was saying 'sasum' has no explicit type so I added REAL :: sasum, I am attempting to follow the ESSEL manual ( from NAG I think) they state that 'N' which is the size or number locations in vector C, should be type INTEGER, however I found that REAL(8) worked as well, the vector C of course is REAL and 'incx' which is the stride or the concatenation of numbers you want sasum to add (it adds all of the absolute values of numbers in the vector) should be INTEGER so I made it INTEGER incx . The example I follow is also from the ESSEL manual, they load a vector with seven signed integers they could be floats as well: {1,-3,-6,7,5,2,-4} and ofcourse the negatives are added as positives (absolute values) so the return from sasum into E is 28.
Following I show the output and then the code with changes:
OUTPUT:
C= 1.000000 -3.000000 -6.000000 7.000000 5.000000
2.000000 -4.000000
C after SASUM
1.000000 -3.000000 -6.000000 7.000000 5.000000
2.000000 -4.000000
E after SASUM
28.0000000000000
CODE:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>Thanks a lot Varsha for the website referrals, I solved the problem, must have been these changes.
Thanks for sharing the complete code with us. It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.
Have a Good Day!
Thanks and Regards,
Varsha
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page