Skip to content

Instantly share code, notes, and snippets.

@rigtorp
rigtorp / rdtsc.c
Created December 4, 2018 22:29
Read rdtsc
View rdtsc.c
static inline uint64_t rdtsc() {
uint64_t hi, lo;
asm volatile ("mfence; rdtsc\n" : "=a" (lo), "=d" (hi));
return (hi << 32) | lo;
}
@rigtorp
rigtorp / git-fetch-all.md
Last active June 25, 2019 08:54
Fetch all remotes for all git repositories in directory
View git-fetch-all.md

Fetch all remotes for all git repositories in directory (recursively)

$ find . -name .git -type d -execdir git --git-dir '{}' fetch --all ';'
@rigtorp
rigtorp / gist:db4241d25b753c952962e554686735dc
Last active August 24, 2020 07:08
PyTorch gx1010 build output
View gist:db4241d25b753c952962e554686735dc
This file has been truncated, but you can view the full file.
-- The CXX compiler identification is GNU 10.2.1
-- The C compiler identification is GNU 10.2.1
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/lib64/ccache/cc
@rigtorp
rigtorp / udpcap.cpp
Created December 8, 2021 17:32
Simple tool to record UDP streams
View udpcap.cpp
// © 2021 Erik Rigtorp <erik@rigtorp.se>
// SPDX-License-Identifier: MIT
// udpcap: Simple tool to record UDP streams
#include <arpa/inet.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
@rigtorp
rigtorp / rocm.md
Last active July 3, 2022 13:02
How to build rocm 3.6.x beta from source
View rocm.md

Install rocm-cmake

git clone https://github.com/RadeonOpenCompute/rocm-cmake.git
mkdir bulid
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm ..
make
sudo make install