Here’s another roundup of Swift/iOS conferences in Europe later this year. I’m planning to be at SwiftLeeds and #Pragma.
Here’s another roundup of Swift/iOS conferences in Europe later this year. I’m planning to be at SwiftLeeds and #Pragma.
@zeux @pervognsen fun fact: on RISC-V, the amount of intrinsics for the vector extension would be through the roof due to combinatorial explosion, but they employ
#pragma riscv intrinsic "vector"
(sans quote marks in Clang)
to have the compiler instantiate them all internally. Arm partially employs that tactic too
as a downside, one no longer can fish out intrinsics from installed headers (not to imply that someone would try that on RISC-V)
https://gcc.gnu.org/cgit/gcc/tree/gcc/config/riscv/riscv_vector.h
`#pragma no_bugs`
Top Ten Things Overheard At The ANSI C Draft Committee Meetings:
10: Sorry, but that's too useful.
9: Dammit, little-endian systems *are* more consistent!
8: I'm on the committee and I *still* don't know what the hell
#pragma is for.
7: Well, it's an excellent idea, but it would make the compilers too
hard to write.
6: Them bats is smart; they use radar.
5: All right, who's the wiseguy who stuck this trigraph stuff in here?
4: How many times do we have to tell you, "No prior art!"
3: Ha, ha, I can't believe they're actually going to adopt this sucker.
2: Thank you for your generous donation, Mr. Wirth.
1: Gee, I wish we hadn't backed down on "noalias".
@Ninji maybe i should start adding #pragma no_bugs
to my C++ source files, if AI can do it so can gcc
*holds up a sign that says `#pragma optimize("", off)` above you*
:3
Just had to wrap a function in #pragma GCC optimize ("O0") because otherwise gcc was failing to compile my inline asm 🤦♂️
How to politely use assert in a header (gcc/clang/msvc/what else?):
#pragma push_macro("NDEBUG")
#undef NDEBUG
#include <assert.h>
// your asserts should properly assert
#pragma pop_macro("NDEBUG")
// nobody has 2 know
Your vendor’s assert.h should be able to be included multiple times with NDEBUG defined or not.
RealProbe: An Automated and Lightweight Performance Profiler for In-FPGA Execution of High-Level Synthesis Designs
Jiho Kim, Cong Hao
https://arxiv.org/abs/2504.03879 https://arxiv.org/pdf/2504.03879 https://arxiv.org/html/2504.03879
arXiv:2504.03879v1 Announce Type: new
Abstract: High-level synthesis (HLS) accelerates FPGA design by rapidly generating diverse implementations using optimization directives. However, even with cycle-accurate C/RTL co-simulation, the reported clock cycles often differ significantly from actual FPGA performance. This discrepancy hampers accurate bottleneck identification, leading to suboptimal design choices. Existing in-FPGA profiling tools, such as the Integrated Logic Analyzer (ILA), require tedious inspection of HLS-generated RTL and manual signal monitoring, reducing productivity. To address these challenges, we introduce RealProbe, the first fully automated, lightweight in-FPGA profiling tool for HLS designs. With a single directive--#pragma HLS RealProbe--the tool automatically generates all necessary code to profile cycle counts across the full function hierarchy, including submodules and loops. RealProbe extracts, records, and visualizes cycle counts with high precision, providing actionable insights into on-board performance. RealProbe is non-intrusive, implemented as independent logic to ensure minimal impact on kernel functionality or timing. It also supports automated design space exploration (DSE), optimizing resource allocation based on FPGA constraints and module complexity. By leveraging incremental synthesis and implementation, DSE runs independently of the original HLS kernel. Evaluated across 28 diverse test cases, including a large-scale design, RealProbe achieves 100% accuracy in capturing cycle counts with minimal logic overhead-just 16.98% LUTs, 43.15% FFs, and 0% BRAM usage. The tool, with full documentation and examples, is available on GitHub.
I feel kind of stupid for never thinking of doing this before, makes finding blocks of code with #pragma mark so much easier.
I do not care about benchmarks and last exams.
4o is a coding beastie.
Hey, pal, #pragma this crap out in Swiftie style:
Bazinga! goes the GPU!
the IAR C compiler allows DECREASING the optimization level with a #pragma, but not INCREASING
like, I can't have my code compile without optimizations except for a specific critical function that should be optimized. what the fuck were they thinking
C header files usually have a guard to prevent them being included more than once. Quite often these take the form of
#ifndef THING
#define THING
/* Header content. */
Where THING is loosely derived from the filename itself.
I now prefer this at the top of the file:
#pragma once
And none of the rest of that boilerplate.
It's not standard but supported by all compilers I tried. If you know of corner cases where this doesn't work, I'd like to hear from you 🙂