CppCon
CppCon
  • 1 586
  • 28 106 620
Lightning Talk: Making Friends With CUDA Programmers (please constexpr all the things) Vasu Agrawal
cppcon.org/
---
Lightning Talk: Making Friends With CUDA Programmers (please constexpr all the things) - Vasu Agrawal - CppCon 2023
github.com/CppCon/CppCon2023
The `--expt-relaxed-constexpr` flag in nvcc allows `constexpr` code to be used on device, removing the need for explicit __device__ annotations. I'll encourage library authors to annotate more code as `constexpr`, allowing CUDA C++ programmers to use the library directly (rather than writing their own), saving work and thus making friends.
---
Vasu Agrawal
Vasu is a research engineer working at the intersection of graphics, machine learning, computer vision, and virtual reality (aka "the Metaverse"), focusing on high-performance, low-latency applications. In his free time, he enjoys watching movies & sci-fi TV shows, learning to play guitar (poorly), and practicing Tae Kwon Do.
---
Videos Filmed & Edited by Bash Films: www.BashFilms.com
UA-cam Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
Registration for CppCon: cppcon.org/registration/
#cppcon #cppprogramming #cpp
Переглядів: 4 448

Відео

Lightning Talk: Detecting Constant Folding to Prevent Substitution Failure - Patrick Roberts CppCon
Переглядів 2,3 тис.День тому
cppcon.org/ Lightning Talk: Detecting Constant-Folding to Prevent Substitution Failure - Patrick Roberts - CppCon 2023 github.com/CppCon/CppCon2023 Substitution failure can often be tricky to handle. This talk explores usage of the GCC and Clang compiler intrinsic builtin_constant_p to short-circuit potential substitution failures in the context of writing a state machine. Patrick Roberts Patri...
Lightning Talk: Undefined Behavior - Toolkit to Improve Communication With Clients - Laura Kostur
Переглядів 1,4 тис.День тому
cppcon.org/ Lightning Talk: Undefined Behavior - Toolkit to Improve Communication With Clients - Laura Kostur - CppCon 2023 github.com/CppCon/CppCon2023 My talk is about Socially Undefined Behaviour related to working in code. For example what happens when your product owner's instructions and directions are neither instructive nor directive or when a client uses a feature in a way you never im...
Lightning Talk: Program Complexity and Thermodynamics - Vadim Alexandrov - CppCon 2023
Переглядів 2,1 тис.День тому
cppcon.org/ Lightning Talk: Program Complexity and Thermodynamics - Vadim Alexandrov - CppCon 2023 github.com/CppCon/CppCon2023 The roots of program complexity can be traced to the fundamental laws of physics. In this talk, we explore how to apply the laws of thermodynamics to better understand the challenges we face during software development. Vadim Alexandrov Vadim Alexandrov is a Senior Sof...
Lightning Talk: Is Polymorphism in C++ Really That Bad? - Paul Tsouchlos - CppCon 2023
Переглядів 4,5 тис.День тому
cppcon.org/ Lightning Talk: Is Polymorphism in C Really That Bad? - Paul Tsouchlos - CppCon 2023 github.com/CppCon/CppCon2023 Case study of how we used polymorphism at my work to solve a problem with hardware control. I'll present what we did wrong at first, how we corrected it and the performance we can achieve for our particular application. I'll also briefly mention ways we can further impro...
Lightning Talk: Enhancing C++ exceptions with Context - Shachar Shemesh - CppCon 2023
Переглядів 3,1 тис.14 днів тому
cppcon.org/ Lightning Talk: Enhancing C exceptions with Context - Shachar Shemesh - CppCon 2023 github.com/CppCon/CppCon2023 Exceptions in C are missing important context. You know something bad happened, and you kinda know what, but you don't have any context on what the program was trying to do, or why it was trying to do it. Class Context to the rescue! Shachar Shemesh Shachar Shemesh has be...
Lightning Talk: Writing a Better std::move - Jonathan Müller - CppCon 2023
Переглядів 9 тис.14 днів тому
cppcon.org/ Lightning Talk: Writing a Better std::move - Jonathan Müller - CppCon 2023 github.com/CppCon/CppCon2023 std::move allows the creation of const rvalue references, which is almost always wrong. It also allows moving out of lvalue references, which can be dangerous since you don't have real ownership over them and a caller might not expect the object to disappear. Let's fix those probl...
Lightning Talk: Know Your Audience: Who’s Building Your C++ Code - Chris Thrasher - CppCon 2023
Переглядів 1,7 тис.14 днів тому
cppcon.org/ Lightning Talk: Know Your Audience: Who’s Building Your C Code - Chris Thrasher - CppCon 2023 github.com/CppCon/CppCon2023 Know who is building your code because it impacts the decisions you make in your build system. My talk presents an idea for dealing with how different people need different things from your build. Chris Thrasher Chris Thrasher is a robotics software developer wh...
Lightning Talk: (Fine) Wine and MSVC: What Could Possibly Go Wrong? - Yannic Staudt - CppCon 2023
Переглядів 2,5 тис.14 днів тому
cppcon.org/ Lightning Talk: (Fine) Wine and MSVC: What Could Possibly Go Wrong? - Yannic Staudt - CppCon 2023 github.com/CppCon/CppCon2023 A short story about wine, command line arguments, paths and what it takes to cross compile binaries for Windows targets on a Linux host using MSVC and why you might consider doing the same! Yannic Staudt Yannic is one of the co-founders of tipi.build, a hack...
Lightning Talk: Let's Fix Sparse Linear Algebra with C++. It'll Be Fun and Easy! - Benjamin Brock
Переглядів 11 тис.14 днів тому
cppcon.org/ Lightning Talk: Let's Fix Sparse Linear Algebra with C . It'll Be Fun and Easy! - Benjamin Brock - CppCon 2023 github.com/CppCon/CppCon2023 Sparse linear algebra is hard. There are a large variety of different sparse linear algebra formats, and they all require obtuse index arithmetic in order to use. But what if we could fix this? In this talk, I'll present an idea for "fixing spar...
Lightning Talk: Higher-Order Template Metaprogramming with C++23 - Ed Catmur - CppCon 2023
Переглядів 7 тис.21 день тому
cppcon.org/ Lightning Talk: Higher-Order Template Metaprogramming with C 23 - Ed Catmur - CppCon 2023 github.com/CppCon/CppCon2023 C 20's Concepts transformed metaprogramming, but they can still be inflexible and are not readily composable. I demonstrate a few simple yet powerful techniques to allow building concepts from type traits, type transformations and even other concepts. Ed Catmur At M...
Lightning Talk: The Responsibility of C++ - Neil Henderson - CppCon 2023
Переглядів 3,1 тис.21 день тому
cppcon.org/ Lightning Talk: The Responsibility of C - Neil Henderson - CppCon 2023 github.com/CppCon/CppCon2023 Hopefully an amusing and light-hearted look at C and its strengths and responsibilities in the software world from a recent life-changing experience. Neil Henderson Neil is a C software developer from Australia working with video and media. Videos Filmed & Edited by Bash Films: www.Ba...
Lightning Talk: Whitespace: A Humorous Short Talk - Dan Curran - CppCon 2023
Переглядів 4,5 тис.21 день тому
cppcon.org/ Lightning Talk: Whitespace: A Humorous Short Talk - Dan Curran - CppCon 2023 github.com/CppCon/CppCon2023 i want a holy war over whitespace. the most productive discussion. Dan Curran working in finance. i like to experiment in language design, and implement proposals for c in clang. sometimes. Videos Filmed & Edited by Bash Films: www.BashFilms.com UA-cam Channel Managed by Digital...
Lightning Talk: Thread Safety With synchronized_value in C++ - Jørgen Fogh - CppCon 2023
Переглядів 4,2 тис.21 день тому
cppcon.org/ Lightning Talk: Thread Safety With synchronized_value in C - Jørgen Fogh - CppCon 2023 github.com/CppCon/CppCon2023 Adding thread safety to existing code is hard. The proposed type synchronized_value makes it less hard. I will show you why. Jørgen Fogh Jørgen Fogh has been writing software his entire life. The last 15 years he has primarily done it in C . Videos Filmed & Edited by B...
Lightning Talk: You Should Use AddressSanitizer - Brody Holden - CppCon 2023
Переглядів 5 тис.21 день тому
cppcon.org/ Lightning Talk: You Should Use AddressSanitizer - Brody Holden - CppCon 2023 github.com/CppCon/CppCon2023 This talk aims to get you, yes you, to use Address Sanitizer. ASan will detect various memory errors and is worth your time. Brody Holden Brody works in fintech and lives in Canada. When he's not using ASAN he is thinking about using ASAN. Videos Filmed & Edited by Bash Films: w...
Lightning Talk: Write Valid C++ and Python in One File - Roth Michaels - CppCon 2023
Переглядів 7 тис.28 днів тому
Lightning Talk: Write Valid C and Python in One File - Roth Michaels - CppCon 2023
Lightning Talk: Filling the Bucket: Reading Code, C++ Code Interviews & Exams - Amir Kirsh - CppCon
Переглядів 3,2 тис.28 днів тому
Lightning Talk: Filling the Bucket: Reading Code, C Code Interviews & Exams - Amir Kirsh - CppCon
Lightning Talk: C++ and the Next Generation: How to Support Women and Families in Tech - Sara Boulé
Переглядів 1,6 тис.Місяць тому
Lightning Talk: C and the Next Generation: How to Support Women and Families in Tech - Sara Boulé
Lightning Talk: Spanny: Abusing C++ mdspan Is Within Arm’s Reach - Griswald Brooks - CppCon 2023
Переглядів 3,1 тис.Місяць тому
Lightning Talk: Spanny: Abusing C mdspan Is Within Arm’s Reach - Griswald Brooks - CppCon 2023
Lightning Talk: Help! My Expression Template Type Names Are Too Long! - Braden Ganetsky CppCon 2023
Переглядів 6 тис.Місяць тому
Lightning Talk: Help! My Expression Template Type Names Are Too Long! - Braden Ganetsky CppCon 2023
Lightning Talk: Interfaces in C++ - Megh Parikh - CppCon 2023
Переглядів 4,9 тис.Місяць тому
Lightning Talk: Interfaces in C - Megh Parikh - CppCon 2023
Lightning Talk: Un-Undefining Undefined Behavior in C++ - Jefferson Carpenter - CppCon 2023
Переглядів 5 тис.Місяць тому
Lightning Talk: Un-Undefining Undefined Behavior in C - Jefferson Carpenter - CppCon 2023
Lightning Talk: A Fast, Concurrent Data Loader for Time-Series Data - Glenn Philen - CppCon 2023
Переглядів 3,4 тис.Місяць тому
Lightning Talk: A Fast, Concurrent Data Loader for Time-Series Data - Glenn Philen - CppCon 2023
Lightning Talk: ClangFormat Is Not It - Anastasia Kazakova - CppCon 2023
Переглядів 7 тис.Місяць тому
Lightning Talk: ClangFormat Is Not It - Anastasia Kazakova - CppCon 2023
Lightning Talk: The Power of Silence and Music in Agile Software - Valentina Ricupero - CppCon 2023
Переглядів 1,5 тис.Місяць тому
Lightning Talk: The Power of Silence and Music in Agile Software - Valentina Ricupero - CppCon 2023
Lightning Talk: Implementing Coroutines Using C++17 - Alon Wolf - CppCon 2023
Переглядів 4,2 тис.Місяць тому
Lightning Talk: Implementing Coroutines Using C 17 - Alon Wolf - CppCon 2023
Lightning Talk: Introverts: Speak! - Rudyard Merriam - CppCon 2023
Переглядів 3,2 тис.Місяць тому
Lightning Talk: Introverts: Speak! - Rudyard Merriam - CppCon 2023
Lightning Talk: Constraining Automated Trading Risk with Linux Signals - Max Huddleston CppCon 2023
Переглядів 2,7 тис.Місяць тому
Lightning Talk: Constraining Automated Trading Risk with Linux Signals - Max Huddleston CppCon 2023
Great C++ is_trivial: trivial type traits - Jason Turner - CppCon 2023
Переглядів 16 тис.Місяць тому
Great C is_trivial: trivial type traits - Jason Turner - CppCon 2023
Better CMake: A World Tour of Build Systems - Better C++ Builds - Damien Buhl & Antonio Di Stefano
Переглядів 10 тис.Місяць тому
Better CMake: A World Tour of Build Systems - Better C Builds - Damien Buhl & Antonio Di Stefano

