# List of pragmas

**URL:** <https://chapel.discourse.group/t/list-of-pragmas/9736>\
**Category:** Users\
**Created:** [January 19, 2022, 11:03am UTC](https://chapel.discourse.group/t/list-of-pragmas/9736 "2022-01-19T11:03:15Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![damianmoz](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/damianmoz/32/319_2.png) [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Post date:** [January 20, 2022, 12:52am UTC](https://chapel.discourse.group/t/list-of-pragmas/9736/5 "2022-01-20T00:52:30Z")

</div>

Hi Michael, Brad - If I am calling C routines, it seems like this pragma is necessary all the time. (BTW, thanks for the reference. I assume you mean the stuff on Page 27. Nice presentation by the way. Looks like GPU stuff is moving ahead in leaps and bounds - nice work)

As an example, consider the computation of the complex projection (of a point in the complex plane onto the surface of a Riemann Sphere) as an attribute of a variable. If I write this naively, it could be:

```chapel
inline proc (complex(?w)).proj : real(w / 2)
{
    extern proc cprojf(z: complex(64)): real(32);
    extern proc cproj(z: complex(128)): real(64);

    return if w == 64 then cprojf(this) else cproj(this);
}

```

Referring to the routine **cproj** () in Math.chpl that does the same function, both those C routines are prefixed by

```chapel
    pragma "fn synchronization free"

```

It seems that I need to put this in front of every simple C routine that I use to tell the Chapel compiler that it is not doing task synchronization. Or am I incorrect?

For completeness, but totally aside from the **pragma** issue ....,

I could avoid C altogether and use current features of Chapel to write (although I have not debugged this)

```chapel
inline proc (complex(?w)).proj 
{
    const z = this;
    const re = z.re, im = z.im;
    type R = re.type, C = z.type;
    param inf = INFINITY:R, zero = 0:R;

    return if abs(re) == inf || abs(im) == inf then
       (inf, if im < zero then +zero else -zero):C
    else
        z;
}

```

In practice, that has IEEE 754 exception issues so I might even use my own ieee754 module which resolves them and avoids that cast seen above.

---

_[View the full topic](https://chapel.discourse.group/t/list-of-pragmas/9736)._
