cancel
Showing results for 
Search instead for 
Did you mean: 

Server Processors

realbabilu
Journeyman III

How to link AOCC compiler with Blas to AOCL Blis libFlame

#AOCL and #AOCC 2.1 question

I run thru ubuntu WSL win10 on Ryzen 5 3600.

1. I try to compile the slightly modified polyhedron TEST_CPU3.f90 (that has no BLAS code inside) with AOCL+AOCC2.1.

I have troubled to link it with Blis on AOCL. Can you gave us suggestion ? the code has to link the ILANV, DGETRI, DGETRF from Blas 3/Lapack for inverse the matrix.

flang TEST_FPU3.f90 --O3 --march=zver2  --ffast-math --funroll-loops

2. I get the segmentation fault if goes for /Ofast for TEST_CPU2.f90 (has blas code inside) https://www.fortran.uk/pb11.zip  why?

3.I hope there will be auto parallel switch development just other compilers 

0 Likes
2 Replies
praveen
Staff

>>>I try to compile the slightly modified polyhedron TEST_CPU3.f90 (that has no BLAS code inside) with >>>AOCL+AOCC2.1.

1) Solution:

  • In file test_fpu3.f90, line 26, replace “.” With “,” which  was resulting in syntax error
    • REAL(RK8).SAVE :: a(smallsize,smallsize), a3(bigsize,bigsize) -à   REAL(RK8),SAVE :: a(smallsize,smallsize), a3(bigsize,bigsize)

 

  • AOCC 2.1 and AOCL 2.1 Installation:
    • Download “aocc-compiler-2.1.0.tar”  from https://developer.amd.com/amd-aocc/
    • Untar “aocc-compiler-2.1.0.tar.gz” and install aocc-2.1
    • Run “source <path_aocc_compiler_dir>/setenv_AOCC.sh”
    • Download “aocl-linux-aocc-2.1.tar.gz” from https://developer.amd.com/amd-aocl/
    • Untar   aocl-linux-aocc-2.1.tar.gz and install the libraries with “./install.sh” script.
    • AOCL libraries will be installed at “$HOME/amd/aocl” directory by default.

 

  • Export  aocl libraries path : export LD_LIBRARY_PATH=$HOME/amd/ aocl/2.1/amd-blis/lib:/$HOME/ amd/aocl/2.1/amd-libflame/lib

 

  • export LD_LIBRARY_PATH=<path_to_AOCC_2.1_compiler>/aocc-compiler-2.1.0/lib:$LD_LIBRARY_PATH

 

  • compile test_fpu3.f90 using below :
    • flang test_fpu3.f90 -O3 -march=znver2  -ffast-math -funroll-loops -L$HOME/amd/aocl/2.1/amd-blis -lblis -L$HOME/amd/aocl/2.1/amd-libflame/lib -lflame

 

  • Run ./a.out

 

Below is the output:

Benchmark running, hopefully as only ACTIVE task

Test1: Gauss  - 1000 ( 250x 250) inverts in   6.305 seconds  Err=0.000000000000

Test2: Crout  - 1000 ( 250x 250) inverts in   7.484 seconds  Err=0.000000000000

Test3: Crout  -    2 (2000x2000) inverts in   5.077 seconds  Err=0.000000000000

Test4: Lapack -    2 (2000x2000) inverts in   0.966 seconds  Err=0.000000000000

                             Total = 19.8 sec

0 Likes
praveen
Staff

2.>>>>> I get the segmentation fault if goes for /Ofast for TEST_CPU2.f90 (has blas code >>>>inside) https://www.fortran.uk/pb11.zip  why?

2)   plz try this

flang test_fpu2.f90 -Ofast -O3 -march=znver2 -ffast-math -funroll-loops -L/home/amd/amd/aocl/2.1/amd-blis/lib -lblis -L/home/amd/amd/aocl/2.1/amd-libflame/lib -lflame

./a.out
Benchmark running, hopefully as only ACTIVE task
Test1: Gauss - 1000 ( 250x 250) inverts in 6.300 seconds Err=0.000000000000
Test2: Crout - 1000 ( 250x 250) inverts in 7.624 seconds Err=0.000000000000
Test3: Crout - 2 (2000x2000) inverts in 4.859 seconds Err=0.000000000000
Test4: Lapack - 2 (2000x2000) inverts in 3.531 seconds Err=0.000000000002

0 Likes