GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
clRNG.h
Go to the documentation of this file.
1 
2  /*
3  ***********************************************************************
4  Copyright (c) 2015 Advanced Micro Devices, Inc.
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without
8  modification, are permitted provided that the following conditions
9  are met:
10 
11  1. Redistributions of source code must retain the above copyright
12  notice, this list of conditions and the following disclaimer.
13 
14  2. Redistributions in binary form must reproduce the above copyright
15  notice, this list of conditions and the following disclaimer in the
16  documentation and/or other materials provided with the distribution.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30  ***********************************************************************
31  */
32 
299 #pragma once
300 #ifndef CLRNG_H
301 #define CLRNG_H
302 
303 #if defined(__APPLE__) || defined(__MACOSX)
304 #include <OpenCL/cl.h>
305 #else
306 #include <CL/cl.h>
307 #endif
308 
311 #ifdef CLRNG_SINGLE_PRECISION
312  #define _CLRNG_FPTYPE cl_float
313 #else
314  #define _CLRNG_FPTYPE cl_double
315 #endif
316 #define _CLRNG_TAG_FPTYPE(name) _CLRNG_TAG_FPTYPE_(name,_CLRNG_FPTYPE)
317 #define _CLRNG_TAG_FPTYPE_(name,fptype) _CLRNG_TAG_FPTYPE__(name,fptype)
318 #define _CLRNG_TAG_FPTYPE__(name,fptype) name##_##fptype
319 
323 #if defined( _WIN32 )
324  #define CLRNGAPI __declspec( dllexport )
325 #else
326  #define CLRNGAPI
327 #endif
328 
329 
342 typedef enum clrngStatus_ {
343  CLRNG_SUCCESS = CL_SUCCESS,
344  CLRNG_OUT_OF_RESOURCES = CL_OUT_OF_RESOURCES,
345  CLRNG_INVALID_VALUE = CL_INVALID_VALUE,
346  /* ... */
351 } clrngStatus;
352 
353 
354 #ifdef __cplusplus
355 extern "C" {
356 #endif
357 
365 CLRNGAPI const char* clrngGetErrorString();
366 
388 CLRNGAPI const char* clrngGetLibraryDeviceIncludes(cl_int* err);
389 
396 CLRNGAPI const char* clrngGetLibraryRoot();
397 
398 #ifdef __cplusplus
399 }
400 #endif
401 
402 #endif /* CLRNG_H */
403 
404 /*
405  * vim: syntax=c.doxygen spell spelllang=en fdm=syntax fdls=0
406  */
enum clrngStatus_ clrngStatus
Error codes.
CLRNGAPI const char * clrngGetLibraryDeviceIncludes(cl_int *err)
Generate an include option string for use with the OpenCL C compiler.
Definition: clRNG.c:87
Definition: clRNG.h:343
Definition: clRNG.h:349
clrngStatus_
Error codes.
Definition: clRNG.h:342
Definition: clRNG.h:350
Definition: clRNG.h:345
Definition: clRNG.h:347
Definition: clRNG.h:344
#define CLRNGAPI
Definition: clRNG.h:326
CLRNGAPI const char * clrngGetErrorString()
Retrieve the last error message.
Definition: clRNG.c:53
CLRNGAPI const char * clrngGetLibraryRoot()
Retrieve the library installation path.
Definition: clRNG.c:63
Definition: clRNG.h:348