Proto  3.2
Namespaces | Macros
Proto_Forall.H File Reference
#include "Proto_MemType.H"
#include "Proto_Point.H"
#include "Proto_Box.H"
#include "Proto_BoxData.H"
Include dependency graph for Proto_Forall.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Proto
 

Macros

#define _PROTO_FORALL_H_
 

Functions

Pointwise Operators

The suite of forall functions facilitate writing functions that operate pointwise on BoxData. To this end, the user must write a function with one of the following structures:

PROTO_KERNEL_START
void F_temp(Var<T,C,MEMTYPE,D,E>&, Args...)
{ ... }
PROTO_KERNEL_END(F_temp, F)
// OR
PROTO_KERNEL_START
void F_p_temp(Point&, Var<T,C,MEMTYPE,D,E>&, Args...)
{ ... }
PROTO_KERNEL_END(F_p_temp, F_p)
  • PROTO_KERNEL_START and PROTO_KERNEL_END are required for cross-platform code.
  • The "#_temp" symbols are temporaries; the actual function symbol is the one without "_temp"
  • The template arguments of the first Var argument must match the output BoxData
  • The Point argument in the second signature corresponds to the Point of function application
  • Args... may include any number of Var& or read-only scalars (including Point or Box).
  • The elements of Args... may have arbitrary tensor structure and const-ness
  • non-const objects in Args... have input-output semantics
  • The order and template arguments of the Vars in Args... must match the BoxData inputs of forall
  • If F is a member function of a class F MUST BE DECLARED STATIC
  • F or F_p may be an anonymous (lambda) function defined using the PROTO_LAMBDA macro

Refer to the following code snippet for some sample valid forall input functions:

template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs>
BoxData< T, C, MEMTYPE, D, E > Proto::forall (const Func &a_F, Srcs &&... a_srcs)
 Pointwise Operator. More...
 
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs>
BoxData< T, C, MEMTYPE, D, E > Proto::forallOp (unsigned long long int a_num_flops_point, const char *a_timername, const Func &a_F, Srcs &&... a_srcs)
 Pointwise Operator (Instrumented) More...
 
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs>
BoxData< T, C, MEMTYPE, D, E > Proto::forall (const Func &a_F, Box a_box, Srcs &&... a_srcs)
 Pointwise Operator (Explicit Range Box) More...
 
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs>
BoxData< T, C, MEMTYPE, D, E > Proto::forallOp (unsigned long long int a_num_flops_point, const char *a_timername, const Func &a_F, Box a_box, Srcs &&... a_srcs)
 Pointwise Operator (Explicit Range Box, Instrumented) More...
 
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs>
BoxData< T, C, MEMTYPE, D, E > Proto::forall_p (const Func &a_F, Srcs &&... a_srcs)
 Pointwise Operator (Pointwise Dependence) More...
 
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs>
BoxData< T, C, MEMTYPE, D, E > Proto::forall_p (const Func &a_F, Box a_box, Srcs &&... a_srcs)
 Pointwise Operator (Pointwise Dependence, Explicit Range Box) More...
 
template<typename Func , typename... Srcs>
void Proto::forallInPlace (const Func &a_F, Srcs &&... a_srcs)
 In-Place Pointwise Operator. More...
 
template<typename Func , typename... Srcs>
void Proto::forallInPlace (const Func &a_F, Box a_box, Srcs &&... a_srcs)
 In-Place Pointwise Operator (Explicit Range Box) More...
 
template<typename Func , typename... Srcs>
void Proto::forallInPlace_p (const Func &a_F, Srcs &&... a_srcs)
 In-Place Pointwise Operator (Pointwise Dependence) More...
 
template<typename Func , typename... Srcs>
void Proto::forallInPlace_p (const Func &a_F, Box a_box, Srcs &&... a_srcs)
 In-Place Pointwise Operator (Pointwise Dependence, Explicit Box Range) More...
 

Macro Definition Documentation

◆ _PROTO_FORALL_H_

#define _PROTO_FORALL_H_