List platforms with clGetPlatformIDs
Call clGetPlatformIDs twice, once for the count and once for the handles, then print each platform name with clGetPlatformInfo in OpenCL 3.0 C.
Short posts that solve one thing: the code, the output we got, and why it works.
Call clGetPlatformIDs twice, once for the count and once for the handles, then print each platform name with clGetPlatformInfo in OpenCL 3.0 C.
Share constants and macros between NASM 2.16.03 files with %include, and use -I with a trailing slash for an include directory.
Print the exact directories GCC 14 searches for headers by preprocessing empty input with gcc -xc -E -v -, with no source file needed.
pcim_enable_device() enables a PCI device and registers the disable for you, so a failing probe() or a remove() leaves the device off without extra code.
Declare a packed decimal field in PL/I with DECLARE FIXED DECIMAL, which stores digits two per byte, and print it with an edit format.
Make the STM32L4 independent watchdog start by itself at reset by clearing the IWDG_SW option bit, so a boot hang cannot go unnoticed.
getenv returns NULL for an unset variable and an empty string for a set-but-empty one, so test both before falling back to a default.
Read the raw IEEE 754 bits of an f32 in Rust with to_bits, and rebuild a float from bits with from_bits, instead of reaching for unsafe transmute.
Send a byte range of a file to a socket with sendfile(2) and an in/out offset pointer, which leaves the file's own position alone. Linux 5.x.
Make UBSan in Clang 18 stop at the first undefined behaviour with -fno-sanitize-recover=undefined, instead of printing and carrying on.
Swap a shared_ptr between threads without a data race using C++20 std::atomic<std::shared_ptr<T>>, supported by libstdc++ since GCC 12.
List the playback cards and devices ALSA sees with aplay -l from alsa-utils 1.2, and turn the output into a hw:card,device name.
We send one email when a new post is published. No spam.