|
| 1 | +#include "lue/framework/algorithm/operator.hpp" |
| 2 | +#include "lue/framework/algorithm/value_policies/add.hpp" |
| 3 | +#include "lue/framework/algorithm/value_policies/divide.hpp" |
| 4 | +#include "lue/framework/algorithm/value_policies/subtract.hpp" |
| 5 | +#include "lue/framework/algorithm/value_policies/uniform.hpp" |
| 6 | +#include "lue/framework/core/component.hpp" |
| 7 | +#include <hpx/hpx_init.hpp> |
| 8 | + |
| 9 | + |
| 10 | +auto hpx_main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int |
| 11 | +{ |
| 12 | + using namespace lue::value_policies; |
| 13 | + |
| 14 | + using Element = float; |
| 15 | + lue::Rank const rank{2}; |
| 16 | + using Array = lue::PartitionedArray<Element, rank>; |
| 17 | + using Shape = lue::ShapeT<Array>; |
| 18 | + |
| 19 | + Shape const array_shape{40000, 40000}; |
| 20 | + Shape const partition_shape{2000, 2000}; |
| 21 | + Element const min{0}; |
| 22 | + Element const max{1}; |
| 23 | + |
| 24 | + auto const near_infrared = uniform(array_shape, partition_shape, min, max); |
| 25 | + auto const red = uniform(array_shape, partition_shape, min, max); |
| 26 | + auto const ndvi = (near_infrared - red) / (near_infrared + red); |
| 27 | + |
| 28 | + int hpx_status = hpx::finalize(); |
| 29 | + |
| 30 | + return hpx_status; |
| 31 | +} |
| 32 | + |
| 33 | + |
| 34 | +auto main(int argc, char* argv[]) -> int |
| 35 | +{ |
| 36 | + std::vector<std::string> const cfg{}; |
| 37 | + |
| 38 | + hpx::init_params params{}; |
| 39 | + params.cfg = {cfg}; |
| 40 | + |
| 41 | + return hpx::init(argc, argv, params); |
| 42 | +} |
0 commit comments