КОМЕНТАРІ

  • @houdiniping
    @houdiniping День тому

    so where to find these algorithms origin?

  • @FatassFromSingapore
    @FatassFromSingapore День тому

    Can someone explain the difference between void_t and enable_if and when to use each?

  • @__hannibaalbarca__
    @__hannibaalbarca__ 2 дні тому

    I stop use smart pointer, instead we make pointer as in C. We have another code manage to collect all this and making analyze where we must freeing resource.

  • @janciesko7994
    @janciesko7994 2 дні тому

    Great talk!

  • @10e999
    @10e999 2 дні тому

    So where's the drum? :)

  • @alvarohigino
    @alvarohigino 3 дні тому

    C++ needs to be called C++++++++ nowadays

  • @agentstona
    @agentstona 4 дні тому

    This talk was LAME the guy spent firts 15 minutes playing trivia ... I mean this was more of a Come lets play trivia than a talk ...

  • @idiosinkrazijske.rutine
    @idiosinkrazijske.rutine 4 дні тому

    Reminds me of Fortran.

  • @r2com641
    @r2com641 5 днів тому

    Yes and c++ itself sucks now

  • @aniketbisht2823
    @aniketbisht2823 5 днів тому

    C++ libraries like std::chrono are the biggest argument for C++ against C. All the safeties and convenience without any loss of performance.

  • @reneb86
    @reneb86 6 днів тому

    I think every developer instinctively has felt that the "virtual functions are slow" claim is overly generalized. Virtual functions have a practical purpose, and that practical purpose can outweigh a need for performance. And given a proper context, the correct implementation of virtual functions will also yield performance gains. What is surprising here is that compiler optimization and cpu management seems to be a decade or two ahead of what developers are thinking.

  • @biigsmokee
    @biigsmokee 6 днів тому

    crowd is dead but good talk no mention of using rundll32 to just run the dll though?

  • @hanyanglee9018
    @hanyanglee9018 6 днів тому

    This is big...

  • @yongjack-fi7nd
    @yongjack-fi7nd 7 днів тому

    at 4:06, std::array is in cpu memory. How GPU can access it in kernel function? It not use cudaMemorycpy copy memory from host to device.

  • @zachansen8293
    @zachansen8293 7 днів тому

    I used to really love Herb's talks until I realized the talk was usually the only thing to come out of them :( maybe a prototype on godbolt.

  • @jaime7295
    @jaime7295 7 днів тому

    this is by far my favoirite C++ talk!!

  • @ArpitAgarwal1
    @ArpitAgarwal1 7 днів тому

    Your talks are very clear. Thanks for educating a new generation of CPP users.

  • @AlfredoCorrea
    @AlfredoCorrea 7 днів тому

    (all?) inline-able functions should be "device" automatically, for that matter. Not sure what the limitation is.

  • @pkboy546
    @pkboy546 7 днів тому

    Im not sure about the "right" answer. Whatever that looks like. I do believe inheritance can get in the way of code reuse. I guess type erasure (external polymorphism) solves this. Whats you guy's approach to interface abstraction?

  • @skeleton_craftGaming
    @skeleton_craftGaming 7 днів тому

    I may actually go constexpr my stuff now... this also made me think of how that is also better for perf on the CPU (which is the main reason that I would do it since most of the code that I write is not anything that would be run on the GPU anyway...)

  • @andmal8
    @andmal8 7 днів тому

    Thank you!

  • @budiardjo6610
    @budiardjo6610 8 днів тому

    wow, i read his book. really nice.

  • @nicholaskomsa1777
    @nicholaskomsa1777 8 днів тому

    if you are unsure if you have copies or moves and their optimization, you have probably factored wrongly. That said, you act as if const/auto& is not a thing. Furthermore, the amount of contrived invention required to proceed to create this talk seems to be a systemic problem

  • @ravindranathmopparthy8116
    @ravindranathmopparthy8116 8 днів тому

    Are we still going to have a header file and a library file concept? Isn't it possible to do away with these? Why can't c++ export functions and variables like the way other languages do? I can see some ppl creating header only code becaust of this eccentric problem.

  • @EgorChebotarev
    @EgorChebotarev 8 днів тому

    nice

  • @ruadeil_zabelin
    @ruadeil_zabelin 9 днів тому

    I don't see how this can be called very little overhead. What is being kept here to keep track of all this? Or are you stringing together some linked list of pointers over the stack through these objects

    • @CompuSAR
      @CompuSAR 7 днів тому

      You don't need to keep track of them until and unless an exception is actually thrown. *Then* you need to keep track of those that were active in the unwind. I do it with the thread-local vector.

  • @enricomariadeangelis2130
    @enricomariadeangelis2130 10 днів тому

    "prvalues are [...] things returned from the function"? A function can return a reference, hence an lvalue, which you can get the address of. If he said "values returned from the function", it would sound a bit more accurate (as opposed to "references returned from the function"). Ok, I kept listening and noticed other things, which are already pointed out in other comments, and I find the explanations a bit handwavy. But a good presentation overall!

  • @mostrealtutu
    @mostrealtutu 10 днів тому

    shame the c++ gods didn't call the stop token thingies like its called in c#, much better fitting name imho... TaskCancellationSource/CancellationToken (std::task_cancellation_source/std::cancellation_token if you want). NIH is a problem :)

  • @zachansen8293
    @zachansen8293 10 днів тому

    WEN??!?

  • @carl8703
    @carl8703 10 днів тому

    Talk of entropy has a high likelihood of turning into "woo", but this is easily avoided by starting from the definition at 1:22. Start by considering the number of "ways" that something could occur. In this case, we might consider the number of ways something could be implemented, or the number of ways that an error could occur, or the number of ways that a developer could make a mistake, or maybe something else entirely. If it's fair to assume the ways are equiprobable, then the most likely design/error/issue that emerges is the one with the greatest number of ways of occurring. There are at least two ways to deal with this. An approach that's common in mathematics is to try to find a "universal property" where there is only one possible way that something could be implemented to satisfy some desirable property, and if implementations differ in any way, then at least say that those implementations are fundamentally the same thing. This could be interpreted as developing abstractions so that they satisfy some desireable property, and then eliminate ways that implementation details could prevent one implementation from being swapped with another. The second approach is to embrace the randomness, but engineer the situation so that the favorable outcome is the one that has the most possible ways of occurring. I'll have to leave it to the reader to interpret how this could be done, but maybe it could be considered a weaker form of the first approach?

  • @petermuller608
    @petermuller608 10 днів тому

    I would really love to have msvc on my CI to get access to additional analysis This scared me xD

  • @robervaldo4633
    @robervaldo4633 11 днів тому

    he's absolutely correct that safety is not just type safety and security is not just memory safety, also completely irrelevant, the compiler and tooling should help on what is possible helping

  • @CyberDork34
    @CyberDork34 11 днів тому

    A lot of the data oriented design people who swear up and down how bad C++, abstraction, and object-oriented programming are, would probably end up implementing this with a struct that takes function pointers, and a static array of function pointers to switch between behaviors for different devices. You see this a lot in C code, and it's pretty clever. Unfortunately for them, it incurs the *exact same* "runtime overhead" as polymorphism does (in fact this is how polymorphism is implemented under the hood), except with none of the benefits. People always compare the "overhead" of an abstraction vs having code that does nothing, and never the overhead of the abstraction vs being forced to re-implement the same patterns without abstractions, the compiler, or the type system to help you.

    • @dat_21
      @dat_21 10 днів тому

      The idea behind data oriented design (or, a better name for it would be "performance oriented design") is to batch similar things together and process them in a way that is SIMD friendly and doesn't waste memory bandwidth by fully utilizing loaded cache lines. It doesn't have to do much with abstraction or polymorphism other than the fact that c++ compilers will NEVER rearrange or batch your data in classes to enable that kind of processing. Other thing to be aware of is that excessive abstraction of things makes finding strategies for performance design very hard. Often, one needs to dismantle lots of abstractions to get to the essence of what can be bundled together and what can't.

  • @r31527
    @r31527 11 днів тому

    This is super exciting. I'm a Rust engineer & I love Rust, but I would also love to see C++ become modern & safe so that we can all build better software with less headaches.

  • @rinket7779
    @rinket7779 11 днів тому

    Without numbers this talk was beyond useless. The conclusion was something we already knew and what you already stated in your intro "polymorphism has some overhead". Ok?? How much overhead? Did using "final" help? What was the point of this talk exactly?

  • @petermuller608
    @petermuller608 11 днів тому

    The Hardware/Communication/Robots example was too specific, thus hard to follow Nevertheless, I liked the talk! There are too few people telling you "it's fine to use the naive approach, unless you know you need something different "

  • @Tuniwutzi
    @Tuniwutzi 11 днів тому

    Interesting talk. I'm very curious if he's just mentioning the overhead of polymorphism because it's generally assumed, or if they were actually able to measure it. Because after watching ua-cam.com/video/i5MAXAxp_Tw/v-deo.html , I'm more weary of just assuming virtual functions will be slower.

  • @sustrackpointus8613
    @sustrackpointus8613 11 днів тому

    Petition to all c++ programmers: PLEASE FOR THE LOVE OF GOD dye your hair blue and become rust cultist, so the humanity doesn't have to deal with this mess anymore

  • @Max-wk7cg
    @Max-wk7cg 11 днів тому

    Very concise and straight to the point, love it!

  • @cadelmonterde7472
    @cadelmonterde7472 11 днів тому

    Powerpoint link on Github points to the visitor design pattern document.

  • @zbychs
    @zbychs 11 днів тому

    Very interesting and useful. Thanks.

  • @kai18763
    @kai18763 12 днів тому

    Instead of moving value between registers directly, ``` move eax, edi ``` Why the compiler first moves the value to memory then copy to the register like below? ``` mov dword ptr [rbp-4], edi mov eax, dword ptr [rbp-4] ```

  • @redram4574
    @redram4574 12 днів тому

    very useful video

  • @Soil1199
    @Soil1199 12 днів тому

    Really interesting talk, I learned a lot and I will recommend it to anyone learning about hardware architecture and how atomic operations work. I would just add that knowing hardware architecture is not mandatory to use C++ atomics correctly (really good to know though). That’s exactly what the C++ memory model is for: to wrap the complexities of real hardware into an abstract machine that is easier to reason about.

  • @scouter84
    @scouter84 12 днів тому

    Thank you for this concise talk!

  • @chukwujiobicanon961
    @chukwujiobicanon961 12 днів тому

    For the 110th time, I hope I get an answer this time 😢. Why does ISO C have getenv and setenv but ISO C++ has only std::getenv?

    • @touchdepp4507
      @touchdepp4507 7 днів тому

      This question is totally unrelated to the video. Why should here be experts that can answer this question? "Why" questions are particularly bad, because they are subjective. Typically those questions can only be answered by very few people on the world. In your case only by the person who decided that std::setenv will not make it into the standard. So, no, you won't get a definitive answer, even if someone gives you an answer. It will just be a guess.

  • @nangld
    @nangld 13 днів тому

    Does an audio engineering C++ job pay enough to afford a trichologist? One can expect people presenting good technology to also look tidy.

  • @petermuller608
    @petermuller608 13 днів тому

    Aren't his interfaces missing a virtual destructor? Edit: should have listened for five more seconds before posting xD

  • @jimhewes7507
    @jimhewes7507 13 днів тому

    Ok, so I have a collection of Shape objects including shapes like Circle, Square and Triangle. Now I want to find the average radius of all the Circle objects. How do I do that? I'll need to loop over all the Shape objects in the collection. I don't want to have to put a GetRadius() function in the ShapeConcept class because it's irrelevant to the Square and Triangle classes. Some functions are common to all Shapes like draw() and serialize() but some are specific to a particular Shape. I may want to use those functions. Not easy to do with this type erasure pattern.

  • @KX36
    @KX36 13 днів тому

    I would be interested to know what is the happy path overhead for ExContext compared to try catch

    • @CompuSAR
      @CompuSAR 10 днів тому

      The moment you have automatic variables with destructors, the function logically has a catch clause. The added overhead for ExContext would be the global vector of contexts (marginal overhead) and the allocation cost (assuming all your parameters are trivially copyable, should also be marginal). So this definitely has a higher run-time overhead than an explicit try-catch. With that said, the additional overhead should be fairly minimal, and the class is significantly less intrusive to your code. I think it's a good tradeoff to make (obviously, or I wouldn't have written this class).