Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFit::Detail::CudaInterface::Array< Data_t, Memory_t > Class Template Reference

template<class Data_t, class Memory_t>
class RooFit::Detail::CudaInterface::Array< Data_t, Memory_t >

A templated class for managing an array of data using a specified memory type.

The Array class provides a convenient interface for managing an array of data using different memory types (e.g., memory on the host or device). The memory is automatically freed at the end of the lifetime.

Template Parameters
Data_tThe type of data elements to be stored in the array.
Memory_tThe type of memory that provides storage for the array.

Definition at line 155 of file CudaInterface.h.

Public Member Functions

 Array (std::size_t n)
 Constructor to create an Array object with a specified size.
 
Data_t * data ()
 Get a pointer to the start of the array.
 
Data_t const * data () const
 Get a const pointer to the start of the array.
 
std::size_t size () const
 Get the size of the array.
 

#include <RooFit/Detail/CudaInterface.h>

Inheritance diagram for RooFit::Detail::CudaInterface::Array< Data_t, Memory_t >:
[legend]

Constructor & Destructor Documentation

◆ Array()

template<class Data_t , class Memory_t >
RooFit::Detail::CudaInterface::Array< Data_t, Memory_t >::Array ( std::size_t  n)
inline

Constructor to create an Array object with a specified size.

Parameters
nThe size of the array (number of elements).

Definition at line 161 of file CudaInterface.h.

Member Function Documentation

◆ data() [1/2]

template<class Data_t , class Memory_t >
Data_t * RooFit::Detail::CudaInterface::Array< Data_t, Memory_t >::data ( )
inline

Get a pointer to the start of the array.

Returns
A pointer to the start of the array.

This function returns a pointer to the underlying memory. It allows direct manipulation of array elements.

Definition at line 179 of file CudaInterface.h.

◆ data() [2/2]

template<class Data_t , class Memory_t >
Data_t const * RooFit::Detail::CudaInterface::Array< Data_t, Memory_t >::data ( ) const
inline

Get a const pointer to the start of the array.

Returns
A const pointer to the start of the array.

This function returns a const pointer to the underlying memory. It allows read-only access to array elements.

Definition at line 188 of file CudaInterface.h.

◆ size()

template<class Data_t , class Memory_t >
std::size_t RooFit::Detail::CudaInterface::Array< Data_t, Memory_t >::size ( ) const
inline

Get the size of the array.

Returns
The size of the array (number of elements).

This function returns the number of elements in the array.

Definition at line 170 of file CudaInterface.h.

  • roofit/roofitcuda/inc/RooFit/Detail/CudaInterface.h