cuda-kat
CUDA kernel author's tools
Macros | Functions
operations.cuh File Reference

Some basic operations on shared memory (using the library's general computational primitives) More...

#include <kat/on_device/shared_memory/basic.cuh>
#include <kat/on_device/sequence_ops/block.cuh>

Functions

template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::fill (const T &value, shared_memory::size_t length)
 Collaboratively fill the block's dynamic shared memory with a fixed value, up to a certain point. More...
 
template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::fill (const T &value)
 Collaboratively fill the block's dynamic shared memory with a fixed value. More...
 
template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::zero (kat::shared_memory::size_t length)
 Collaboratively zero-out the block's dynamic shared memory , up to a certain point. More...
 
template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::zero ()
 Collaboratively zero-out the block's dynamic shared memory. More...
 
template<typename T >
KAT_FD T *__restrict__ kat::linear_grid::shared_memory::dynamic::set_to_copy_of (const T *source, shared_memory::size_t length)
 Sets the (beginning of the dynamic) shared memory of the block to a copy of some area of device memory. More...
 
template<typename T >
KAT_FD void kat::shared_memory::dynamic::fill (const T &value, shared_memory::size_t length)
 Collaboratively fill the block's dynamic shared memory with a fixed value, up to a certain point. More...
 
template<typename T >
KAT_FD void kat::shared_memory::dynamic::fill (const T &value)
 Collaboratively fill the block's dynamic shared memory with a fixed value. More...
 
template<typename T >
KAT_FD void kat::shared_memory::dynamic::zero (kat::shared_memory::size_t length)
 Collaboratively zero-out the block's dynamic shared memory , up to a certain point. More...
 
template<typename T >
KAT_FD void kat::shared_memory::dynamic::zero ()
 Collaboratively zero-out the block's dynamic shared memory. More...
 
template<typename T >
KAT_FD T *__restrict__ kat::shared_memory::dynamic::set_to_copy_of (const T *source, shared_memory::size_t length)
 Sets the (beginning of the dynamic) shared memory of the block to a copy of some area of device memory. More...
 

Detailed Description

Some basic operations on shared memory (using the library's general computational primitives)

Function Documentation

§ fill() [1/4]

template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::fill ( const T &  value,
shared_memory::size_t  length 
)

Collaboratively fill the block's dynamic shared memory with a fixed value, up to a certain point.

Template Parameters
theelement type which the block's shared memory is presumed to have
Parameters
valueeach element of the block's dynamic shared memory will be set to this value
lengththe number of T elements to set to value

§ fill() [2/4]

template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::fill ( const T &  value)

Collaboratively fill the block's dynamic shared memory with a fixed value.

Template Parameters
theelement type which the block's shared memory is presumed to have
Parameters
valueeach element of the block's dynamic shared memory will be set to this value
Note
This variant of fill() pays a small "penality" for determining the size of the shared memory by itself, since it must access a typically-unused special register for this purpose. If you can, prefer passing a length yourself.

§ fill() [3/4]

template<typename T >
KAT_FD void kat::shared_memory::dynamic::fill ( const T &  value,
shared_memory::size_t  length 
)

Collaboratively fill the block's dynamic shared memory with a fixed value, up to a certain point.

Template Parameters
theelement type which the block's shared memory is presumed to have
Parameters
valueeach element of the block's dynamic shared memory will be set to this value
lengththe number of T elements to set to value
Note
Not implemented yet - need non-linear-grid variants of some of the block primtives.

§ fill() [4/4]

template<typename T >
KAT_FD void kat::shared_memory::dynamic::fill ( const T &  value)

Collaboratively fill the block's dynamic shared memory with a fixed value.

Template Parameters
theelement type which the block's shared memory is presumed to have
Parameters
valueeach element of the block's dynamic shared memory will be set to this value
Note
This variant of fill() pays a small "penality" for determining the size of the shared memory by itself, since it must access a typically-unused special register for this purpose. If you can, prefer passing a length yourself.

§ set_to_copy_of() [1/2]

template<typename T >
KAT_FD T* __restrict__ kat::linear_grid::shared_memory::dynamic::set_to_copy_of ( const T *  source,
shared_memory::size_t  length 
)

Sets the (beginning of the dynamic) shared memory of the block to a copy of some area of device memory.

Parameters
[in]sourceData in global memory (not anywhere else in shared memory! That breaks the
__restrict__
restriction) which we wish to have in shared memory
[in]lengthlength of the area to copy; must be no larger than the available length (in T's) of shared memory
Returns
the beginning of the block's shared memory - which now contains a copy of the data at source.
Note
length is not checked to be valid - it is up to the caller to refrain from trying to copy too much into the shared memory; use

§ set_to_copy_of() [2/2]

template<typename T >
KAT_FD T* __restrict__ kat::shared_memory::dynamic::set_to_copy_of ( const T *  source,
shared_memory::size_t  length 
)

Sets the (beginning of the dynamic) shared memory of the block to a copy of some area of device memory.

Parameters
[in]sourceData in global memory (not anywhere else in shared memory! That breaks the
__restrict__
restriction) which we wish to have in shared memory
[in]lengthlength of the area to copy; must be no larger than the available length (in T's) of shared memory
Returns
the beginning of the block's shared memory - which now contains a copy of the data at source.
Note
length is not checked to be valid - it is up to the caller to refrain from trying to copy too much into the shared memory.
Not implemented yet - need non-linear-grid variants of some of the block primitives.

§ zero() [1/4]

template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::zero ( kat::shared_memory::size_t  length)

Collaboratively zero-out the block's dynamic shared memory , up to a certain point.

Template Parameters
theelement type which the block's shared memory is presumed to have
Parameters
lengththe number of T elements to set to zero

§ zero() [2/4]

template<typename T >
KAT_FD void kat::linear_grid::shared_memory::dynamic::zero ( )

Collaboratively zero-out the block's dynamic shared memory.

Template Parameters
theelement type which the block's shared memory is presumed to have

§ zero() [3/4]

template<typename T >
KAT_FD void kat::shared_memory::dynamic::zero ( kat::shared_memory::size_t  length)

Collaboratively zero-out the block's dynamic shared memory , up to a certain point.

Template Parameters
theelement type which the block's shared memory is presumed to have
Parameters
lengththe number of T elements to set to zero

§ zero() [4/4]

template<typename T >
KAT_FD void kat::shared_memory::dynamic::zero ( )

Collaboratively zero-out the block's dynamic shared memory.

Template Parameters
theelement type which the block's shared memory is presumed to have