#ifndef __AMSMATHUTIL25_BUFFEROPS_HPP__
#define __AMSMATHUTIL25_BUFFEROPS_HPP__

namespace ams
{
    typedef int64_t buffer_size_t;

    //threaded set - sets N elements of bufffer to val
    template<typename T> int buffer_set(T* buffer, buffer_size_t N, const T val);

    //threaded set - sets N elements of bufffer to val
    template<typename T> int buffer_set(T* buffer, buffer_size_t indstart, buffer_size_t indstop, const T val);

    //threaded set - sets N elements of bufffer to val
    template<typename T> int buffer_set_unthreaded(T* buffer, buffer_size_t N, const T val);

    //threaded set - sets N elements of bufffer to val
    template<typename T> int buffer_set_unthreaded(T* buffer, buffer_size_t indstart, buffer_size_t indstop, const T val);

    //threaded copy of bufferfrom[offsetfrom + I] to bufferto[offsetto+I] I = [0,N)
    template<typename T1, typename T2> int buffer_cast_copy(T1* bufferto, const T2* bufferfrom, 
        buffer_size_t offsetto, buffer_size_t offsetfrom, buffer_size_t N);

    //threaded copy of bufferfrom to bufferto
    template<typename T1, typename T2> int buffer_cast_copy(T1* bufferto, const T2* bufferfrom, buffer_size_t N);

    //threaded copy of bufferfrom[offsetfrom + I] to bufferto[offsetto+I] I = [0,N)
    template<typename T1, typename T2> int buffer_cast_copy_unthreaded(T1* bufferto, const T2* bufferfrom, 
        buffer_size_t offsetto, buffer_size_t offsetfrom, buffer_size_t N);

    //threaded copy of bufferfrom to bufferto
    template<typename T1, typename T2> int buffer_cast_copy_unthreaded(T1* bufferto, const T2* bufferfrom, buffer_size_t N);

}; //end namespace ams

#include <amsmathutil25/util/amsmathutil25_bufferops_impl.hpp>

#endif

