The Absurdity of Error HandlingThe Absurdity of Error Handling: Finding a Purpose for Errors in Safety-Critical SYCL Erik Tomusk CppCon 2023 October 5, 2023© 2023 Codeplay Software Ltd. Codeplay Corporate Slide 2© 2023 Codeplay explicitly stated© 2023 Codeplay Software Ltd. Outline • Definition of Safety • Definition of Error Handling • Case Study • Why is this Important? • Is it Really so bad? • What does this mean for execution time (in mainstream compilers) 17Definition of Error Handling 18© 2023 Codeplay Software Ltd. Definition of Error Handling • Exceptions and error codes are sometimes used for reporting or information0 码力 | 43 页 | 1.39 MB | 6 月前3
Customizing Compilation Error MessagesCppCon 2024 Customizing Compilation Error Messages Formatting a Compile-Time String During Substitution Failure Patrick Roberts, P.E. Principal Software Engineer 1CppCon 2024 What problem does solve? 2CppCon 2024 3CppCon 2024 4CppCon 2024 5CppCon 2024 6 Guidelines for a helpful error message Where is the error? ✅ What is wrong? ✅ How can it be fixed? ❌CppCon 2024 7CppCon 2024 8CppCon 2024 90 码力 | 12 页 | 1.47 MB | 6 月前3
Modern C++ Error HandlingModern C++ Handling Phil Nash Error2018 2019series disappointments of a (total) Part 1int parse_int(std::string_view number)// TODO: +, -, digit separators? int acc = 0; for(char c first_digit = false; } return ParseStatus::Numeric; } 42 42 (starts with an int) Error: x42 is not an int test("42"); test("42x"); test("x42"); [[nodiscard]] void test(std::string_view int)”, i); break; case ParseStatus::NonNumeric: std::println(“Error: {} is not an int", str); break; } }int parse_int(std::string_view number) {0 码力 | 66 页 | 36.65 MB | 6 月前3
Design patterns for error handling in C++ programs using parallel algorithms and executorsDesign patterns for error handling in C++ programs using parallel algorithms and executors Mark Hoemmen* mhoemmen@stellarscience.com CppCon 2020 * hoʊ’mən, or hœm’mən; he/himWho am I? • > 10 years 2017 • Started new job at Stellar Science in March Eschew raw pointersOutline • Parallelism makes error handling harder… • …C++ parallel algorithms and tasks specifically • Message Passing Interface (MPI): Responsiveness ILLIAC IV: the 1st massively parallel computer (image: Steve Jurvetson)Parallel hinders error handling • … because parallelism relaxes execution order – Deliberately, to improve performance0 码力 | 32 页 | 883.27 KB | 6 月前3
Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Coderequests to Node 2 ○ Node 2 acts as a service server, receives requests from Node 1, and sends back responses ■ Node 2 also uses parameters at run-time to change its behaviorWhat is ROS 2? ● In this ROS requests to Node 2 ○ Node 2 acts as a service server, receives requests from Node 1, and sends back responses ■ Node 2 also uses parameters at run-time to change its behavior ● Each node should be responsible requests to Node 2 ○ Node 2 acts as a service server, receives requests from Node 1, and sends back responses ■ Node 2 also uses parameters at run-time to change its behavior ● Each node should be responsible0 码力 | 200 页 | 1.77 MB | 6 月前3
Testing Compile-time Constructs Within a Runtime Unit Testing Frameworkget_half_of(23); }© 2021 Apex.AI, Inc. image: Flaticon.com 11.5F Correct requests get correct responses ██████ █████ █████████████{ ████ █████████ █████ ████████ ██ ███████████████ ███ get_half_of(23.0F);© 2021 Apex.AI, Inc. Wrong requests cause a compilation error image: Flaticon.com Compilation error float a = get_half_of(23); ██████ █████ █████████████{ ████ █████████ COMPILE STATIC TEST ] Halving ERROR: my_api/test_halving.cpp:35: must fail to compile. my_api/test_halving.cpp:0: Failure Some of the static tests failed. See above for error. [ FAILED ] Halving0 码力 | 50 页 | 1.37 MB | 6 月前3
Performance Matterstimes what is the probability of measuring these differences? Analysis of Variance aov(time~opt+Error(benchmark/opt), times)If = -O2 -O3 4% times what is the probability of measuring and response? (latency) (thruput)Progress Points � � � � � � � � � � Luke wants to send responses faster. Each ;me this code runs… He marks as a progress point. �� � � � � � � � Progress0 码力 | 197 页 | 11.90 MB | 6 月前3
Conan 1.3 DocumentationIf the binary package necessary for some given settings doesn’t exist, Conan client will throw an error. It is possible to try to build the binary package from sources with the --build=missing command line description based on the Bincrafters community blog. The local workflow encourages users to do trial-and-error in a local sub-directory relative to their recipe, much like how developers typically test building tall --build- ˓→folder=tmp/build Project: Running build() ... Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:03.34 This is pretty strightforward, but it does add a very helpful new shortcut0 码力 | 397 页 | 2.77 MB | 1 年前3
Conan 1.7 Documentationgenerate the requested files specified in the [generators] section. The Conan client will throw an error If the binary package required for specific settings doesn’t exist. It is possible to try to build import platform def system(command): retcode = os.system(command) if retcode != 0: raise Exception("Error while executing:\n\t %s" % command) if __name__ == "__main__": params = " ".join(sys.argv[1:]) if will generate warnings and errors. Keep it as clean as possible to guarantee a recipe less prone to error and more coherent. • Updated: Don’t use deprecated features and when possible use the latest Conan0 码力 | 433 页 | 2.95 MB | 1 年前3
Conan 1.6 DocumentationIf the binary package necessary for some given settings doesn’t exist, Conan client will throw an error. It is possible to try to build the binary package from sources with the --build=missing command line import platform def system(command): retcode = os.system(command) if retcode != 0: raise Exception("Error while executing:\n\t %s" % command) if __name__ == "__main__": params = " ".join(sys.argv[1:]) if create will output some warnings and errors, keep it as clean as possible to guarantee a recipe less error prone and more understandable. • Updated: Not using deprecated features and when possible, using0 码力 | 428 页 | 2.87 MB | 1 年前3
共 252 条
- 1
- 2
- 3
- 4
- 5
- 6
- 26
相关搜索词













