Skip to content

Commit

Permalink
Document that initialisation can fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Jul 15, 2020
1 parent a2bd734 commit 02deaaa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/c-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ Context
you must not pass values between them. They have the same C type,
so this is an easy mistake to make.
After you have created a context object, you must immediately call
:c:func:`futhark_context_get_error`, which will return non-``NULL``
if initialisation failed. If initialisation has failed, then you
still need to call :c:func:`futhark_context_free` to release
resources used for the context object, but you may not use the
context object for anything else.
.. c:function:: void futhark_context_free(struct futhark_context *ctx)
Free the context object. It must not be used again. The
Expand Down

0 comments on commit 02deaaa

Please sign in to comment.