Skip to content

Instantly share code, notes, and snippets.

View vchuravy's full-sized avatar
✈️
Travelling

Valentin Churavy vchuravy

✈️
Travelling
View GitHub Profile
@vchuravy
vchuravy / broken.S
Created September 20, 2024 08:49
AMDGPU bug #672
.text
.amdgcn_target "amdgcn-amd-amdhsa--gfx700"
.globl wibble ; -- Begin function wibble
.p2align 8
.type wibble,@function
wibble: ; @wibble
; %bb.0: ; %bb
s_mov_b32 s2, exec_lo
v_cmpx_gt_u32_e32 10, v0
s_cbranch_execz .LBB0_8
@vchuravy
vchuravy / parca.jl
Created March 18, 2023 19:42
Analyze code loads
using JSON3
jitdump = open(JSON3.read, "/home/vchuravy/Downloads/jitdump.json")
pmap = readlines("/home/vchuravy/Downloads/process_map.txt")
struct AddrRange
start::UInt
fin::UInt
end
function AddrRange(s::AbstractString)
@vchuravy
vchuravy / half.c
Created January 20, 2021 16:02
Half-precision
// 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 January 20, 2021 03:10
Conversion from BigInt to Float16 on PowerPC
; 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 `=='
# 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 November 9, 2020 20:59
Shure MV7 alsa
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
D: [pulseaudio] main.c: Found 16 CPUs.
@vchuravy
vchuravy / Manifest.toml
Last active July 25, 2019 17:51
.empty
# 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 September 19, 2016 17:10
PPC llvm 3.9 threads
.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 09:53
Script to download the AMD APP SDK
#!/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"'
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