Skip to content

Instantly share code, notes, and snippets.

View skmp's full-sized avatar

Stefanos Kornilios Mitsis Poiitidis skmp

View GitHub Profile
@skmp
skmp / hls_testbench.cpp
Created March 12, 2021 14:54
FPPAdc: HLS testbench
#include "refrend_hls.h"
#include <stdio.h>
using namespace std;
int main()
{
int err =0;
@skmp
skmp / a-test.cpp
Last active June 10, 2022 09:48
copyable functions
//More details: https://github.com/FEX-Emu/fex-assorted-tests-bins/tree/main/src/copyable-functions
#include <cstdint>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <sys/mman.h>
// Example of creating function specializations at run time from a "canonical" template provided by the compiler
@skmp
skmp / copyable-functions.cpp
Created June 23, 2022 11:07
Copyable Functions v2
// Example of creating function specializations at run time from a "canonical" template provided by the compiler
// More details: https://github.com/FEX-Emu/fex-assorted-tests-bins/tree/main/src/copyable-functions
#include <cstdint>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <tuple>
@skmp
skmp / alloc.cpp
Created August 12, 2022 00:33
Grab address space
// $ gcc alloc.cpp -Wl,-esteal -static -g -fno-stack-protector
//
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <cerrno>
#include <cstdint>
// ./a.out | aplay -r 256000 ?
#include <stdio.h>
#include <stdint.h>
#include <x86intrin.h>
#include <atomic>
#include <unistd.h>
#include <math.h>
std::atomic<uint8_t> caches[128 * 512 * 64];
@skmp
skmp / test.cpp
Created September 28, 2023 06:28
libclang template arguments via python
template<int x, int y>
void DoSomething() {
// consume x, y as constants
}
void foo() {
DoSomething<0,1>();
DoSomething<640,480>();