include/ff/stencilReduceOCL.hpp
// build the program from the mapf and reducef functions
build the program from the mapf and reducef functions
build the program from the mapf and reducef functions
ff_stencilReduceLoopOCL_1D(const std::string &mapf,			              
                               const std::string &reducef = std::string(""),  
                               const Tout &identityVal = Tout(),               
                               ff_oclallocator *allocator = nullptr,
                               const size_t NACCELERATORS = 1, const int width = 1) :
        oneshot(false), saveBinary(false), reuseBinary(false), 
        accelerators(NACCELERATORS), acc_in(NACCELERATORS), acc_out(NACCELERATORS), 
        stencil_width_half(width), offset_dev(0), old_inPtr(NULL), old_outPtr(NULL),
        oldBytesizeIn(0), oldSizeOut(0),  oldSizeReduce(0)  {
		setcode(mapf, reducef);
        for(size_t i = 0; i< NACCELERATORS; ++i)
            accelerators[i]= new accelerator_t(allocator, width,identityVal);
#ifdef FF_OPENCL_LOG
        fprintf(stderr,"[ff_stencilReduceLoopOCL_1D node @%p]\n",this);
        fprintf(stderr,"map-kernel code:\n%s\n", mapf.c_str());
        fprintf(stderr,"reduce-kernel code:\n%s\n", reducef.c_str());
#endif
	}
ff_stencilReduceLoopOCL_1D ( const std :: string & mapf , const std :: string & reducef = std :: string ( " " ) , const Tout & identityVal = Tout ( ) , ff_oclallocator * allocator = nullptr , const size_t NACCELERATORS = 1 , const int width = 1 ) : oneshot ( false ) , saveBinary ( false ) , reuseBinary ( false ) , accelerators ( NACCELERATORS ) , acc_in ( NACCELERATORS ) , acc_out ( NACCELERATORS ) , stencil_width_half ( width ) , offset_dev ( 0 ) , old_inPtr ( NULL ) , old_outPtr ( NULL ) , oldBytesizeIn ( 0 ) , oldSizeOut ( 0 ) , oldSizeReduce ( 0 ) { setcode ( mapf , reducef ) ; for ( size_t i = 0 ; i < NACCELERATORS ; ++ i ) accelerators [ i ] = new accelerator_t ( allocator , width , identityVal ) ; #ifdef FF_OPENCL_LOG fprintf ( stderr , " \n " , this ) ; fprintf ( stderr , " \n \n " , mapf . c_str ( ) ) ; fprintf ( stderr , " \n \n " , reducef . c_str ( ) ) ; #endif }
build the program from the mapf and reducef functions
build the program from the mapf and reducef functions
//OpenCL elemental function  //OpenCL combinator function