include/ff/stencilReduceOCL.hpp
// 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 &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(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) {
		ff_node::skipfirstpop(true);
		setcode(mapf, reducef);
        setTask(const_cast<T&>(task));
        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 T & task , 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 ( 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 ) { ff_node :: skipfirstpop ( true ) ; setcode ( mapf , reducef ) ; setTask ( const_cast < T & > ( task ) ) ; 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 }
the task is provided in the constructor -- one shot computation
the task is provided in the constructor -- one shot computation