Performance Engineering: Being Friendly to Your Hardware## 20 24 September 15 - 20 ## +24 ## Performance Engineering Being Friendly to Your Hardware ## I GNAS BAGDONAS ## Being Friendly to Your Hardware Performance Engineering A gentle introduction to hardware0 码力 | 111 页 | 2.23 MB | 1 年前3
Bringing Existing Code to CUDA Using constexpr and std::pmr## +21 ## Bringing Existing Code to CUDA Using constexpr and std::pmr BOWIE OWENS 20 21 October 24-29 ## Outline • Introduction • Memory • Host vs Device Functions • Return on Investment • Concluding 17. --expt-relaxed-constexpr (-expt-relaxed-constexpr) Experimental flag: Allow host code to invoke ___device___{constexpr} functions, and device code to invoke ___host___{constexpr} functions. Note that -nvcc/ index.html#options-for-altering-compiler-linker-behavior-expt-relaxed- constexpr ## Using constexpr constexpr void _add(std::size_t n, float const* x, float* y) { for (std::size_t i = 0;0 码力 | 51 页 | 3.68 MB | 1 年前3
Cache-Friendly Design in Robot Path Planning## Cache-friendly Design in Robot Path Planning ## BRIAN CAIRI 2023 | October ## About Me - This is my first time at CppCon! • Regularly program in C++ for robotics  ## Cache-friendly design ## Cache-friendly design Program design focused on optimizing code by avoiding pathological effects of computer system. ## Cache-friendly design Modern memory pipelines are so complex you are basically optimizing for the cache - Random person on StackOverflow ## Cache-friendly design  Complete OverviewExpressions • Pack Expansion in Lambda Captures ☐ constexpr Changes • virtual functions • union, try/catch, dynamic_cast, typeid • allocations • constexpr string & vector ☐ Concurrency Changes std::invoke(f, args...); }; Allowed in C++20 ## constexpr Changes ## constexpr ☐ constexpr virtual functions ☐ constexpr functions can now: • use dynamic cast() and typeid • do dynamic blocks But still cannot throw exceptions ## constexpr string & vector □ std::string and std::vector are now constexpr ☐ Needed to support constexpr reflection in the future  = default; 4 5 constexpr void operator()(T* ptr) const noexcept 6 { 7 static_assert(0 < sizeof(T), "can't 24); constexpr static size_t max_cap() { return std::numeric_limits ::max(); } constexpr static size_t sso_cap() { return sizeof(mBuf) - 1; /* -1 for \0' */ } constexpr static bool fits_into_sso(size_t len) { return len <= sso_cap(); } constexpr bool is_long() const { return mPtr != mBuf; } constexpr string() : mPtr{mBuf}, mBuf{} constexpr string(const char* data, size_t len) : 0 码力 | 17 页 | 790.91 KB | 1 年前3
Compile-Time Compression and Resource Generation with C++20libraries I created for this code • Discuss some techniques I found building compile-time libraries ## constexpr in Brief • Specifies a variable or function CAN appear in a constant expression • Constant expressions expressions can be evaluated at compile-time • eg: ■ Array size ☐ non-type template parameter ## constexpr Variable • Must be a Literal Type ☐ scalar (int, char, etc) array of literals ■ struct/class/union Implies const constexpr int Base{0b0010'1000}; constexpr std::arrayValues{1, 2, 3}; int main() { // Base += 1; // ERROR return Base + Values[1]; } # constexpr Function0 码力 | 59 页 | 1.86 MB | 1 年前3
C++20 STL Features: 1 Year of Development on GitHubu=""> constexpr bool cmp_equal(T t, U u) noexcept; templateconstexpr bool cmp_not_equal(T t, U u) noexcept; template ## constexpr Algorithms ## C++20 constexpr Everything • constexpr enables compile-timeconstexpr bool cmp_less(T u=""> constexpr bool cmp_greater(T t, U u) noexcept; template constexpr bool cmp_less_equal(T t, U u) noexcept; template constexpr bool cmp_greater_equal(T class="" t=""> constexpr bool in_range(T t) noexcept; 0 码力 | 45 页 | 702.09 KB | 1 年前3
C++20 STL Features: 1 Year of Development on GitHubu=""> constexpr bool cmp_equal(T t, U u) noexcept; templateconstexpr bool cmp_not_equal(T t, U u) noexcept; template ## constexpr Algorithms ## C++20 constexpr Everything • constexpr enables compile-timeconstexpr bool cmp_less(T u=""> constexpr bool cmp_greater(T t, U u) noexcept; template constexpr bool cmp_less_equal(T t, U u) noexcept; template constexpr bool cmp_greater_equal(T class="" t=""> constexpr bool in_range(T t) noexcept; 0 码力 | 45 页 | 989.72 KB | 1 年前3
Compile-Time Validationreporting can be used with compile-time error detection void foo() { constexpr auto error = detect_error(); if constexpr (error) { report_error(error); } } ## Error Reporting – static\_assert message must be a string literal which limits the information that can be provided void foo() { constexpr auto error = detect_error(); static_assert(!error, "error message"); ## Error Message foo() { constexpr auto error = std::optional(custom_error{}); if constexpr (error) { report_error<*error>(); } }; ## Error Message templateconstexpr auto report_error() 0 码力 | 137 页 | 1.70 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
Performance EngineeringHardwareMemcpyAlignmentPerformance Testingconstexprstd::pmrCUDA性能优化内存管理缓存友好的设计路径规划机器人计算机缓存结构内存访问模式C++ Scripting BindingsChaiScriptC++嵌入式脚本引擎constexpr friendlyModulesRangesCoroutinesConcurrency ChangesSmall String Optimizationtemplatestruct压缩对联结C++20lookup tablesconfiguration fusesUSB descriptorsGitHubSTLVisual C++ LibrariesC++20 STL FeaturesGitHub DevelopmentrangesvNextCompile-Time ValidationMitzitemplate metaprogrammingC++23













