cuDDL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cuddl::device_span< T > Struct Template Reference

A span that is assumed to point to device-accessible memory. More...

Inheritance diagram for cuddl::device_span< T >:
[legend]
Collaboration diagram for cuddl::device_span< T >:
[legend]

Public Member Functions

template<typename U >
requires std::is_convertible_v<U (*)[], T (*)[]>
constexpr device_span (device_span< U > other) noexcept
 Implicit widening from device_span<U> where U* converts to T*.
 

Detailed Description

template<typename T>
struct cuddl::device_span< T >

A span that is assumed to point to device-accessible memory.

Host-side API view. Pass its raw pointer and size to CUDA kernels.

The distinct type prevents accidentally mixing host and device pointers at compile time.

Inherits cuda::std::span construction (pointer + size, range, etc.).

Definition at line 20 of file device_span.cuh.

Constructor & Destructor Documentation

◆ device_span()

template<typename T >
template<typename U >
requires std::is_convertible_v<U (*)[], T (*)[]>
constexpr cuddl::device_span< T >::device_span ( device_span< U >  other)
inlineexplicitconstexprnoexcept

Implicit widening from device_span<U> where U* converts to T*.

For example, device_span<int> to device_span<const int>.

Definition at line 30 of file device_span.cuh.

31 : cuda::std::span<T>(other.data(), other.size()) {}

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