1 #ifndef UNIFORM_RANGE_HPP
2 #define UNIFORM_RANGE_HPP
18 dval( (val_max-val_min)/(n-1) )
21 KOKKOS_INLINE_FUNCTION
double get_val(
int i)
const{
26 return (val<=val_max && val>=
val_min);
29 KOKKOS_INLINE_FUNCTION
int get_index(
double val)
const{
34 template<
class Device>
35 View<double*,CLayout,Device>
generate_view(
const std::string& name)
const{
37 auto uniform_range = *
this;
38 View<double*,CLayout,Device> view(
NoInit(name),
n);
40 Kokkos::parallel_for(
"generate_view", Kokkos::RangePolicy<typename Device::execution_space>( 0,
n ), KOKKOS_LAMBDA(
const int i){
41 view(i) = uniform_range.get_val(i);
void parallel_for(const std::string name, int n_ptl, Function func, Option option, HostAoSoA aosoa_h, DeviceAoSoA aosoa_d)
Definition: streamed_parallel_for.hpp:252
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:69