createDeviceArray

createDeviceArray#

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

◆ createDeviceArray()

template<typename T >
T * createDeviceArray ( const stdgpu::index64_t  count,
const T  default_value = T() 
)

Creates a new device 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
Returns
The allocated device array if count > 0, nullptr otherwise
Postcondition
get_dynamic_memory_type(result) == dynamic_memory_type::device if count > 0