Extended CUDA Library (ecuda)  2.0
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Namespaces | Macros
global.hpp File Reference
#include <stdexcept>
#include <sstream>
#include "impl/host_emulation.hpp"
#include "cuda_error.hpp"

Go to the source code of this file.

Namespaces

 ecuda
 

Macros

#define ECUDA_GLOBAL_HPP
 
#define ECUDA_SUPPRESS_HD_WARNINGS
 
#define CUDA_CALL(x)   x
 
#define S(x)   #x
 
#define S_(x)   S(x)
 
#define S__LINE__   S_(__LINE__)
 
#define EXCEPTION_MSG(x)   "" __FILE__ ":" S__LINE__ " " x
 
#define CUDA_CHECK_ERRORS()   do {} while(0);
 
#define CUDA_CALL_KERNEL_AND_WAIT(...)
 
#define nullptr   NULL
 
#define __NOEXCEPT__
 
#define __CONSTEXPR__
 
#define __HOST__
 
#define __DEVICE__
 
#define __CONSTANT__
 
#define ECUDA_STATIC_ASSERT(x, msg)   if(ecuda::impl::static_assertion<static_cast<bool>(x)>::msg) {}
 

Macro Definition Documentation

#define __CONSTANT__

Definition at line 152 of file global.hpp.

#define __CONSTEXPR__

Definition at line 141 of file global.hpp.

#define __DEVICE__

Definition at line 151 of file global.hpp.

#define __HOST__

Definition at line 150 of file global.hpp.

#define __NOEXCEPT__

Allow noexcept and constexpr if C++11 supported.

Definition at line 140 of file global.hpp.

#define CUDA_CALL (   x)    x

Macro function that captures a CUDA error code and then does something with it. All calls to functions in the CUDA API that return an error code should use this.

Definition at line 83 of file global.hpp.

#define CUDA_CALL_KERNEL_AND_WAIT (   ...)
Value:
do {\
__VA_ARGS__;\
} while( 0 );

Macro that calls a CUDA kernel function, waits for completion, and throws an ecuda::cuda_error exception if any errors are reported by cudaGetLastError().

Definition at line 118 of file global.hpp.

#define CUDA_CHECK_ERRORS ( )    do {} while(0);

Macro that performs a check for any outstanding CUDA errors. This macro should be declared after any CUDA API calls that do not return an error code (e.g. after calling kernel functions). Calling this when a CUDA API call has not been made is safe.

Definition at line 103 of file global.hpp.

#define ECUDA_GLOBAL_HPP

Definition at line 40 of file global.hpp.

#define ECUDA_STATIC_ASSERT (   x,
  msg 
)    if(ecuda::impl::static_assertion<static_cast<bool>(x)>::msg) {}

Definition at line 191 of file global.hpp.

#define ECUDA_SUPPRESS_HD_WARNINGS

Definition at line 58 of file global.hpp.

#define EXCEPTION_MSG (   x)    "" __FILE__ ":" S__LINE__ " " x

String wrapper that adds the source file and line to a given error message.

Definition at line 92 of file global.hpp.

#define nullptr   NULL

Replace nullptr with NULL if nvcc still doesn't support C++11.

Definition at line 125 of file global.hpp.

#define S (   x)    #x

Definition at line 86 of file global.hpp.

#define S_ (   x)    S(x)

Definition at line 87 of file global.hpp.

#define S__LINE__   S_(__LINE__)

Definition at line 88 of file global.hpp.