difference between cuda fortran & PGI accelerator

i am using PGI compiler

i am confused that when i should use “CUDA FORTRAN” programming for parallelization & when i should use “PGI accelerator directives” for parallelization

Depends on your project. The PGI Accelerator model is more portable and easier to use while CUDA Fortran gives you more explicit control.

What are goals of your project?

  • Mat

my program is of newton-raphson method for solving non linear equations using iterations.

it contains 1 array which has different values, for each value i want to run my code in parallel

ex. array=[2.2 3.6 4.5 8.4 …]

code takes value from it & use it in solution
so for each value i will get different answer.

so i want parallelization like; i will run my solution for each value in parallel.
& i want all answer(for each different value) in a array.

It’s usually easier to start with the PGI Accelerator model. Directives are easier to use, give you portability with your original host code, and can give you good performance.

However, if your goal here is to better understand how an NVIDIA GPU works, then CUDA Fortran might be the better route. CUDA forces you to think parallel and give you more explicit access to the device.

  • Mat

ok…so in one of my source code i am using both “PGI acclerator directives” & “CUDA FORTRAN” code.but it is showing error

error LNK2019: unresolved external symbol _MAIN referenced in function MAIN

is it possible to use both in a same project.

error LNK2019: unresolved external symbol _MAIN referenced in function MAIN

This error means that you’re missing a main program.

is it possible to use both in a same project.

Yes.