LLVM OpenMP 19.0.0git
Public Member Functions | List of all members
SimpleVLA< T, N > Class Template Referencefinal

A simple pure header implementation of VLA that aims to replace uses of actual VLA, which can cause compile warning. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/openmp/runtime/src/kmp_utils.h"

Public Member Functions

 SimpleVLA ()=delete
 
 SimpleVLA (const SimpleVLA &)=delete
 
 SimpleVLA (SimpleVLA &&)=delete
 
SimpleVLAoperator= (const SimpleVLA &)=delete
 
SimpleVLAoperator= (SimpleVLA &&)=delete
 
 SimpleVLA (unsigned NumOfElements) noexcept
 
 ~SimpleVLA ()
 
 operator T* () noexcept
 
 operator const T * () const noexcept
 

Detailed Description

template<typename T, unsigned N = 8>
class SimpleVLA< T, N >

A simple pure header implementation of VLA that aims to replace uses of actual VLA, which can cause compile warning.

This class by default creates a stack buffer that can accomodate N elements. If the number of elements is greater than N, then a heap buffer will be allocated and used to accomodate the elements. Similar to the actual VLA, we don't check boundary (for now), so we will not store the number of elements. We can always revise it later.

Definition at line 26 of file kmp_utils.h.

Constructor & Destructor Documentation

◆ SimpleVLA() [1/4]

template<typename T , unsigned N = 8>
SimpleVLA< T, N >::SimpleVLA ( )
delete

◆ SimpleVLA() [2/4]

template<typename T , unsigned N = 8>
SimpleVLA< T, N >::SimpleVLA ( const SimpleVLA< T, N > &  )
delete

◆ SimpleVLA() [3/4]

template<typename T , unsigned N = 8>
SimpleVLA< T, N >::SimpleVLA ( SimpleVLA< T, N > &&  )
delete

◆ SimpleVLA() [4/4]

template<typename T , unsigned N = 8>
SimpleVLA< T, N >::SimpleVLA ( unsigned  NumOfElements)
inlineexplicitnoexcept

Definition at line 38 of file kmp_utils.h.

References __kmp_allocate, and N.

◆ ~SimpleVLA()

template<typename T , unsigned N = 8>
SimpleVLA< T, N >::~SimpleVLA ( )
inline

Definition at line 46 of file kmp_utils.h.

References __kmp_free.

Member Function Documentation

◆ operator const T *()

template<typename T , unsigned N = 8>
SimpleVLA< T, N >::operator const T * ( ) const
inlinenoexcept

Definition at line 52 of file kmp_utils.h.

◆ operator T*()

template<typename T , unsigned N = 8>
SimpleVLA< T, N >::operator T* ( )
inlinenoexcept

Definition at line 51 of file kmp_utils.h.

◆ operator=() [1/2]

template<typename T , unsigned N = 8>
SimpleVLA & SimpleVLA< T, N >::operator= ( const SimpleVLA< T, N > &  )
delete

◆ operator=() [2/2]

template<typename T , unsigned N = 8>
SimpleVLA & SimpleVLA< T, N >::operator= ( SimpleVLA< T, N > &&  )
delete

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