async_cuda

The contents of this module can be included with the header hpx/modules/async_cuda.hpp. These headers may be used by user-code but are not guaranteed stable (neither header location nor contents). You are using these at your own risk. If you wish to use non-public functionality from a module we strongly suggest only including the module header hpx/modules/async_cuda.hpp, not the particular header in which the functionality you would like to use is defined. See Public API for a list of names that are part of the public HPX API.

namespace hpx
namespace cuda
namespace experimental
struct cuda_event_pool

Public Functions

cuda_event_pool()
~cuda_event_pool()
bool pop(cudaEvent_t &event)
bool push(cudaEvent_t event)

Public Static Functions

static cuda_event_pool &get_event_pool()

Public Static Attributes

constexpr int initial_events_in_pool = 128

Private Functions

void add_event_to_pool()

Private Members

boost::lockfree::stack<cudaEvent_t, boost::lockfree::fixed_sized<false>> free_list_
namespace hpx
namespace cuda
namespace experimental

Functions

void check_cuda_error(cudaError_t err)
struct cuda_exception : public exception

Public Functions

cuda_exception(const std::string &msg, cudaError_t err)
cudaError_t get_cuda_errorcode()

Protected Attributes

cudaError_t err_
namespace hpx
namespace cuda
namespace experimental
struct cuda_executor : public hpx::cuda::experimental::cuda_executor_base

Public Functions

cuda_executor(std::size_t device, bool event_mode = true)
~cuda_executor()
template<typename F, typename ...Ts>
decltype(auto) post(F &&f, Ts&&... ts)
template<typename F, typename ...Ts>
decltype(auto) async_execute(F &&f, Ts&&... ts)

Protected Functions

template<typename R, typename ...Params, typename ...Args>
void apply(R (*cuda_function)(Params...), Args&&... args, )
template<typename R, typename ...Params, typename ...Args>
hpx::future<void> async(R (*cuda_kernel)(Params...), Args&&... args, )
struct cuda_executor_base

Subclassed by hpx::cuda::experimental::cuda_executor

Public Types

using future_type = hpx::future<void>

Public Functions

cuda_executor_base(std::size_t device, bool event_mode)
future_type get_future()

Protected Attributes

int device_
bool event_mode_
cudaStream_t stream_
std::shared_ptr<hpx::cuda::experimental::target> target_
namespace hpx
namespace cuda
namespace experimental

Typedefs

using event_mode = std::true_type
using callback_mode = std::false_type
namespace hpx
namespace cuda
namespace experimental
struct enable_user_polling

Public Functions

enable_user_polling(std::string const &pool_name = "")
~enable_user_polling()

Private Members

std::string pool_name_
namespace hpx
namespace cuda
namespace experimental

Functions

std::vector<target> get_local_targets()
void print_local_targets()
namespace hpx
namespace compute
namespace cuda

Typedefs

using instead = hpx::cuda::experimental::target
namespace cuda
namespace experimental

Functions

target &get_default_target()
struct target

Public Functions

target()
target(int device)
target(target const &rhs)
target(target &&rhs)
target &operator=(target const &rhs)
target &operator=(target &&rhs)
native_handle_type &native_handle()
native_handle_type const &native_handle() const
void synchronize() const
hpx::future<void> get_future_with_event() const
hpx::future<void> get_future_with_callback() const
template<typename Allocator>
hpx::future<void> get_future_with_event(Allocator const &alloc) const
template<typename Allocator>
hpx::future<void> get_future_with_callback(Allocator const &alloc) const

Public Static Functions

static std::vector<target> get_local_targets()

Private Members

native_handle_type handle_

Friends

bool operator==(target const &lhs, target const &rhs)
struct native_handle_type

Public Types

typedef hpx::lcos::local::spinlock mutex_type

Public Functions

native_handle_type(int device = 0)
~native_handle_type()
native_handle_type(native_handle_type const &rhs)
native_handle_type(native_handle_type &&rhs)
native_handle_type &operator=(native_handle_type const &rhs)
native_handle_type &operator=(native_handle_type &&rhs)
cudaStream_t get_stream() const
int get_device() const
std::size_t processing_units() const
std::size_t processor_family() const
std::string processor_name() const
void reset()

Private Functions

void init_processing_units()

Private Members

mutex_type mtx_
int device_
std::size_t processing_units_
std::size_t processor_family_
std::string processor_name_
cudaStream_t stream_

Friends

friend hpx::cuda::experimental::target
namespace hpx
namespace cuda
namespace experimental

Variables

hpx::cuda::experimental::transform_stream_t transform_stream
struct transform_stream_t : public hpx::functional::detail::tag_fallback<transform_stream_t>

Friends

template<typename S, typename F, typename = std::enable_if_t<!std::is_same<std::decay_t<F>, cudaStream_t>::value>>
friend constexpr auto tag_fallback_invoke(transform_stream_t, S &&s, F &&f, cudaStream_t stream = {})
template<typename F>
friend constexpr auto tag_fallback_invoke(transform_stream_t, F &&f, cudaStream_t stream = {})