|
template<typename DerivedPolicy , typename ForwardIterator , typename T > |
__host__ __device__ void | thrust::fill (const thrust::detail::execution_policy_base< DerivedPolicy > &exec, ForwardIterator first, ForwardIterator last, const T &value) |
|
template<typename ForwardIterator , typename T > |
__host__ __device__ void | thrust::fill (ForwardIterator first, ForwardIterator last, const T &value) |
|
template<typename DerivedPolicy , typename OutputIterator , typename Size , typename T > |
__host__ __device__ OutputIterator | thrust::fill_n (const thrust::detail::execution_policy_base< DerivedPolicy > &exec, OutputIterator first, Size n, const T &value) |
|
template<typename OutputIterator , typename Size , typename T > |
__host__ __device__ OutputIterator | thrust::fill_n (OutputIterator first, Size n, const T &value) |
|
template<typename DerivedPolicy , typename ForwardIterator , typename T > |
__host__ __device__ void | thrust::uninitialized_fill (const thrust::detail::execution_policy_base< DerivedPolicy > &exec, ForwardIterator first, ForwardIterator last, const T &x) |
|
template<typename ForwardIterator , typename T > |
void | thrust::uninitialized_fill (ForwardIterator first, ForwardIterator last, const T &x) |
|
template<typename DerivedPolicy , typename ForwardIterator , typename Size , typename T > |
__host__ __device__ ForwardIterator | thrust::uninitialized_fill_n (const thrust::detail::execution_policy_base< DerivedPolicy > &exec, ForwardIterator first, Size n, const T &x) |
|
template<typename ForwardIterator , typename Size , typename T > |
ForwardIterator | thrust::uninitialized_fill_n (ForwardIterator first, Size n, const T &x) |
|
template<typename DerivedPolicy , typename ForwardIterator , typename T >
__host__ __device__ void thrust::fill |
( |
const thrust::detail::execution_policy_base< DerivedPolicy > & |
exec, |
|
|
ForwardIterator |
first, |
|
|
ForwardIterator |
last, |
|
|
const T & |
value |
|
) |
| |
fill
assigns the value value
to every element in the range [first, last)
. That is, for every iterator i
in [first, last)
, it performs the assignment *i = value
.
The algorithm's execution is parallelized as determined by exec
.
- Parameters
-
exec | The execution policy to use for parallelization. |
first | The beginning of the sequence. |
last | The end of the sequence. |
value | The value to be copied. |
- Template Parameters
-
DerivedPolicy | The name of the derived execution policy. |
ForwardIterator | is a model of Forward Iterator, and ForwardIterator is mutable. |
T | is a model of Assignable, and T's value_type is convertible to ForwardIterator's value_type . |
The following code snippet demonstrates how to use fill
to set a thrust::device_vector's elements to a given value using the thrust::device
execution policy for parallelization:
...
thrust::device_vector<int> v(4);
- See Also
- http://www.sgi.com/tech/stl/fill.html
-
fill_n
-
uninitialized_fill
template<typename ForwardIterator , typename T >
__host__ __device__ void thrust::fill |
( |
ForwardIterator |
first, |
|
|
ForwardIterator |
last, |
|
|
const T & |
value |
|
) |
| |
fill
assigns the value value
to every element in the range [first, last)
. That is, for every iterator i
in [first, last)
, it performs the assignment *i = value
.
- Parameters
-
first | The beginning of the sequence. |
last | The end of the sequence. |
value | The value to be copied. |
- Template Parameters
-
ForwardIterator | is a model of Forward Iterator, and ForwardIterator is mutable. |
T | is a model of Assignable, and T's value_type is convertible to ForwardIterator's value_type . |
The following code snippet demonstrates how to use fill
to set a thrust::device_vector's elements to a given value.
...
thrust::device_vector<int> v(4);
- See Also
- http://www.sgi.com/tech/stl/fill.html
-
fill_n
-
uninitialized_fill
template<typename DerivedPolicy , typename OutputIterator , typename Size , typename T >
__host__ __device__ OutputIterator thrust::fill_n |
( |
const thrust::detail::execution_policy_base< DerivedPolicy > & |
exec, |
|
|
OutputIterator |
first, |
|
|
Size |
n, |
|
|
const T & |
value |
|
) |
| |
fill_n
assigns the value value
to every element in the range [first, first+n)
. That is, for every iterator i
in [first, first+n)
, it performs the assignment *i = value
.
The algorithm's execution is parallelized as determined by exec
.
- Parameters
-
exec | The execution policy to use for parallelization. |
first | The beginning of the sequence. |
n | The size of the sequence. |
value | The value to be copied. |
- Returns
first + n
- Template Parameters
-
DerivedPolicy | The name of the derived execution policy. |
OutputIterator | is a model of Output Iterator. |
T | is a model of Assignable, and T's value_type is convertible to a type in OutputIterator's set of value_type . |
The following code snippet demonstrates how to use fill
to set a thrust::device_vector's elements to a given value using the thrust::device
execution policy for parallelization:
...
thrust::device_vector<int> v(4);
- See Also
- http://www.sgi.com/tech/stl/fill_n.html
-
fill
-
uninitialized_fill_n
template<typename OutputIterator , typename Size , typename T >
__host__ __device__ OutputIterator thrust::fill_n |
( |
OutputIterator |
first, |
|
|
Size |
n, |
|
|
const T & |
value |
|
) |
| |
fill_n
assigns the value value
to every element in the range [first, first+n)
. That is, for every iterator i
in [first, first+n)
, it performs the assignment *i = value
.
- Parameters
-
first | The beginning of the sequence. |
n | The size of the sequence. |
value | The value to be copied. |
- Returns
first + n
- Template Parameters
-
OutputIterator | is a model of Output Iterator. |
T | is a model of Assignable, and T's value_type is convertible to a type in OutputIterator's set of value_type . |
The following code snippet demonstrates how to use fill
to set a thrust::device_vector's elements to a given value.
...
thrust::device_vector<int> v(4);
- See Also
- http://www.sgi.com/tech/stl/fill_n.html
-
fill
-
uninitialized_fill_n
template<typename DerivedPolicy , typename ForwardIterator , typename T >
__host__ __device__ void thrust::uninitialized_fill |
( |
const thrust::detail::execution_policy_base< DerivedPolicy > & |
exec, |
|
|
ForwardIterator |
first, |
|
|
ForwardIterator |
last, |
|
|
const T & |
x |
|
) |
| |
In thrust
, the function thrust::device_new
allocates memory for an object and then creates an object at that location by calling a constructor. Occasionally, however, it is useful to separate those two operations. If each iterator in the range [first, last)
points to unitialized memory, then unitialized_fill
creates copies of x
in that range. That is, for each iterator i
in the range [first, last)
, uninitialized_fill
creates a copy of x
in the location pointed to i
by calling ForwardIterator's
value_type's
copy constructor.
The algorithm's execution is parallelized as determined by exec
.
- Parameters
-
exec | The execution policy to use for parallelization. |
first | The first element of the range of interest. |
last | The last element of the range of interest. |
x | The value to use as the exemplar of the copy constructor. |
- Template Parameters
-
DerivedPolicy | The name of the derived execution policy. |
ForwardIterator | is a model of Forward Iterator, ForwardIterator is mutable, and ForwardIterator's value_type has a constructor that takes a single argument of type T . |
The following code snippet demonstrates how to use uninitialized_fill
to initialize a range of uninitialized memory using the thrust::device
execution policy for parallelization:
struct Int
{
__host__ __device__
Int(int x) : val(x) {}
int val;
};
...
const int N = 137;
Int val(46);
- See Also
- http://www.sgi.com/tech/stl/uninitialized_fill.html
-
uninitialized_fill_n
-
fill
-
uninitialized_copy
-
device_new
-
device_malloc
template<typename ForwardIterator , typename T >
void thrust::uninitialized_fill |
( |
ForwardIterator |
first, |
|
|
ForwardIterator |
last, |
|
|
const T & |
x |
|
) |
| |
In thrust
, the function thrust::device_new
allocates memory for an object and then creates an object at that location by calling a constructor. Occasionally, however, it is useful to separate those two operations. If each iterator in the range [first, last)
points to unitialized memory, then unitialized_fill
creates copies of x
in that range. That is, for each iterator i
in the range [first, last)
, uninitialized_fill
creates a copy of x
in the location pointed to i
by calling ForwardIterator's
value_type's
copy constructor.
- Parameters
-
first | The first element of the range of interest. |
last | The last element of the range of interest. |
x | The value to use as the exemplar of the copy constructor. |
- Template Parameters
-
ForwardIterator | is a model of Forward Iterator, ForwardIterator is mutable, and ForwardIterator's value_type has a constructor that takes a single argument of type T . |
The following code snippet demonstrates how to use uninitialized_fill
to initialize a range of uninitialized memory.
struct Int
{
__host__ __device__
Int(int x) : val(x) {}
int val;
};
...
const int N = 137;
Int val(46);
- See Also
- http://www.sgi.com/tech/stl/uninitialized_fill.html
-
uninitialized_fill_n
-
fill
-
uninitialized_copy
-
device_new
-
device_malloc
template<typename DerivedPolicy , typename ForwardIterator , typename Size , typename T >
__host__ __device__ ForwardIterator thrust::uninitialized_fill_n |
( |
const thrust::detail::execution_policy_base< DerivedPolicy > & |
exec, |
|
|
ForwardIterator |
first, |
|
|
Size |
n, |
|
|
const T & |
x |
|
) |
| |
In thrust
, the function thrust::device_new
allocates memory for an object and then creates an object at that location by calling a constructor. Occasionally, however, it is useful to separate those two operations. If each iterator in the range [first, first+n)
points to unitialized memory, then unitialized_fill
creates copies of x
in that range. That is, for each iterator i
in the range [first, first+n)
, uninitialized_fill
creates a copy of x
in the location pointed to i
by calling ForwardIterator's
value_type's
copy constructor.
The algorithm's execution is parallelized as determined by exec
.
- Parameters
-
exec | The execution policy to use for parallelization. |
first | The first element of the range of interest. |
n | The size of the range of interest. |
x | The value to use as the exemplar of the copy constructor. |
- Returns
first+n
- Template Parameters
-
DerivedPolicy | The name of the derived execution policy. |
ForwardIterator | is a model of Forward Iterator, ForwardIterator is mutable, and ForwardIterator's value_type has a constructor that takes a single argument of type T . |
The following code snippet demonstrates how to use uninitialized_fill
to initialize a range of uninitialized memory using the thrust::device
execution policy for parallelization:
struct Int
{
__host__ __device__
Int(int x) : val(x) {}
int val;
};
...
const int N = 137;
Int val(46);
- See Also
- http://www.sgi.com/tech/stl/uninitialized_fill.html
-
uninitialized_fill
-
fill
-
uninitialized_copy_n
-
device_new
-
device_malloc
template<typename ForwardIterator , typename Size , typename T >
ForwardIterator thrust::uninitialized_fill_n |
( |
ForwardIterator |
first, |
|
|
Size |
n, |
|
|
const T & |
x |
|
) |
| |
In thrust
, the function thrust::device_new
allocates memory for an object and then creates an object at that location by calling a constructor. Occasionally, however, it is useful to separate those two operations. If each iterator in the range [first, first+n)
points to unitialized memory, then unitialized_fill
creates copies of x
in that range. That is, for each iterator i
in the range [first, first+n)
, uninitialized_fill
creates a copy of x
in the location pointed to i
by calling ForwardIterator's
value_type's
copy constructor.
- Parameters
-
first | The first element of the range of interest. |
n | The size of the range of interest. |
x | The value to use as the exemplar of the copy constructor. |
- Returns
first+n
- Template Parameters
-
ForwardIterator | is a model of Forward Iterator, ForwardIterator is mutable, and ForwardIterator's value_type has a constructor that takes a single argument of type T . |
The following code snippet demonstrates how to use uninitialized_fill
to initialize a range of uninitialized memory.
struct Int
{
__host__ __device__
Int(int x) : val(x) {}
int val;
};
...
const int N = 137;
Int val(46);
- See Also
- http://www.sgi.com/tech/stl/uninitialized_fill.html
-
uninitialized_fill
-
fill
-
uninitialized_copy_n
-
device_new
-
device_malloc