Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
memory.hpp File Reference
#include "shambase/string.hpp"
#include "shambackends/DeviceBuffer.hpp"
#include "shambackends/sycl.hpp"
#include "shambackends/sycl_utils.hpp"
#include "shambackends/typeAliasVec.hpp"
#include "shambackends/vec.hpp"
#include <fmt/base.h>
+ Include dependency graph for memory.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shamalgs
 namespace to contain everything implemented by shamalgs
 
namespace  shamalgs::memory
 memory manipulation algorithms
 

Functions

template<class T >
shamalgs::memory::extract_element (sycl::queue &q, sycl::buffer< T > &buf, u32 idx)
 extract a value of a buffer
 
template<class T >
shamalgs::memory::extract_element (sham::DeviceQueue &q, sham::DeviceBuffer< T > &buf, u32 idx)
 Extract a value from a DeviceBuffer.
 
template<class T >
void shamalgs::memory::set_element (sycl::queue &q, sycl::buffer< T > &buf, u32 idx, T val, bool discard_write=false)
 
template<class T >
sycl::buffer< T > shamalgs::memory::vec_to_buf (const std::vector< T > &buf)
 Convert a std::vector to a sycl::buffer
 
template<class T >
std::vector< T > shamalgs::memory::buf_to_vec (sycl::buffer< T > &buf, u32 len)
 Convert a sycl::buffer to a std::vector
 
template<class T >
void shamalgs::memory::move_buffer_on_queue (sycl::queue &q, sycl::buffer< T > &buf)
 enqueue a do nothing kernel to force the buffer to move
 
template<class T >
void shamalgs::memory::buf_fill (sycl::queue &q, sycl::buffer< T > &buf, T value)
 Fill a buffer with a given value.
 
template<class T >
void shamalgs::memory::buf_fill_discard (sycl::queue &q, sycl::buffer< T > &buf, T value)
 Fill a buffer with a given value (sycl::no_init mode)
 
template<class T >
void shamalgs::memory::print_buf (sycl::buffer< T > &buf, u32 len, u32 column_count, std::string_view fmt)
 Print the content of a sycl::buffer
 
template<class T >
void shamalgs::memory::copybuf_discard (sycl::queue &q, sycl::buffer< T > &source, sycl::buffer< T > &dest, u32 cnt)
 
template<class T >
void shamalgs::memory::copybuf (sycl::queue &q, sycl::buffer< T > &source, sycl::buffer< T > &dest, u32 cnt)
 
template<class T >
void shamalgs::memory::add_with_factor_to (sycl::queue &q, sycl::buffer< T > &buf, T factor, sycl::buffer< T > &op, u32 cnt)
 
template<class T >
void shamalgs::memory::write_with_offset_into (sycl::queue &q, sycl::buffer< T > &buf_ctn, sycl::buffer< T > &buf_in, u32 offset, u32 element_count)
 
template<class T >
void shamalgs::memory::write_with_offset_into (sham::DeviceQueue &q, sham::DeviceBuffer< T > &buf_ctn, sham::DeviceBuffer< T > &buf_in, u32 offset, u32 element_count)
 Write elements from input buffer to container buffer at an offset (DeviceBuffer variant)
 
template<class T >
void shamalgs::memory::write_with_offset_into (sham::DeviceQueue &q, sycl::buffer< T > &buf_ctn, sham::DeviceBuffer< T > &buf_in, u32 offset, u32 element_count)
 Write elements from DeviceBuffer to sycl::buffer at an offset.
 
template<class T >
void shamalgs::memory::write_with_offset_into (sycl::queue &q, sycl::buffer< T > &buf_ctn, T val, u32 offset, u32 element_count)
 
template<class T >
std::unique_ptr< sycl::buffer< T > > shamalgs::memory::duplicate (sycl::queue &q, const std::unique_ptr< sycl::buffer< T > > &buf_in)
 
template<class T >
sycl::buffer< T > shamalgs::memory::vector_to_buf (sycl::queue &q, std::vector< T > &&vec)
 
template<class T >
sycl::buffer< T > shamalgs::memory::vector_to_buf (sycl::queue &q, std::vector< T > &vec)
 Convert std::vector to sycl::buffer with data copy (lvalue reference version)
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file memory.hpp.