Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MD5 | |
using BenchmarkTools | |
function generate_tree(treeroot, N, silly=false) | |
mkdir(treeroot) | |
J = if silly 1 else N end | |
K = if silly N*N else N end | |
for j in 1:J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unordered_set> | |
#include <vector> | |
#include <optional> | |
#include <iostream> | |
#include <chrono> | |
#include <ctime> | |
template<typename T> std::optional<int> minimum_coins(T target, std::vector<T> denominations) { | |
auto values = new std::unordered_set<T>(); values->insert(target); | |
auto k = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = 'vectest.c' | |
source_filename = "vectest.c" | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-linux-gnu" | |
; Function Attrs: noinline nounwind uwtable | |
define float @myfun(i32, float*) #0 { | |
%3 = alloca i32, align 4 | |
%4 = alloca float*, align 8 | |
%5 = alloca float, align 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** IR Dump After Demanded bits analysis *** | |
define double @julia_myfun_15949(%jl_value_t addrspace(10)* nonnull align 16 dereferenceable(40)) !dbg !7 { | |
top: | |
%1 = alloca { i64, i8 }, align 8 | |
%2 = call %jl_value_t*** @julia.ptls_states() | |
%3 = addrspacecast %jl_value_t addrspace(10)* %0 to %jl_value_t addrspace(11)*, !dbg !9 | |
%4 = bitcast %jl_value_t addrspace(11)* %3 to double addrspace(13)* addrspace(11)*, !dbg !9 | |
%5 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %4, align 8, !dbg !9, !tbaa !13, !nonnull !4 | |
%6 = load double, double addrspace(13)* %5, align 8, !dbg !9, !tbaa !17 | |
%7 = bitcast %jl_value_t addrspace(11)* %3 to %jl_value_t addrspace(10)* addrspace(11)*, !dbg !20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> @code_native myf(7, 3) | |
.text | |
; ┌ @ REPL[2]:1 within `myf' | |
; │┌ @ REPL[2]:1 within `-' | |
subq %rsi, %rdi | |
addq $-2, %rsi | |
; │└ | |
; │┌ @ int.jl:54 within `*' | |
imulq %rdi, %rsi | |
; │└ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Images | |
using SimpleDirectMediaLayer | |
const SDL2 = SimpleDirectMediaLayer | |
function render_julia_set!(pixels, c, J, K, ::Val{MaxIt}, cmap) where MaxIt | |
color_lookup(val) = cmap[val + 1] | |
@inbounds for j in 1:J, k in 1:K | |
vv = julia_pix(c, j, k, J, K, Val(MaxIt)) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkTools | |
function myadd1(a, it) | |
N=size(a,1) | |
acc = 1 | |
for i in 1:it | |
a[acc] = 1 + (a[acc] + 16807 * 33 * (acc + a[a[a[acc]]])) % (N-1) | |
acc = 1 + (acc + 16807 * 17 * acc + a[a[acc]]) % (N-1) | |
end | |
end |