createManagedArray

createManagedArray#

stdgpu: createManagedArray
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ createManagedArray()

template<typename T >
T * createManagedArray ( const stdgpu::index64_t  count,
const T  default_value = T(),
const Initialization  initialize_on = Initialization::DEVICE 
)

Creates a new managed array and initializes (fills) it with the given default value.

Template Parameters
TThe type of the array
Parameters
[in]countThe number of elements of the new array
[in]default_valueA default value, that should be stored in every array entry
[in]initialize_onThe device on which the fill operation is performed
Returns
The allocated managed array if count > 0, nullptr otherwise
Postcondition
get_dynamic_memory_type(result) == dynamic_memory_type::managed if count > 0