DPC++ Runtime
Runtime libraries for oneAPI DPC++
_pi_kernel::arguments Struct Reference

Structure that holds the arguments to the kernel. More...

#include <cuda/pi_cuda.hpp>

Collaboration diagram for _pi_kernel::arguments:

Public Types

using args_t = std::array< char, MAX_PARAM_BYTES >
 
using args_size_t = std::vector< size_t >
 
using args_index_t = std::vector< void * >
 
using args_t = std::array< char, MAX_PARAM_BYTES >
 
using args_size_t = std::vector< size_t >
 
using args_index_t = std::vector< void * >
 

Public Member Functions

 arguments ()
 
void add_arg (size_t index, size_t size, const void *arg, size_t localSize=0)
 Adds an argument to the kernel. More...
 
void add_local_arg (size_t index, size_t size)
 
void set_implicit_offset (size_t size, std::uint32_t *implicitOffset)
 
void clear_local_size ()
 
const args_index_tget_indices () const noexcept
 
pi_uint32 get_local_size () const
 
 arguments ()
 
void add_arg (size_t index, size_t size, const void *arg, size_t localSize=0)
 Adds an argument to the kernel. More...
 
void add_local_arg (size_t index, size_t size)
 
void set_implicit_offset (size_t size, std::uint32_t *implicitOffset)
 
void clear_local_size ()
 
args_index_t get_indices () const noexcept
 
pi_uint32 get_local_size () const
 

Public Attributes

args_t storage_
 
args_size_t paramSizes_
 
args_index_t indices_
 
args_size_t offsetPerIndex_
 
std::uint32_t implicitOffsetArgs_ [3] = {0, 0, 0}
 

Static Public Attributes

static constexpr size_t MAX_PARAM_BYTES = 4000u
 

Detailed Description

Structure that holds the arguments to the kernel.

Note earch argument size is known, since it comes from the kernel signature. This is not something can be queried from the CUDA API so there is a hard-coded size (MAX_PARAM_BYTES) and a storage.

Note earch argument size is known, since it comes from the kernel signature. This is not something can be queried from the HIP API so there is a hard-coded size (MAX_PARAM_BYTES) and a storage.

Definition at line 794 of file pi_cuda.hpp.

Member Typedef Documentation

◆ args_index_t [1/2]

using _pi_kernel::arguments::args_index_t = std::vector<void *>

Definition at line 753 of file pi_hip.hpp.

◆ args_index_t [2/2]

using _pi_kernel::arguments::args_index_t = std::vector<void *>

Definition at line 798 of file pi_cuda.hpp.

◆ args_size_t [1/2]

using _pi_kernel::arguments::args_size_t = std::vector<size_t>

Definition at line 752 of file pi_hip.hpp.

◆ args_size_t [2/2]

using _pi_kernel::arguments::args_size_t = std::vector<size_t>

Definition at line 797 of file pi_cuda.hpp.

◆ args_t [1/2]

Definition at line 751 of file pi_hip.hpp.

◆ args_t [2/2]

Definition at line 796 of file pi_cuda.hpp.

Constructor & Destructor Documentation

◆ arguments() [1/2]

_pi_kernel::arguments::arguments ( )
inline

Definition at line 806 of file pi_cuda.hpp.

References implicitOffsetArgs_, and indices_.

◆ arguments() [2/2]

_pi_kernel::arguments::arguments ( )
inline

Definition at line 761 of file pi_hip.hpp.

References implicitOffsetArgs_, and indices_.

Member Function Documentation

◆ add_arg() [1/2]

void _pi_kernel::arguments::add_arg ( size_t  index,
size_t  size,
const void *  arg,
size_t  localSize = 0 
)
inline

Adds an argument to the kernel.

If the argument existed before, it is replaced. Otherwise, it is added. Gaps are filled with empty arguments. Implicit offset argument is kept at the back of the indices collection.

Definition at line 771 of file pi_hip.hpp.

References indices_, cl::sycl::detail::memcpy(), offsetPerIndex_, paramSizes_, and storage_.

◆ add_arg() [2/2]

void _pi_kernel::arguments::add_arg ( size_t  index,
size_t  size,
const void *  arg,
size_t  localSize = 0 
)
inline

Adds an argument to the kernel.

