Lines Matching +full:- +full:std
9 #include <cstdarg> // std::va_list
10 #include <vector> // std:vector
11 #include <unordered_map> // std::take_a_wild_guess
12 #include <algorithm> // std::find
13 #include <iterator> // std::distance, std::next
30 PetscCall(PetscDeviceContextMarkIntentFromID(dctx, id, this->mode, name)); in operator ()()
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()
52 PetscCall(PetscViewerASCIISynchronizedPrintf(vwr, "id %" PetscInt64_FMT " -> {\n", keys[i])); in MarkedObjectMapView()
57 for (std::size_t j = 0; j < ndeps[i]; ++j) { in MarkedObjectMapView()
60 …ata: %p, destroy: %p}\n", j, PetscDeviceTypes[event->dtype], event->dctx_id, event->dctx_state, ev… in MarkedObjectMapView()
61 reinterpret_cast<void *>(event->destroy))); 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()
116 std::vector<int> found_keys; in TestAllCombinations()
117 std::size_t nkeys; in TestAllCombinations()
120 std::size_t *ndeps; in TestAllCombinations()
135 const auto num_expected_keys = std::min(cont.size(), static_cast<std::size_t>(2)); in TestAllCombinations()
137 std::ptrdiff_t key_idx = 0; in TestAllCombinations()
143 key_idx = std::distance(keys, std::find(keys, keys_end, actual_key)); in TestAllCombinations()
146 …PetscCall(CheckMarkedObjectMap(key_idx < std::distance(keys, keys_end), "marked object map could n… in TestAllCombinations()
150 …ndencies[key_idx][0]->dtype == dtype, "unexpected device type on event: %s, expected %s", PetscDev… in TestAllCombinations()
165 …> 0, "Marked Object Map has extra object entry: id %" PetscInt64_FMT, keys[std::distance(found_key… in TestAllCombinations()
181 PETSC_NODISCARD static std::pair<PetscObjectId, std::pair<PetscMemoryAccessMode, std::vector<PetscD… in make_map_entry()
184 id, {mode, {std::forward<T>(dctxs)...}} in make_map_entry()
188 static PetscErrorCode CheckMapEqual(std::unordered_map<PetscObjectId, std::pair<PetscMemoryAccessMo… in CheckMapEqual()
190 std::size_t nkeys; in CheckMapEqual()
193 std::size_t *ndeps; in CheckMapEqual()
211 const auto &expected_mode = found_it->second.first; in CheckMapEqual()
212 const auto &expected_dctxs = found_it->second.second; in CheckMapEqual()
226 …all(CheckMarkedObjectMap(event->dtype == dtype, "unexpected device type on event: %s, expected %s"… in CheckMapEqual()
227 …heckMarkedObjectMap(event->dctx_id == id, "unexpected dctx id on event: %" PetscInt64_FMT ", expec… in CheckMapEqual()
253 …if (container_view) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Container '%s' -> id %" PetscInt64_FM… in main()
266 …PetscCall(PetscOptionsBool("-container_view", "View container names and ID's", nullptr, container_… in main()
281 PetscCall(PetscDeviceContextViewFromOptions(dctx_a, nullptr, "-dctx_a_view")); in main()
282 PetscCall(PetscDeviceContextViewFromOptions(dctx_b, nullptr, "-dctx_b_view")); in main()
283 PetscCall(PetscDeviceContextViewFromOptions(dctx_c, nullptr, "-dctx_c_view")); in main()
304 …const auto test_multiple_readers = [&](std::array<PetscDeviceContext, 2> readers, std::size_t sync… in main()
318 … // synchronizing sync_reader should remove it from the dependency list -- but leave remain_reader in main()
330 // Test that multiple readers can simultaneously read -- even if one of them is synchronized in main()
338 // clang-format off in main()
343 // clang-format on in main()
370 // Test that implicit stream-dependencies are properly tracked in main()
384 …// We have created the chain C -> B -> A, so synchronizing C should trickle down to synchronize and in main()
389 // Test that superfluous stream-dependencies are properly ignored in main()
399 // Test that read->write correctly wipes out the map in main()
441 args: -default_device_type host
445 args: -default_device_type cuda
449 args: -default_device_type hip
453 args: -default_device_type sycl