OpenACC: Difference between revisions

Jump to navigation Jump to search
(Tabs and file format for easy download)
Line 25: Line 25:
<tabs>
<tabs>
<tab name="C">
<tab name="C">
The following example computes an approximation of Pi:
The following example computes an approximation of the transcendental number pi, using the well-known but slowly convergent formula arctan series expansion,
{{File
{{File
   |name=pi.c
   |name=pi.c
Line 32: Line 32:
#include <stdio.h>
#include <stdio.h>


#define N 2000000000
const long long N=2000000000;
#define vl 512
const int vl=512;


int main(void) {
int main(int argc,char** argv) {
   double pi = 0.0f;
   double pi = 0.0f;
   long long i;
   long long i;
Bureaucrats, cc_docs_admin, cc_staff
2,314

edits

Navigation menu