Difference between revisions of "Programming/OpenACC"
From HPC
(Created page with "==Introduction to openACC== ===Example openACC C/C++ code=== <pre> #pragma acc kernels { for (int i=0; i<N; i++) { x[i] = 1.0; y[i] = 2.0; } for (int i=0;...") |
(No difference)
|
Revision as of 14:41, 24 October 2018
Introduction to openACC
Example openACC C/C++ code
#pragma acc kernels
{
for (int i=0; i<N; i++)
{
x[i] = 1.0;
y[i] = 2.0;
}
for (int i=0; i<N; i++)
{
y[i] = a * x[i] + y[i];
}
}
Example openACC Fortran code
!$acc kernels
do i=1,N
x(i) = 1.0
y(i) = 2.0
end do
y(:) = a*x(:) + y(:)
!$acc end kernels