Skip to content

added #ifdef __cplusplus ... to include files #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions src/include/clProbDist/clProbDist.h
Original file line number Diff line number Diff line change
Expand Up @@ -869,52 +869,52 @@ typedef enum clprobdistStatus_ {
extern "C" {
#endif

/*! @brief Retrieve the last error message.
*
* The buffer containing the error message is internally allocated and must
* not be freed by the client.
*
* @return Error message or `NULL`.
*/
const char* clprobdistGetErrorString();
/*! @brief Retrieve the last error message.
*
* The buffer containing the error message is internally allocated and must
* not be freed by the client.
*
* @return Error message or `NULL`.
*/
const char* clprobdistGetErrorString();

/*! @brief Generate an include option string for use with the OpenCL C compiler
*
* Generate and return "-I${CLPROBDIST_ROOT}/include", where \c ${CLPROBDIST_ROOT} is
* the value of the \c CLPROBDIST_ROOT environment variable.
* This string is meant to be passed as an option to the OpenCL C compiler for
* programs that make use of the clProbDist device-side headers.
* If the \c CLPROBDIST_ROOT environment variable is not defined, it
* defaults to `/usr` if the file
* `/usr/include/clProbDist/clProbDist.h` exists, else to the current
* directory of execution of the program.
*
* A static buffer is return and need not be released; it could change upon
* successive calls to the function.
*
* An error is returned in \c err if the preallocated buffer is too small to
* contain the include string.
*
* @param[out] err Error status variable, or `NULL`.
*
* @return An OpenCL C compiler option to indicate where to find the
* device-side clProbDist headers.
*/
const char* clprobdistGetLibraryDeviceIncludes(cl_int* err);
/*! @brief Generate an include option string for use with the OpenCL C compiler
*
* Generate and return "-I${CLPROBDIST_ROOT}/include", where \c ${CLPROBDIST_ROOT} is
* the value of the \c CLPROBDIST_ROOT environment variable.
* This string is meant to be passed as an option to the OpenCL C compiler for
* programs that make use of the clProbDist device-side headers.
* If the \c CLPROBDIST_ROOT environment variable is not defined, it
* defaults to `/usr` if the file
* `/usr/include/clProbDist/clProbDist.h` exists, else to the current
* directory of execution of the program.
*
* A static buffer is return and need not be released; it could change upon
* successive calls to the function.
*
* An error is returned in \c err if the preallocated buffer is too small to
* contain the include string.
*
* @param[out] err Error status variable, or `NULL`.
*
* @return An OpenCL C compiler option to indicate where to find the
* device-side clProbDist headers.
*/
const char* clprobdistGetLibraryDeviceIncludes(cl_int* err);

/*! @brief Retrieve the library installation path
*
* @return Value of the CLPROBDIST_ROOT environment variable, if
* defined; else, `/usr` if the file
* `/usr/include/clProbDist/clProbDist.h` exists; or, the current
* directory (.) of execution of the program otherwise.
*/
const char* clprobdistGetLibraryRoot();
/*! @brief Retrieve the library installation path
*
* @return Value of the CLPROBDIST_ROOT environment variable, if
* defined; else, `/usr` if the file
* `/usr/include/clProbDist/clProbDist.h` exists; or, the current
* directory (.) of execution of the program otherwise.
*/
const char* clprobdistGetLibraryRoot();

#ifdef __cplusplus
}
#endif

#endif /* CLPROBDIST_H *
* vim: syntax=c.doxygen spell spelllang=en fdm=syntax fdls=0 expandtab
*/
*/
14 changes: 11 additions & 3 deletions src/include/clProbDist/clProbDist_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

#include <clProbDist.h>

#ifdef __cplusplus
extern "C"
{
#endif

/*! @file clProbDist_template.h
* @brief Template of the API for specific probability distributions (not to be included as is!)
Expand Down Expand Up @@ -66,7 +70,7 @@
*
* ### Host and Device APIs
*
* The functions described here are all available on the host, in all implementations,
* The functions described here are all available on the host, in all implementations,
* unless specified otherwise. Only some of the functions and types are also
* available on the device in addition to the host; they are tagged with
* [**device**].
Expand Down Expand Up @@ -245,7 +249,7 @@ cl_double clprobdistStdDeviationWithObject(const clprobdistObject* dist, clprobd
*
* Copy the distribution object @c srcDist located in global memory into the
* buffer @c destDist located in local or private memory.
* This function *does not* allocate memory for the distribution object,
* This function *does not* allocate memory for the distribution object,
* it assumes that this has already been done.
*
* When the distribution API is configured to use distribution objects stored
Expand Down Expand Up @@ -278,7 +282,7 @@ clprobdistStatus clprobdistCopyOverFromGlobal(_CLPROBDIST_<DIST>_OBJ_MEM clprobd
* They take the distribution parameters as their first arguments
* (see the description of \ref DIST_PARAMS in \ref distributions).
* They cannot take advantage of precomputed values for the distributions.
*
*
* @{
*/

Expand Down Expand Up @@ -389,6 +393,10 @@ cl_double clprobdistStdDeviation(DIST_PARAMS, clprobdistStatus* err);

/*! @} */

#ifdef __cplusplus
}
#endif

#endif /* CLPROBDIST_H *
* vim: syntax=c.doxygen spell spelllang=en fdm=syntax fdls=0 expandtab
*/
9 changes: 9 additions & 0 deletions src/include/clProbDist/exponential.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#include "clProbDist/clProbDist.h"
#include "clProbDist/continuous.h"

#ifdef __cplusplus
extern "C"
{
#endif

/*! @brief Exponential distribution object [**device**]
*
* A structure that represents an exponential distribution object.
Expand All @@ -59,6 +64,7 @@ typedef struct _clprobdistExponential clprobdistExponential;
* @param[out] err Error status variable, or \c NULL.
* @return New distribution object.
*/

clprobdistExponential* clprobdistExponentialCreate(cl_double lambda, size_t* bufSize, clprobdistStatus* err);

/*! @copydoc clprobdistDestroy()
Expand Down Expand Up @@ -194,5 +200,8 @@ cl_double clprobdistExponentialStdDeviation(cl_double lambda, clprobdistStatus*

/*! @} */

#ifdef __cplusplus
}
#endif

#endif
9 changes: 9 additions & 0 deletions src/include/clProbDist/gamma.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
#include "clProbDist/clProbDist.h"
#include "clProbDist/continuous.h"

#ifdef __cplusplus
extern "C"
{
#endif

/*! @brief Gamma distribution object [**device**]
*
* A structure that represents a gamma distribution object.
Expand Down Expand Up @@ -252,4 +257,8 @@ cl_double clprobdistGammaComplCDF_1(cl_double alpha, int d, cl_double x, clprobd
*/
cl_double clprobdistGammaInverseCDF_1(cl_double alpha, int d, cl_double u, clprobdistStatus* err);

#ifdef __cplusplus
}
#endif

#endif
9 changes: 8 additions & 1 deletion src/include/clProbDist/lognormal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
#include "clProbDist/clProbDist.h"
#include "clProbDist/continuous.h"

#ifdef __cplusplus
extern "C"
{
#endif

/*! @brief Lognormal distribution object [**device**]
*
* A structure that represents a lognormal distribution object.
Expand Down Expand Up @@ -221,6 +226,8 @@ cl_double clprobdistLognormalStdDeviation(cl_double mu, cl_double sigma, clprobd

/*! @} */


#ifdef __cplusplus
}
#endif

#endif
9 changes: 8 additions & 1 deletion src/include/clProbDist/normal.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#include "clProbDist/clProbDist.h"
#include "clProbDist/continuous.h"

#ifdef __cplusplus
extern "C"
{
#endif

/*! @brief Normal distribution object [**device**]
*
* A structure that represents a normal distribution object.
Expand Down Expand Up @@ -246,6 +251,8 @@ cl_double clprobdistNormalStdDeviation(cl_double mu, cl_double sigma, clprobdist

/*! @} */


#ifdef __cplusplus
}
#endif

#endif
4 changes: 4 additions & 0 deletions src/include/clProbDist/poisson.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
#include "clProbDist/clProbDist.h"
#include <float.h>

#ifdef __cplusplus
extern "C"
{
#endif

/*! @brief Poisson distribution object [**device**]
*
Expand Down
Loading