include/ff/stencilReduceOCL.hpp
ff_stencilReduceLoopOCL_1D(const T &task, 
                               const std::string &kernels_source,            // OpenCL source code path
                               const std::string &mapf_name,           // name of the map kernel function
                               const std::string &reducef_name,        // name of the reduce kernel function
                               const Tout &identityVal = Tout(),
                               ff_oclallocator *allocator = nullptr,
                               const size_t NACCELERATORS = 1, const int width = 1) :
        oneshot(true), 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)  {
		setsourcecode(kernels_source, mapf_name, reducef_name);
        setTask(const_cast<T&>(task));
        for(size_t i = 0; i< NACCELERATORS; ++i)
            accelerators[i]= new accelerator_t(allocator, width, identityVal, true);
	}
// the task is provided in the constructor -- one shot computation
the task is provided in the constructor -- one shot computation
the task is provided in the constructor -- one shot computation
ff_stencilReduceLoopOCL_1D(const T &task, 
                               const std::string &kernels_source,            
                               const std::string &mapf_name,           
                               const std::string &reducef_name,        
                               const Tout &identityVal = Tout(),
                               ff_oclallocator *allocator = nullptr,
                               const size_t NACCELERATORS = 1, const int width = 1) :
        oneshot(true), 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)  {
		setsourcecode(kernels_source, mapf_name, reducef_name);
        setTask(const_cast<T&>(task));
        for(size_t i = 0; i< NACCELERATORS; ++i)
            accelerators[i]= new accelerator_t(allocator, width, identityVal, true);
	}
ff_stencilReduceLoopOCL_1D ( const T & task , const std :: string & kernels_source , const std :: string & mapf_name , const std :: string & reducef_name , const Tout & identityVal = Tout ( ) , ff_oclallocator * allocator = nullptr , const size_t NACCELERATORS = 1 , const int width = 1 ) : oneshot ( true ) , 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 ) { setsourcecode ( kernels_source , mapf_name , reducef_name ) ; setTask ( const_cast < T & > ( task ) ) ; for ( size_t i = 0 ; i < NACCELERATORS ; ++ i ) accelerators [ i ] = new accelerator_t ( allocator , width , identityVal , true ) ; }
the task is provided in the constructor -- one shot computation
the task is provided in the constructor -- one shot computation
// OpenCL source code path // name of the map kernel function // name of the reduce kernel function