| /petsc/include/petsc/private/cpp/ |
| H A D | type_traits.hpp | 15 using std::add_const_t; 16 using std::add_pointer_t; 17 using std::conditional_t; 18 using std::decay_t; 19 using std::enable_if_t; 20 using std::remove_const_t; 21 using std::remove_cv_t; 22 using std::remove_extent_t; 23 using std::remove_pointer_t; 24 using std::remove_reference_t; [all …]
|
| H A D | utility.hpp | 16 using std::exchange; 17 using std::integer_sequence; 18 using std::make_integer_sequence; 23 T old_value = std::move(orig); 24 orig = std::forward<U>(new_value); 30 static_assert(std::is_integral<T>::value, ""); 34 static constexpr std::size_t size() noexcept { return sizeof...(idx); } 66 template <std::size_t... idx> 67 using index_sequence = integer_sequence<std::size_t, idx...>; 68 template <std::size_t N> [all …]
|
| H A D | memory.hpp | 19 using std::make_unique; 27 using unique_single = std::unique_ptr<T>; 32 using unique_array_unknown_bound = std::unique_ptr<T[]>; 35 template <class T, std::size_t N> 45 return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); 49 inline typename detail::unique_if<T>::unique_array_unknown_bound make_unique(std::size_t n) 51 return std::unique_ptr<T>(new util::remove_extent_t<T>[n]()); 61 using std::destroy_at; 62 using std::construct_at; 65 inline enable_if_t<!std::is_array<T>::value> destroy_at(T *ptr) noexcept(std::is_nothrow_destructib… in destroy_at() [all …]
|
| H A D | array.hpp | 24 struct return_type_helper<void, T...> : std::common_type<T...> { }; 27 using array_return_type = std::array<typename return_type_helper<D, T...>::type, sizeof...(T)>; 29 template <typename T, std::size_t NL, std::size_t... IL, std::size_t NR, std::size_t... IR> 30 …std::array<T, NL + NR> concat_array_impl(const std::array<T, NL> &l, const std::array<T, NR> &r, i… in concat_array_impl() 38 …constexpr detail::array_return_type<D, T...> make_array(T &&...t) noexcept(std::is_nothrow_constru… in make_array() 40 return {std::forward<T>(t)...}; in make_array() 43 template <typename T, std::size_t NL, std::size_t NR> 44 PETSC_NODISCARD inline constexpr auto concat_array(const std::array<T, NL> &l, const std::array<T, …
|
| H A D | functional.hpp | 21 static decltype(std::declval<F>()(std::declval<A>()...), std::true_type()) f(int); 24 static std::false_type f(...); 36 template <std::size_t ix> 38 using type = util::tuple_element_t<ix, std::tuple<Args...>>; 47 template <std::size_t ix> 49 using type = util::tuple_element_t<ix, std::tuple<Args...>>; 57 template <std::size_t ix> 59 using type = util::tuple_element_t<ix, std::tuple<Args...>>; 76 template <std::size_t idx> 86 …PETSC_NODISCARD auto alias(Args &&...args) PETSC_DECLTYPE_NOEXCEPT_AUTO(original(std::forward<Args… [all …]
|
| H A D | unordered_map.hpp | 69 using size_type = std::size_t; 72 using difference_type = std::ptrdiff_t; 75 using khash_int = std::uint32_t; // used as the internal iterator type 76 using flags_type = std::uint32_t; 78 …using flag_bucket_width = std::integral_constant<unsigned long, sizeof(flags_type) * CHAR_BIT>; 79 using flag_pairs_per_bucket = std::integral_constant<unsigned long, flag_bucket_width::value / 2>; 81 …static_assert(std::numeric_limits<flags_type>::is_integer && std::is_unsigned<flags_type>::value, … 121 std::pair<iterator, bool> emplace(Args &&...) noexcept; 123 std::pair<iterator, bool> insert(const value_type &) noexcept; 124 std::pair<iterator, bool> insert(value_type &&) noexcept; [all …]
|
| H A D | tuple.hpp | 15 using std::tuple_element_t; 17 template <std::size_t I, class T> 18 using tuple_element_t = typename std::tuple_element<I, T>::type; 25 template <std::size_t... Idx, typename T, typename F> 29 return (void)expander{((void)f(std::get<Idx>(std::forward<T>(tuple))), 0)...}, std::forward<F>(f); in tuple_for_each() 35 return std::forward<F>(f); in tuple_for_each() 43 using seq = make_index_sequence<std::tuple_size<remove_reference_t<T>>::value>; in tuple_for_each() 44 return detail::tuple_for_each(seq{}, std::forward<T>(tuple), std::forward<F>(f)); in tuple_for_each()
|
| H A D | object_pool.hpp | 20 enum class align_val_t : std::size_t { 27 namespace std namespace 62 using size_type = std::size_t; 64 …using pool_type = std::vector<std::pair<align_type, UnorderedMap<size_type, std::vector<void *>>>… 100 std::unique_ptr<PoolAllocator, PoolUnlocker> pool_{}; 166 PetscCallCXX(it = decltype(it){ptr_stack.erase(std::next(it).base())}); in for_each() 199 PETSC_NODISCARD static void *operator new(size_type, std::align_val_t) noexcept; 200 static void operator delete(void *, std::align_val_t) noexcept; 248 PetscCall(this->underlying().construct_(ptr, std::forward<Args>(args)...)); in construct() 267 PetscCall(underlying.reset_(val, std::forward<Args>(args)...)); in reset() [all …]
|
| H A D | register_finalize.hpp | 22 PetscCall(PetscContainerSetCtxDestroy(contain, std::move(finalizer))); in PetscCxxObjectRegisterFinalize() 83 PetscCall(self.underlying().finalize_(std::forward<Args>(args)...)); in do_finalize_() 95 PetscCall(self.underlying().register_finalize_(std::forward<Args>(args)...)); in do_register_finalize_() 101 PetscCall(PetscCxxObjectRegisterFinalize(const_cast<decayed_type *>(std::addressof(self)))); in do_register_finalize_() 154 PetscCall(do_finalize_(*this, std::forward<Args>(args)...)); in finalize() 163 PetscCall(do_finalize_(*this, std::forward<Args>(args)...)); in finalize() 191 PetscCall(do_register_finalize_(*this, std::forward<Args>(args)...)); in register_finalize() 200 PetscCall(do_register_finalize_(*this, std::forward<Args>(args)...)); in register_finalize()
|
| /petsc/src/sys/tests/ |
| H A D | ex64.cxx | 16 static inline void hash_combine(std::size_t &) noexcept { } in hash_combine() 19 static inline void hash_combine(std::size_t &seed, const T &v, Rest &&...rest) noexcept in hash_combine() 21 std::hash<T> hasher; in hash_combine() 23 hash_combine(seed, std::forward<Rest>(rest)...); in hash_combine() 27 namespace std \ 31 std::size_t operator()(const type &t) const noexcept \ 33 std::size_t ret = 0; \ 40 using pair_type = std::pair<int, double>; 54 …bool operator<(const Foo &other) const noexcept { return std::tie(x, y) < std::tie(other.x, other.… in operator <() 56 PetscErrorCode to_string(std::string &buf) const noexcept in to_string() [all …]
|
| H A D | ex45.cxx | 18 std::cout << Tpetra::version() << std::endl << std::endl; in exampleRoutine() 28 using std::cout; in main() 29 using std::endl; in main()
|
| H A D | ex46.cxx | 19 std::cout << Tpetra::version() << std::endl << std::endl; in exampleRoutine() 29 using std::cout; in main() 30 using std::endl; in main()
|
| /petsc/src/mat/tests/ |
| H A D | ex231.cxx | 61 std::vector<std::vector<std::vector<PetscInt>>> elem_dof_indices(size); in main() 63 std::string line; in main() 64 std::ifstream dof_file(file[proc_id]); in main() 66 while (std::getline(dof_file, line)) { in main() 67 std::vector<PetscInt> dof_indices; in main() 68 std::stringstream sstream(line); in main() 69 std::string token; in main() 70 while (std::getline(sstream, token, ' ')) dof_indices.push_back(std::atoi(token.c_str())); in main() 88 std::vector<std::set<unsigned int>> sparsity(n_dofs); in main() 91 std::vector<PetscInt> &dof_indices = elem_dof_indices[proc_id][k]; in main() [all …]
|
| /petsc/include/ |
| H A D | petsccxxcomplexfix.h | 53 …std::integral_constant<bool, (std::is_same<Cmplex, PetscComplex>::value && std::is_arithmetic<Atyp… 55 || std::is_same<Atype, __fp16>::value 58 || std::is_same<Atype, __float128>::value 64 inline typename std::enable_if<petsccomplex_extended_type<Cmplex, Atype>::value, Cmplex>::type oper… 70 inline typename std::enable_if<petsccomplex_extended_type<Cmplex, Atype>::value, Cmplex>::type oper… 76 inline typename std::enable_if<petsccomplex_extended_type<Cmplex, Atype>::value, Cmplex>::type oper… 82 inline typename std::enable_if<petsccomplex_extended_type<Cmplex, Atype>::value, Cmplex>::type oper… 88 inline typename std::enable_if<petsccomplex_extended_type<Cmplex, Atype>::value, Cmplex>::type oper… 94 inline typename std::enable_if<petsccomplex_extended_type<Cmplex, Atype>::value, Cmplex>::type oper… 100 inline typename std::enable_if<petsccomplex_extended_type<Cmplex, Atype>::value, Cmplex>::type oper… [all …]
|
| /petsc/src/ksp/ksp/tests/ |
| H A D | ex63.cxx | 95 RCP<Teuchos::FancyOStream> fos = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout)); in main() 97 *fos << Amesos2::version() << std::endl << std::endl; in main() 105 std::string solver_name; in main() 106 std::string filedir; in main() 107 std::string filename; in main() 119 …os::CommandLineProcessor::PARSE_SUCCESSFUL) std::cerr << "Options unknown to Trilinos in command l… in main() 123 std::cerr << solver_name << " not enabled. Exiting..." << std::endl; in main() 134 std::string mat_pathname = filedir + filename; in main() 140 *fos << std::endl << A->description() << std::endl << std::endl; in main() 161 } catch (std::invalid_argument e) { in main() [all …]
|
| /petsc/src/ksp/pc/impls/amgx/ |
| H A D | amgx.cxx | 59 static const std::map<std::string, AmgXAMGMethod> AMGMethods; 60 static const std::map<std::string, AmgXSmoother> Smoothers; 61 static const std::map<std::string, AmgXSelector> Selectors; 62 static const std::map<std::string, AmgXCoarseSolver> CoarseSolvers; 63 static const std::map<std::string, AmgXAMGCycle> AMGCycles; 66 const std::map<std::string, AmgXAMGMethod> AmgXControlMap::AMGMethods = { 71 const std::map<std::string, AmgXSmoother> AmgXControlMap::Smoothers = { 87 const std::map<std::string, AmgXSelector> AmgXControlMap::Selectors = { 96 const std::map<std::string, AmgXCoarseSolver> AmgXControlMap::CoarseSolvers = { 101 const std::map<std::string, AmgXAMGCycle> AmgXControlMap::AMGCycles = { [all …]
|
| /petsc/src/snes/tutorials/ |
| H A D | build.zig | 3 const std = @import("std"); 5 pub fn build(b: *std.build.Builder) void { 18 const PETSC_DIR = std.os.getenv("PETSC_DIR") orelse unreachable; 19 const PETSC_ARCH = std.os.getenv("PETSC_ARCH") orelse unreachable; 20 … var path = std.fs.path.join(std.heap.c_allocator, &[_][] const u8 { PETSC_DIR,PETSC_ARCH,"lib"}); 21 …if (path) |value| {exe.addLibPath(value);} else |_| {std.debug.print("Error bad path: {s}\n", .{p… 24 path = std.fs.path.join(std.heap.c_allocator, &[_][] const u8 { PETSC_DIR,"include"}); 26 … path = std.fs.path.join(std.heap.c_allocator, &[_][] const u8 { PETSC_DIR,PETSC_ARCH,"include"});
|
| /petsc/include/petsc/private/ |
| H A D | cupminterface.hpp | 27 static constexpr std::array<const char *const, 5> DeviceTypes = { 111 return std::get<util::to_underlying(T)>(DeviceTypes); in cupmName() 274 …udaError_t cupmLaunchKernel(FunctionT &&func, dim3 gridDim, dim3 blockDim, std::size_t sharedMem, … in PETSC_CUPM_ALIAS_FUNCTION() 276 …static_assert(!std::is_pointer<FunctionT>::value, "kernel function must not be passed by pointer"); in PETSC_CUPM_ALIAS_FUNCTION() 277 void *args[] = {(void *)std::addressof(kernelArgs)...}; in PETSC_CUPM_ALIAS_FUNCTION() 279 …il::remove_reference_t<FunctionT>>(std::addressof(func), std::move(gridDim), std::move(blockDim), … in PETSC_CUPM_ALIAS_FUNCTION() 430 …hipError_t cupmLaunchKernel(FunctionT &&func, dim3 gridDim, dim3 blockDim, std::size_t sharedMem, … 432 void *args[] = {(void *)std::addressof(kernelArgs)...}; 434 …return hipLaunchKernel((void *)func, std::move(gridDim), std::move(blockDim), args, sharedMem, std… 630 …static PetscErrorCode PetscCUPMMallocAsync(M **ptr, std::size_t n, cupmStream_t stream = nullptr) … in PetscCUPMMallocAsync() [all …]
|
| /petsc/src/sys/objects/device/impls/ |
| H A D | impldevicebase.hpp | 49 …ode PetscOptionDeviceAll(MPI_Comm, std::pair<PetscDeviceInitType, PetscBool> &, std::pair<PetscInt… 53 …ptionDeviceBasic(PetscOptionItems, std::pair<PetscDeviceInitType, PetscBool> &, std::pair<PetscInt… 136 auto buf = std::array<char, 128>{}; in PetscOptionDevice() 141 const auto len = std::strlen(optstub) + std::strlen(implname); in PetscOptionDevice() 146 PetscCall(OptionsFunction(PetscOptionsObject, buf.data(), std::forward<T>(args)...)); in PetscOptionDevice() 155 …PetscCall(PetscOptionDevice(PetscOptionsEList_Private, PetscOptionsObject, "-device_enable_", std:… in PetscOptionDeviceInitialize() 175 …PetscCall(PetscOptionDevice(PetscOptionsInt_Private, PetscOptionsObject, "-device_select_", std::f… in PetscOptionDeviceSelect() 192 …PetscCall(PetscOptionDevice(PetscOptionsBool_Private, PetscOptionsObject, "-device_view_", std::fo… in PetscOptionDeviceView() 205 …onItems PetscOptionsObject, std::pair<PetscDeviceInitType, PetscBool> &initType, std::pair<PetscIn… in PetscOptionDeviceBasic() 215 …ionDeviceAll(MPI_Comm comm, std::pair<PetscDeviceInitType, PetscBool> &initType, std::pair<PetscIn… in PetscOptionDeviceAll() [all …]
|
| H A D | segmentedmempool.hpp | 38 return static_cast<const T &>(*this).record_event_(std::forward<E>(event)); in record_event() 44 return static_cast<const T &>(*this).wait_for_(std::forward<E>(event)); in wait_for_event() 51 using default_stream_type = std::nullptr_t; 98 using size_type = std::size_t; 165 …std::move(other.event_)), open_(util::exchange(other.open_, false)), stream_id_(util::exchange(oth… in MemoryChunk() 174 event_ = std::move(other.event_); in operator =() 178 start_ = std::move(other.start_); in operator =() 308 using chunk_list_type = std::vector<chunk_type>; 313 ~MemoryBlock() noexcept(std::is_nothrow_destructible<chunk_list_type>::value); 375 MemoryBlock<T, A, S>::~MemoryBlock() noexcept(std::is_nothrow_destructible<chunk_list_type>::value) in ~MemoryBlock() [all …]
|
| /petsc/src/dm/impls/moab/tests/ |
| H A D | ex1.cxx | 53 std::cout << "Created DMMoab using DMMoabCreateMoab." << std::endl; in CreateMesh() 60 std::cout << "Read mesh from file " << user->filename << std::endl; in CreateMesh() 72 std::cout << "Created structured 5x5x5 mesh." << std::endl; in CreateMesh() 86 std::cout << "Creating tag with name: " << user->tagname << ";\n"; in CreateMesh() 91 std::vector<double> tag_vals(range.size()); in CreateMesh() 131 std::cout << "Created VecMoab from existing tag." << std::endl; in main() 133 std::cout << "Destroyed VecMoab." << std::endl; in main() 135 std::cout << "Destroyed DMMoab." << std::endl; in main()
|
| /petsc/src/sys/objects/device/tests/ |
| H A D | ex11.cxx | 40 …ObjectMapView(PetscViewer vwr, std::size_t nkeys, const PetscObjectId *keys, const PetscMemoryAcce… in MarkedObjectMapView() 51 for (std::size_t i = 0; i < nkeys; ++i) { in MarkedObjectMapView() 57 for (std::size_t j = 0; j < ndeps[i]; ++j) { in MarkedObjectMapView() 74 …comm, PetscDeviceContext dctx, std::size_t nkeys, const PetscObjectId *keys, const PetscMemoryAcce… in CheckMarkedObjectMap_Private() 78 std::array<char, 2048> buf; in CheckMarkedObjectMap_Private() 79 std::va_list argp; in CheckMarkedObjectMap_Private() 80 std::size_t len; in CheckMarkedObjectMap_Private() 97 static PetscErrorCode TestAllCombinations(PetscDeviceContext dctx, const std::vector<PetscContainer… in TestAllCombinations() 99 std::vector<PetscObjectId> cont_ids; in TestAllCombinations() 115 for (auto it = cont.cbegin(), next = std::next(it); it != cont.cend(); ++it, ++next) { in TestAllCombinations() [all …]
|
| /petsc/src/sys/objects/device/interface/ |
| H A D | mark_dcontext.cxx | 137 std::string file{}; 138 std::string function{}; 147 PETSC_NODISCARD std::string to_string() const noexcept in to_string() 149 std::string ret; in to_string() 151 ret = '(' + function + "() at " + file + ':' + std::to_string(line) + ')'; in to_string() 156 static std::string split_on_petsc_path_(std::string &&in) noexcept in split_on_petsc_path_() 160 if (pos == std::string::npos) pos = in.find("petsc/include"); in split_on_petsc_path_() 161 if (pos == std::string::npos) pos = 0; in split_on_petsc_path_() 165 friend std::ostream &operator<<(std::ostream &os, const PetscStackFrame &frame) in operator <<() 173 using std::swap; in swap() [all …]
|
| H A D | petscdevice_interface_internal.hpp | 45 using weak_ptr_type = std::weak_ptr<_p_PetscDeviceContext>; 51 using std::swap; in swap() 71 …explicit _n_WeakContext(const std::shared_ptr<_p_PetscDeviceContext> &ptr) noexcept : weak_dctx_{p… in _n_WeakContext() 80 using upstream_type = std::unordered_map<PetscObjectId, _n_WeakContext>; 82 using marked_type = std::unordered_set<PetscObjectId>; 84 using marked_type = std::vector<PetscObjectId>; 86 using shared_ptr_type = std::shared_ptr<_p_PetscDeviceContext>; 104 …PETSC_NODISCARD std::pair<bool, typename marked_type::iterator> get_marked_(PetscObjectId id) noex… in get_marked_() 107 auto it = std::lower_bound(this->marked_objects().begin(), end, id); in get_marked_() 179 …ns_Internal(PetscOptionItems PetscOptionsObject, std::pair<PetscDeviceType, PetscBool> &deviceType… in PetscDeviceContextQueryOptions_Internal()
|
| H A D | memory.cxx | 35 PETSC_NODISCARD std::size_t operator()(const T *ptr) const noexcept in operator ()() 37 return reinterpret_cast<std::size_t>(ptr); in operator ()() 50 std::size_t size = 0; // size of allocation (bytes) 55 constexpr PointerAttributes(PetscMemType, PetscObjectId, std::size_t) noexcept; 66 inline constexpr PointerAttributes::PointerAttributes(PetscMemType mtype_, PetscObjectId id_, std::… in PointerAttributes() 166 it = std::find_if(map.begin(), end_it, [ptr](map_type::const_iterator::reference map_it) { in search_for() 190 …RegisterMemory_Private(const void *PETSC_RESTRICT ptr, PetscMemType mtype, std::size_t size, Petsc… in PetscDeviceRegisterMemory_Private() 214 std::piecewise_construct, in PetscDeviceRegisterMemory_Private() 215 std::forward_as_tuple(const_cast<MemoryMap::map_type::key_type>(ptr)), in PetscDeviceRegisterMemory_Private() 216 std::forward_as_tuple(mtype, newid, size) in PetscDeviceRegisterMemory_Private() [all …]
|