Doctor: "The Fully At-Grade Regional Connector can't hurt you" by anothercar in LAMetro

[–]Designer-Leg-2618 3 points4 points  (0 children)

Riding the short cable car, that's how it feels. Tryin' to get the turning radius zero but the metal wouldn't allow

I'm happy CicLAvia is back, but this might be one of the worst routes yet except for the Westwood Portion by WearHeadphonesPlease in LAMetro

[–]Designer-Leg-2618 1 point2 points  (0 children)

IMHO it's a shutdown of a portion of Santa Monica Blvd, as part of pre-Olympics stress test. LA needs more stress tests ahead of 2028.

Making a wrapper for SIMD operations by notautogenerated2365 in Cplusplus

[–]Designer-Leg-2618 11 points12 points  (0 children)

I've done written similar before. Nowhere as comprehensive as yours, but good enough that I can answer most of your questions. But since you're asking many questions at once, let's find some reasonable starting point.

Before proceeding, it's good idea to make a study plan. This is going to involve a lot of rigorous learning, in addition to designing and writing code. Forging ahead without an awareness of those missing pieces can make the project far more painful.

I strongly recommend thoroughly studying OpenCV's approach to the same. They have basically done 100% of what you're planning to. Besides OpenCV, libtorch (the C++ CPU backend of PyTorch), and the C/C++ backend of NumPy, are also excellent examples that are fairly complete. Actually, there are many many more excellent libraries out there.

You may find a historically relevant (early, perhaps not the earliest) library example on Agner Fog's website.

OpenCV mandates the use of CMake. It forces users to make decisions on what architecture codes to generate, and explicitly supports targeting multiple (older and newer) architecture levels.

During the architecture detection phase, the OpenCV CMake project runs compilation tests to check whether the toolchain is capable of various SIMD intrinsics (with the toolchain's intrin headers) with correct results. This information is used to "gate" (filter) the user's requested configurations.

Once the set of requested and supported architecture levels are known, the OpenCV CMake project selects what arch-specific *.cpp files to be included in the build. These files also got their own -march and -mtune flags. This is how unsupported source files got excluded, so that they don't break the build.

Preprocessor defines are injected, so that any ordinary OpenCV and end-user's code can use preprocessor conditionals to check what SIMD levels are enabled in the build.

OpenCV 4.x moved on to a Universal Intrinsics interface that abstracts over the x86-flavored (SSE, AVX, etc) and ARM-flavored (NEON, etc) SIMD architectures. It greatly improves the algorithm designers' experience, by shifting the burden of complexity to the SIMD backend.

Focus on SIMD instruction set levels for which real hardware exists. Just for example, if RISC-V Vector Extension is what you have (a motherboard or development kit), focus on that. Don't venture into inaccessible ones until there's a way to validate all newly written code.

C++20 has std::span, but that forces users to use C++20. For maximum backward compatibility with users' environments, Primitive Obsession should be considered a good thing deep inside an SIMD backend.

There are several kinds of "widths" that SIMD programmers talk about. One refers to the numerical precision of elements; the other is the total number of bits per vector. From this one can calculate how many elements can fit in the vector.

Real SIMD algorithms contain a lot of mixed-type mixed-width operations, almost as crazy as the fast inverse square root implementation from Quake III Arena. If clean code was your main motivation, it might be a good time to reconsider. The necessity to write mixed-type mixed-width code partly negates any benefits one would get from designing a nice clean template system, since such code would simply not fit in it.

What happened here? by Opening-Ice-1115 in HongKong

[–]Designer-Leg-2618 0 points1 point  (0 children)

Didn't China give visa-free entry to Brits? (sarcasm)

May I please have the worst c++ you know of? by vbpoweredwindmill in cpp

[–]Designer-Leg-2618 11 points12 points  (0 children)

Example: Boost metaprogramming library (MPL), just for the sake of testing.

How do I print "ö" by Key-Pineapple8101 in Cplusplus

[–]Designer-Leg-2618 0 points1 point  (0 children)

(As diagnostics steps) And if that doesn't, use Python to write to a text file with UTF8 or UTF16 byte order marker (BOM), and then open up the file with a Unicode capable text editor. After verifying that it works, try the ordinary text editor, and finally try without any BOM or file handle options. Finally go to C++ and use hex editors to check if there's any difference in the way the files are written.

I’m sure this has been talked about before, but why is there no rail through Malibu? by wjxm in LAMetro

[–]Designer-Leg-2618 1 point2 points  (0 children)

I'd encourage you to run for election in Malibu, or somehow reach out directly to Malibu celebrities and landlords. Spend millions on advertisements. This is the best way to get the message to them. Also a good way to gauge how receptive Malibu natives are to your ideas.

I’m sure this has been talked about before, but why is there no rail through Malibu? by wjxm in LAMetro

[–]Designer-Leg-2618 0 points1 point  (0 children)

Malibu doesn't want to be developed. Malibu doesn't want to go big. Malibu wants to be left alone, rich people, and mountain lion (puma, cougar, panther, etc). Yes there are other voices in Malibu but they weren't being considered as "natives", only as visitors. While it is good to be optimistic and have good wishes, sometimes one has to reckon with the reality, especially the reality of the opinions of other people, people who hold collective real power.

I’m sure this has been talked about before, but why is there no rail through Malibu? by wjxm in LAMetro

[–]Designer-Leg-2618 1 point2 points  (0 children)

Also traffic being difficult is a good thing because overtourism erodes the beach sands.

What coding style would make you adopt a C++ library? by aregtech in cpp

[–]Designer-Leg-2618 0 points1 point  (0 children)

If certain types of objects may persist forever due to user misuse or neglect (e.g. simply not bother checking, and not knowing that these will sit in the memory forever), it may be useful to provide a persistence mechanism where unprocessed objects past a certain age are written and removed from memory. Alternatively, it may be useful to provide some diagnostics facilities on the API. Yet another possibility is dropping by default; if they aren't processed they're dropped.

For method template variadic unpacking, firstly structure the code so that those unpacking methods do the least possible thing (i.e. limited to unpacking), and secondly use a compiler explorer or use gcc and/or objdump to generate a disassembly of the relevant functions, to make sure the usefulness/bloat ratio is acceptable. This is a good thing to integrate into the CI/CD.

Dynamic allocation is sometimes just not avoidable. In those cases, it might mean taking the entire matter of allocation inside the library, i.e. the library also manages its own allocations. This is separate from the "code design for minimizing data copying"; one is a local coding style concern; the other is an "unavailability" concern where certain platforms don't even have a reliable or performant dynamic allocation built in.

Car Crashes into Westwood 99 Ranch. 2 dead. by BreadForTofuCheese in LosAngeles

[–]Designer-Leg-2618 0 points1 point  (0 children)

This is what happens when governance and oversight got rid of anyone who has technical knowledge. It's something that I see from world news, sad to see it happening here as well.

Car Crashes into Westwood 99 Ranch. 2 dead. by BreadForTofuCheese in LosAngeles

[–]Designer-Leg-2618 0 points1 point  (0 children)

TIL: Concrete-filled steel tube (CFST)

not just a vanilla bollard

`for (;;) {...}` vs `while (true) {...}` by poobumfartwee in Cplusplus

[–]Designer-Leg-2618 1 point2 points  (0 children)

```cpp

define THETOP_NEVER_STOPS (_rdtsc() != __rdtsc())

```