Compile-Time Compression and Resource Generation with C++20
that take a user-suppiled lambda to generate the data needed to render our desired compile-time resource! These are e�ectively templated functions, but we will use the cleaner auto parameter syntax for0 码力 | 59 页 | 1.86 MB | 5 月前3Back to Basics: Exceptions
Write Exception-Safe Code 53 class Widget { private: int i{ 0 }; std::string s{}; Resource* pr{}; // May be nullptr public: // … // … }; 1 2 3 4 5 6 7 8 9 10 11 12 s{}; Resource* pr{}; // May be nullptr public: // … // Copy constructor Widget( Widget const& w ) : i { w.i } , s { w.s } { if( w.pr ) pr = new Resource( *w.pr s{}; Resource* pr{}; // May be nullptr public: // … // Copy constructor Widget( Widget const& w ) : i { w.i } , s { w.s } { if( w.pr ) pr = new Resource( *w.pr0 码力 | 111 页 | 4.87 MB | 5 月前3Back to Basics: Smart Pointers
automatically manage the lifetime of its resource. ▪ Smart Pointers ▪ Allocate und deallocate their resource in the constructor and destructor according to the RAII idiom (Resource Acquisition Is Initialization) ▪ Release the resource if the smart pointer goes out of scope ▪ Are available in four versions raii.cppOverview Name C++ Standard Description std::auto_ptr C++98 ▪ Owns the resource exclusively ▪ „Moves“ its resource during a copy operation std::unique_ptr C++11 ▪ Owns the resource exclusively ▪ Can not be copied ▪ Deals with non-copy objects std::shared_ptr C++11 ▪ Shares a resource ▪ Supports0 码力 | 30 页 | 625.43 KB | 5 月前3Data Structures That Make Video Games Go Round
Environment Variables. ● Error Handler. ● Job system. ● Resource Registry. ● Reads boot data. ● Listens to kernel message pump.Resource Registry Games are constructed with a wide variety of resources meshes, materials, sounds, animations and many more. The resource registry acts as a place to store, manage and manipulate those resources. Resource Registry Renderer Physics System AI Audio compressed_textures behavior_trees audioResource Registry Resource Registry Level is streamed in Resource bundle / pack is unloaded resource_registry.get(“baz/bar/foo.wav”) resource_registry.get (“D271A15B- D4B 0 码力 | 196 页 | 3.03 MB | 5 月前3Delivering safe C++
+ community There is no C/C++ language. Write contemporary C++ An opportunityComplete type-and-resource safety • Is an ideal (aim) of C++ • From very early on (1979) • But “being careful” doesn’t scale achieving that can be found in A brief introduction to C++'s model for type- and resource-safety (2015) and Type-and-resource safety in modern C++ (2021). • No limitations of what can be expressed • Compared October 2023 7Type-and-resource safety • Every object is accessed according to the type with which it was defined (type safety) • Every object is properly constructed and destroyed (resource safety) • Every0 码力 | 74 页 | 2.72 MB | 5 月前3Back to Basics: Designing Classes (part 1 of 2)
Readability Design for Change and Extension Design for Testability Implementation Guidelines Resource Management Back to Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Readability Design for Change and Extension Design for Testability Implementation Guidelines Resource Management Back to Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Readability Design for Change and Extension Design for Testability Implementation Guidelines Resource Management Back to Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization0 码力 | 87 页 | 5.64 MB | 5 月前3Bringing Existing Code to CUDA Using constexpr and std::pmr
C++17: • std::pmr::memory_resource • std::pmr::polymorphic_allocator • std::pmr::vector • std::pmr::monotonic_buffer_resource • … std::pmr 16 |// gpu unified_memory_resource mem; std::pmr::vectorstd::pmr::vector y(N, &mem); // … Memory Allocation 17 |struct unified_memory_resource : std::pmr::memory_resource { void* do_allocate(std::size_t, std::size_t); void do_deallocate( do_is_equal( const std::pmr::memory_resource& other) const noexcept; }; A Unified Memory Resource 18 |struct unified_memory_resource : std::pmr::memory_resource { void* do_allocate(std::size_t 0 码力 | 51 页 | 3.68 MB | 5 月前3The Roles of Symmetry And Orthogonality In Design
Orthogonality In Design cppcon 2021 Symmetry In C++ Code • C++’s most common symmetry example: Resource Management ... { Bar b; //...do stuff with b } Enter the block, object is created Leave the Orthogonality In Design cppcon 2021 Symmetry In C++ Code • C++’s most common symmetry example: Resource Management ... { Bar b; //...do stuff with b } Enter the block, object is created Leave the for: • No leaked instances • Allocation amortization • Whole-system reset • Resource prioritization and recovery • Resource metrics and runtime monitoring Composable!Charley Bay - charleyb123 at gmail0 码力 | 151 页 | 3.20 MB | 5 月前3Practical memory pool based allocators for Modern C++
only the size in bytes is given © 2020 Apex.AI, Inc. N.B. This also mimics how std::pmr::memory_resource defines the allocation interfacememory_pool::allocate() Closer to a real one struct info { bound to a specific memory pool instance in compile time ● Transparently allocates from another resource until memory pool is defined (development) ● Facilitates definitions of the buckets (testing and static_pool_allocator() noexcept : m_upstream_resource{pmr::get_default_resource()} {} static_pool_allocator(pmr::memory_resource * res) noexcept : m_upstream_resource{res} {} template0 码力 | 49 页 | 986.95 KB | 5 月前3POCOAS in C++: A Portable Abstraction for Distributed Data Structures
Arrays Queues Hash Tables Dense and Sparse MatricesPGAS on GPUsGPUs as a First-Class Computing Resource - GPUs play an important role in modern large-scale computing systems - All three DOE exascale be/wvk9zYbOmYc * CPU vFast GPU vvFast PCI Bus (or other fabric)GPUs as a First-Class Computing Resource CPU GPU PCI Bus (or other fabric) NIC - Historically, network comm. was CPU-centric 1) Direct NVLink, Infinity Fabric allow very fast intra-node transfers DataGPUs as a First-Class Computing Resource CPU GPU PCI Bus (or other fabric) NIC Data - Historically, network comm. was CPU-centric0 码力 | 128 页 | 2.03 MB | 5 月前3
共 113 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
相关搜索词
CompileTimeCompressionandResourceGenerationwithC++20BacktoBasicsExceptionsSmartPointersDataStructuresThatMakeVideoGamesGoRoundDeliveringsafeDesigningClassespartofBringingExistingCodeCUDAUsingconstexprstdpmrTheRolesSymmetryAndOrthogonalityInDesignPracticalmemorypoolbasedallocatorsforModernPOCOASinPortableAbstractionDistributed