Skip to content

Instantly share code, notes, and snippets.

Avatar
✈️
Travelling

Valentin Churavy vchuravy

✈️
Travelling
  • Cambridge, MA, USA
View GitHub Profile
@vchuravy
vchuravy / half.c
Created Jan 20, 2021
Half-precision
View half.c
// This file is a part of Julia. License is MIT: https://julialang.org/license
// float16 intrinsics
// TODO: use LLVM's compiler-rt
#include <stdint.h>
#include <string.h> // memcpy
#include <math.h> // memcpy
static inline float half_to_float(uint16_t ival)
@vchuravy
vchuravy / gmp-pwr8.ll
Last active Jan 20, 2021
Conversion from BigInt to Float16 on PowerPC
View gmp-pwr8.ll
; ModuleID = 'Float16'
source_filename = "Float16"
target datalayout = "e-m:e-i64:64-n32:64"
target triple = "powerpc64le-unknown-linux-gnu"
; @ gmp.jl:436 within `Float16'
define half @julia_Float16_50({} addrspace(10)* nonnull align 8 dereferenceable(16) %0) !dbg !5 {
top:
; @ gmp.jl:437 within `Float16'
; ┌ @ gmp.jl:648 within `=='
View shure-mv7.conf
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@vchuravy
vchuravy / pa.log
Created Nov 9, 2020
Shure MV7 alsa
View pa.log
This file has been truncated, but you can view the full file.
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: RealtimeKit worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 13.99.2-13-g7f4d7
D: [pulseaudio] main.c: Compilation host: x86_64
D: [pulseaudio] main.c: Compilation CFLAGS: Not yet supported on meson
D: [pulseaudio] main.c: Running on host: Linux x86_64 5.8.14-arch1-1-vc #4 SMP PREEMPT Thu, 08 Oct 2020 14:03:39 +0000
View Manifest.toml
# This file is machine-generated - editing it directly is not advised
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[Cassette]]
git-tree-sha1 = "09aed2c4093e9ed29b08f6660ad959fcb6847cd1"
uuid = "7057c7e9-c182-5462-911a-8362d720325c"
version = "0.2.5"
@vchuravy
vchuravy / threads.S
Last active Sep 19, 2016
PPC llvm 3.9 threads
View threads.S
.text
Filename: threads.jl
ld 2, -8(12)
add 2, 2, 12
mflr 0
std 31, -8(1)
std 0, 16(1)
stdu 1, -1264(1)
mr 31, 1
std 14, 1120(31)
@vchuravy
vchuravy / amd_sdk.sh
Last active May 18, 2018
Script to download the AMD APP SDK
View amd_sdk.sh
#!/bin/bash
# Original script from https://github.com/gregvw/amd_sdk/
# Location from which get nonce and file name from
URL="http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/amd-accelerated-parallel-processing-app-sdk/"
URLDOWN="http://developer.amd.com/amd-license-agreement-appsdk/"
NONCE1_STRING='name="amd_developer_central_downloads_page_nonce"'
FILE_STRING='name="f"'
View Lennard-Jones_MD
function ljconfig(N, per=0.2)
# mesh-grid-like construction
X = (0:N) * ones(1,N)
Y = X'
# write all particles into a single array
x = [X[:]', Y[:]']
x = x + per * rand(size(x))
end
N=50
@vchuravy
vchuravy / ls.jl
Last active Oct 14, 2016
Pipe ls -l into DataFrame
View ls.jl
using DataFrames
using Dates # I am on 0.3
# Note the quoting style and the custom time-style
# sed is used to remove softlinks "dir" -> "../dir"
cmd = `ls -1 -l --quoting-style=c --time-style='+%Y-%m-%d_%H:%M'` |> `sed 's/ -> ".*"$//g'`
df = open(cmd, "r", STDOUT) do io
readtable(io, header=false,
separator=' ',
@vchuravy
vchuravy / test-pair-vs-dict.jl
Created Oct 14, 2014
Performance pair vs dict
View test-pair-vs-dict.jl
# Pair
immutable Pair{A,B}
first::A
second::B
end
start(p::Pair) = 1
done(p::Pair, i) = i>2
next(p::Pair, i) = (getfield(p,i), i+1)