If the argument existed before, it is replaced. Otherwise, it is added. Gaps are filled with empty arguments. Implicit offset argument is kept at the back of the indices collection.

Definition at line 816 of file pi_cuda.hpp.

References indices_, cl::sycl::detail::memcpy(), offsetPerIndex_, paramSizes_, and storage_.

Referenced by add_local_arg(), and _pi_kernel::set_kernel_arg().

◆ add_local_arg() [1/2]

void _pi_kernel::arguments::add_local_arg ( size_t  index,
size_t  size 
)
inline

Definition at line 790 of file pi_hip.hpp.

References add_arg(), and get_local_size().

◆ add_local_arg() [2/2]

void _pi_kernel::arguments::add_local_arg ( size_t  index,
size_t  size 
)
inline

Definition at line 835 of file pi_cuda.hpp.

References add_arg(), and get_local_size().

Referenced by _pi_kernel::set_kernel_local_arg().

◆ clear_local_size() [1/2]

void _pi_kernel::arguments::clear_local_size ( )
inline

Definition at line 815 of file pi_hip.hpp.

References offsetPerIndex_.

◆ clear_local_size() [2/2]

void _pi_kernel::arguments::clear_local_size ( )
inline

Definition at line 860 of file pi_cuda.hpp.

References offsetPerIndex_.

Referenced by _pi_kernel::clear_local_size().

◆ get_indices() [1/2]

args_index_t _pi_kernel::arguments::get_indices ( ) const
inlinenoexcept

Definition at line 819 of file pi_hip.hpp.

References indices_.

◆ get_indices() [2/2]

const args_index_t& _pi_kernel::arguments::get_indices ( ) const
inlinenoexcept

Definition at line 864 of file pi_cuda.hpp.

References indices_.

Referenced by _pi_kernel::get_arg_indices().

◆ get_local_size() [1/2]

pi_uint32 _pi_kernel::arguments::get_local_size ( ) const
inline

Definition at line 821 of file pi_hip.hpp.

References offsetPerIndex_.

◆ get_local_size() [2/2]

pi_uint32 _pi_kernel::arguments::get_local_size ( ) const
inline

Definition at line 866 of file pi_cuda.hpp.

References offsetPerIndex_.

Referenced by add_local_arg(), and _pi_kernel::get_local_size().

◆ set_implicit_offset() [1/2]

void _pi_kernel::arguments::set_implicit_offset ( size_t  size,
std::uint32_t *  implicitOffset 
)
inline

Definition at line 810 of file pi_hip.hpp.

References implicitOffsetArgs_, and cl::sycl::detail::memcpy().

◆ set_implicit_offset() [2/2]

void _pi_kernel::arguments::set_implicit_offset ( size_t  size,
std::uint32_t *  implicitOffset 
)
inline

Definition at line 855 of file pi_cuda.hpp.

References implicitOffsetArgs_, and cl::sycl::detail::memcpy().

Referenced by _pi_kernel::set_implicit_offset_arg().

Member Data Documentation

◆ implicitOffsetArgs_

std::uint32_t _pi_kernel::arguments::implicitOffsetArgs_ = {0, 0, 0}

Definition at line 804 of file pi_cuda.hpp.

Referenced by arguments(), and set_implicit_offset().

◆ indices_

args_index_t _pi_kernel::arguments::indices_

Definition at line 801 of file pi_cuda.hpp.

Referenced by add_arg(), arguments(), get_indices(), and _pi_kernel::get_num_args().

◆ MAX_PARAM_BYTES

static constexpr size_t _pi_kernel::arguments::MAX_PARAM_BYTES = 4000u
staticconstexpr

Definition at line 795 of file pi_cuda.hpp.

◆ offsetPerIndex_

args_size_t _pi_kernel::arguments::offsetPerIndex_

Definition at line 802 of file pi_cuda.hpp.

Referenced by add_arg(), clear_local_size(), and get_local_size().

◆ paramSizes_

args_size_t _pi_kernel::arguments::paramSizes_

Definition at line 800 of file pi_cuda.hpp.

Referenced by add_arg().

◆ storage_

args_t _pi_kernel::arguments::storage_

Definition at line 799 of file pi_cuda.hpp.

Referenced by add_arg().


The documentation for this struct was generated from the following files: