xpu
host.h File Reference

Host API. More...

Go to the source code of this file.

Classes

class  xpu::exception
 
struct  xpu::settings
 Settings used to initialize xpu. More...
 
class  xpu::device
 
class  xpu::device_prop
 
class  xpu::queue
 command queue for a device. More...
 
class  xpu::h_view< T >
 Create a view from a buffer. Create a view from a buffer to access the underlying data on the host. The view is a lightweight wrapper around the buffer and does not own the data. If the underlying buffer can't be accessed on the host, an runtime_error is thrown. Note that no synchronization with the device is performed, so the data may be out of date. More...
 
class  xpu::ptr_prop
 Properties of a pointer. Properties of a pointer allocated with malloc_device, malloc_host or malloc_shared. More...
 
class  xpu::buffer_prop
 
class  xpu::kernel_timings
 Execution times collected for a kernel. More...
 
class  xpu::timings
 Timing information collected via xpu::push_timer and xpu::pop_timer. More...
 
class  xpu::scoped_timer
 RAII wrapper for timing functions. More...
 

Namespaces

 xpu
 xpu default namespace.
 

Enumerations

enum  xpu::direction { xpu::h2d = detail::dir_h2d , xpu::d2h = detail::dir_d2h }
 
enum class  xpu::mem_type { xpu::pinned = detail::mem_pinned , xpu::device = detail::mem_device , xpu::managed = detail::mem_managed , xpu::host = detail::mem_host }
 

Functions

void xpu::initialize (settings={})
 Initialize xpu. More...
 
template<typename I >
void xpu::preload ()
 Preload the given device image. More...
 
void * xpu::malloc_device (size_t size_bytes)
 Allocate memory on the device. More...
 
void * xpu::malloc_pinned (size_t size_bytes)
 Allocate pinned memory on the host that can be accessed by the device. More...
 
template<typename T >
T * xpu::malloc_host (size_t elems)
 Allocate pinned memory on the host that can be accessed by the device. More...
 
void * xpu::malloc_managed (size_t size_bytes)
 Allocate memory that can be accessed by the device and the host. More...
 
void xpu::free (void *)
 Free memory allocated with malloc_device, malloc_pinned or malloc_managed. More...
 
void xpu::stack_alloc (size_t size)
 Allocate the stack memory on the device. More...
 
void xpu::stack_pop (void *head=nullptr)
 Pop entries from the stack. More...
 
template<typename Kernel >
const char * xpu::get_name ()
 
template<typename Func , typename... Args>
void xpu::call (Args &&... args)
 
template<typename C >
void xpu::set (const typename C::data_t &symbol)
 
void xpu::push_timer (std::string_view name)
 
timings xpu::pop_timer ()
 
void xpu::t_add_bytes (size_t bytes)
 
template<typename Kernel >
void xpu::k_add_bytes (size_t bytes)
 

Detailed Description

Host API.

This file contains the host API of xpu.

Include as #include <xpu/host.h>.