|
TECA
The Toolkit for Extreme Climate Analysis
|
some functions helping us manipulate teca_variant_array More...
Functions | |
| void | synchronize_stream () |
| synchronize the default stream. More... | |
| template<typename... array_t> | |
| void | sync_host_access_any (const array_t &... arrays) |
| template<typename TT , typename... PP> | |
| auto | va_static_cast (PP &&... args) |
| template<typename TT , typename... PP> | |
| auto | va_dynamic_cast (PP &&... args) |
| template<typename TT > | |
| void | assert_type () |
| terminates recursion More... | |
| template<typename TT , typename... PP> | |
| void | assert_type (const const_p_teca_variant_array &va, PP &&... args) |
| template<typename TT > | |
| auto | get_host_accessible () |
| terminates recursion More... | |
| template<typename TT , typename... PP> | |
| auto | get_host_accessible (const std::shared_ptr< const TT > &va, PP &&... args) |
| template<typename TT , typename... V> | |
| auto | get_host_accessible (const std::shared_ptr< TT > &va, V &&... args) |
| template<typename TT , typename... PP> | |
| auto | get_host_accessible (const const_p_teca_variant_array &va, PP &&... args) |
| template<typename TT , typename... V> | |
| auto | get_host_accessible (const p_teca_variant_array &va, V &&... args) |
| template<typename TT > | |
| auto | get_cuda_accessible () |
| terminates recursion More... | |
| template<typename TT , typename... PP> | |
| auto | get_cuda_accessible (const const_p_teca_variant_array &va, PP &&... args) |
| template<typename TT , typename... V> | |
| auto | get_cuda_accessible (const p_teca_variant_array &va, V &&... args) |
| template<typename TT , typename... V> | |
| auto | data (V &&... args) |
| template<typename TT > | |
| auto | New (size_t n_elem, teca_variant_array::allocator alloc=teca_variant_array::allocator::malloc) |
| template<typename TT , typename NT = typename TT::element_type> | |
| auto | New (size_t n_elem, NT init_val, teca_variant_array::allocator alloc=teca_variant_array::allocator::malloc) |
some functions helping us manipulate teca_variant_array
| void teca_variant_array_util::assert_type | ( | ) |
terminates recursion
| void teca_variant_array_util::assert_type | ( | const const_p_teca_variant_array & | va, |
| PP &&... | args | ||
| ) |
Check that a number of p_teca_variant_array are teca_variant_array_impl<NT> instances. This will terminate execution if the check fails. Unlike asssert this check is always applied.
| TT | teca_variant_array_impl<NT> |
| PP | a parameter pack |
| va | a p_teca_variant_array instance |
| args | some number of p_teca_variant_array instances. |
| auto teca_variant_array_util::data | ( | V &&... | args | ) |
Calls teca_varaint_array_impl<NT>::data on a number of p_teca_variant_array instances. The instances are first static_cast to teca_variant_array_impl<NT>*. One should only use this method when one is certain that this static_cast is appropriate. See va_assert_type for one way to validate that the types are as expected.
| TT | teca_variant_array_impl<NT> |
| PP | a paramater pack |
| args | any number of p_teca_variant_array instances |
| auto teca_variant_array_util::get_cuda_accessible | ( | ) |
terminates recursion
| auto teca_variant_array_util::get_cuda_accessible | ( | const const_p_teca_variant_array & | va, |
| PP &&... | args | ||
| ) |
Calls teca_varaint_array_impl<NT>::get_cuda_accessible on a number of p_teca_variant_array instances. The instances are first static_cast to teca_variant_array_impl<NT>*. One should only use this method when one is certain that this static_cast is appropriate. See va_assert_type for one way to validate that the types are as expected.
| TT | teca_variant_array_impl<NT> |
| PP | a paramater pack |
| va | a p_teca_variant_array instance |
| args | any number of p_teca_variant_array instances |
| auto teca_variant_array_util::get_cuda_accessible | ( | const p_teca_variant_array & | va, |
| V &&... | args | ||
| ) |
Calls teca_varaint_array_impl<NT>::get_cuda_accessible on a number of p_teca_variant_array instances. The instances are first static_cast to teca_variant_array_impl<NT>*. One should only use this method when one is certain that this static_cast is appropriate. See va_assert_type for one way to validate that the types are as expected.
| TT | teca_variant_array_impl<NT> |
| PP | a paramater pack |
| va | a const_p_teca_variant_array instance |
| args | any number of p_teca_variant_array instances |
| auto teca_variant_array_util::get_host_accessible | ( | ) |
terminates recursion
| auto teca_variant_array_util::get_host_accessible | ( | const const_p_teca_variant_array & | va, |
| PP &&... | args | ||
| ) |
Calls teca_varaint_array_impl<NT>::get_host_accessible on a number of p_teca_variant_array instances. The instances are first static_cast to teca_variant_array_impl<NT>*. One should only use this method when one is certain that this static_cast is appropriate. See va_assert_type for one way to validate that the types are as expected.
| TT | teca_variant_array_impl<NT> |
| PP | a paramater pack |
| va | a p_teca_variant_array instance |
| args | any number of p_teca_variant_array instances |
| auto teca_variant_array_util::get_host_accessible | ( | const p_teca_variant_array & | va, |
| V &&... | args | ||
| ) |
Calls teca_varaint_array_impl<NT>::get_host_accessible on a number of p_teca_variant_array instances. The instances are first static_cast to teca_variant_array_impl<NT>*. One should only use this method when one is certain that this static_cast is appropriate. See va_assert_type for one way to validate that the types are as expected.
| TT | teca_variant_array_impl<NT> |
| PP | a paramater pack |
| va | a const_p_teca_variant_array instance |
| args | any number of p_teca_variant_array instances |
| auto teca_variant_array_util::get_host_accessible | ( | const std::shared_ptr< const TT > & | va, |
| PP &&... | args | ||
| ) |
Calls teca_varaint_array_impl<NT>::get_host_accessible on a number of p_teca_variant_array instances. The instances are first static_cast to teca_variant_array_impl<NT>*. One should only use this method when one is certain that this static_cast is appropriate. See va_assert_type for one way to validate that the types are as expected.
| TT | teca_variant_array_impl<NT> |
| PP | a paramater pack |
| va | a p_teca_variant_array instance |
| args | any number of p_teca_variant_array instances |
| auto teca_variant_array_util::get_host_accessible | ( | const std::shared_ptr< TT > & | va, |
| V &&... | args | ||
| ) |
Calls teca_varaint_array_impl<NT>::get_host_accessible on a number of p_teca_variant_array instances. The instances are first static_cast to teca_variant_array_impl<NT>*. One should only use this method when one is certain that this static_cast is appropriate. See va_assert_type for one way to validate that the types are as expected.
| TT | teca_variant_array_impl<NT> |
| PP | a paramater pack |
| va | a const_p_teca_variant_array instance |
| args | any number of p_teca_variant_array instances |
| auto teca_variant_array_util::New | ( | size_t | n_elem, |
| NT | init_val, | ||
| teca_variant_array::allocator | alloc = teca_variant_array::allocator::malloc |
||
| ) |
Allocates a teca_variant_array_impl<NT> instance and returns the newly allocated array and a pointer to it's memory.
| TT | teca_variant_array_impl<NT> |
| n_elem | the size of the array |
| init_val | a value to initialize the contents of the array to |
| alloc | the allocator to use |
| auto teca_variant_array_util::New | ( | size_t | n_elem, |
| teca_variant_array::allocator | alloc = teca_variant_array::allocator::malloc |
||
| ) |
Allocates a teca_variant_array_impl<NT> instance and returns the newly allocated array and a pointer to it's memory.
| TT | teca_variant_array_impl<NT> |
| n_elem | the size of the array |
| alloc | the allocator to use |
| void teca_variant_array_util::sync_host_access_any | ( | const array_t &... | arrays | ) |
synchronize the default stream once if any of the passed arrays are not accessible on the host. this should be done after all get_host_accessible are issued and before the data is accessed.
|
inline |
synchronize the default stream.
| auto teca_variant_array_util::va_dynamic_cast | ( | PP &&... | args | ) |
dynamic_cast a number of p_teca_variant_array into their derived type teca_variant_array_impl<NT>*. Can be used with p_const_teca_variant_array as well.
| TT | teca_variant_array_impl<NT> |
| PP | a parameter pack |
| args | some number of p_teca_variant_array instances. |
| auto teca_variant_array_util::va_static_cast | ( | PP &&... | args | ) |
static_cast a number of p_teca_variant_array into their derived type teca_variant_array_impl<NT>*. Can be used with p_const_teca_variant_array as well.
| TT | teca_variant_array_impl<NT> |
| PP | a parameter pack |
| args | some number of p_teca_variant_array instances. |