Viskores  1.0
Macros
Configure.h File Reference
#include <cctype>

Go to the source code of this file.

Macros

#define VISKORES_NO_ASSERT_CUDA
 
#define VISKORES_NO_ASSERT_HIP
 
#define VISKORES_USE_64BIT_IDS
 
#define VISKORES_SIZE_LONG   8
 
#define VISKORES_SIZE_LONG_LONG   8
 
#define VISKORES_ALLOCATION_ALIGNMENT   64
 
#define VISKORES_THIRDPARTY_PRE_INCLUDE
 
#define VISKORES_THIRDPARTY_POST_INCLUDE
 
#define VISKORES_VECTORIZATION_PRE_LOOP
 
#define VISKORES_VECTORIZATION_IN_LOOP
 
#define VISKORES_ENABLE_LOGGING
 
#define VISKORES_SWALLOW_SEMICOLON_PRE_BLOCK   do
 
#define VISKORES_SWALLOW_SEMICOLON_POST_BLOCK   while (false)
 
#define VISKORES_PASS_COMMAS(...)   __VA_ARGS__
 
#define VISKORES_EXPAND(expr)   expr
 
#define VISKORES_FALLTHROUGH   ((void)0)
 

Macro Definition Documentation

◆ VISKORES_ALLOCATION_ALIGNMENT

#define VISKORES_ALLOCATION_ALIGNMENT   64

◆ VISKORES_ENABLE_LOGGING

#define VISKORES_ENABLE_LOGGING

◆ VISKORES_EXPAND

#define VISKORES_EXPAND (   expr)    expr

A utility macro to expand the arguments of macro before invoking it in the preprocessor. This is mostly used to handle the __VA_ARGS__ created for variadic preprocessor macros. Often you will have to pass __VA_ARGS__ to another macro to tease out particular parameters. For example, to get the first argument, you might make something like this.

#define GET_FIRST_ARGUMENT(...) GET_FIRST_ARGUMENT_IMPL(__VA_ARGS__, no_arg)
#define GET_FIRST_ARGUMENT_IMPL(first, ...) first

You would expect this pair of macros to give you the first argument or the token no_arg if no arguments were given, and for most compilers that is what you would get. But Visual Studio in particular has a weird interpretation of the standard that causes __VA_ARGS__ to be treated as a single argument when passed to another macro. Consequently, for the example above, Visual Studio actually returns all args passed instead of the first. To get around the problem, you can wrap the entire call to the secondary macro in VISKORES_EXPAND to get Visual Studio (and all other compilers) to properly treat __VA_ARGS__ as separate arguments.

#define GET_FIRST_ARGUMENT(...) VISKORES_EXPAND(GET_FIRST_ARGUMENT_IMPL(__VA_ARGS__, no_arg))
#define GET_FIRST_ARGUMENT_IMPL(first, ...) first

◆ VISKORES_FALLTHROUGH

#define VISKORES_FALLTHROUGH   ((void)0)

◆ VISKORES_NO_ASSERT_CUDA

#define VISKORES_NO_ASSERT_CUDA

◆ VISKORES_NO_ASSERT_HIP

#define VISKORES_NO_ASSERT_HIP

◆ VISKORES_PASS_COMMAS

#define VISKORES_PASS_COMMAS (   ...)    __VA_ARGS__

A trick to pass arguments containing commas through a macro. This is helpful for mixing template code with macros.

See https://stackoverflow.com/questions/13842468

◆ VISKORES_SIZE_LONG

#define VISKORES_SIZE_LONG   8

◆ VISKORES_SIZE_LONG_LONG

#define VISKORES_SIZE_LONG_LONG   8

◆ VISKORES_SWALLOW_SEMICOLON_POST_BLOCK

#define VISKORES_SWALLOW_SEMICOLON_POST_BLOCK   while (false)

◆ VISKORES_SWALLOW_SEMICOLON_PRE_BLOCK

#define VISKORES_SWALLOW_SEMICOLON_PRE_BLOCK   do

◆ VISKORES_THIRDPARTY_POST_INCLUDE

#define VISKORES_THIRDPARTY_POST_INCLUDE

◆ VISKORES_THIRDPARTY_PRE_INCLUDE

#define VISKORES_THIRDPARTY_PRE_INCLUDE

◆ VISKORES_USE_64BIT_IDS

#define VISKORES_USE_64BIT_IDS

◆ VISKORES_VECTORIZATION_IN_LOOP

#define VISKORES_VECTORIZATION_IN_LOOP

◆ VISKORES_VECTORIZATION_PRE_LOOP

#define VISKORES_VECTORIZATION_PRE_LOOP