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
-- ### BENCHMARK CONFIG | |
n_runs = 10 -- number of total runs | |
n_vectors = 10e4 -- number of vectors per run | |
n_adds = 200 -- number of operations per vector | |
io.stdout:setvbuf("no") | |
-- ### NAIVE VECTOR ### |
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
-- licensed MIT, created by https://github.com/clemapfel | |
if rt == nil then rt = {} end | |
--- @class rt.ThreadPool | |
rt.ThreadPool = {} | |
--- @brief constructor | |
--- @param n_threads Number number of threads, default: 1 | |
--- @return rt.ThreadPool | |
function rt.ThreadPool:new(n_threads) |
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
-- Author: C. Cords (https://github.com/clemapfel/) | |
-- licensed MIT, see https://opensource.org/license/mit/ | |
rt = {} | |
rt.snow_effect_shader_source = [[ | |
#pragma language glsl3 | |
// GPU-side random generator | |
vec3 mod289(vec3 x) { | |
return x - floor(x * (1.0 / 289.0)) * 289.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
# | |
# Author: C. Cords ([email protected]) | |
# https://github.com/clemapfel/mousetrap.jl | |
# | |
# Copyright © 2023, Licensed under lGPL3-0 | |
# | |
using Test | |
using mousetrap |
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 meshgrid(a, b) | |
x = a' .* ones(length(b)) | |
y = ones(length(a))' .* b | |
return x, y | |
end | |
savetxt(filename, array) = open(filename, "w") do io | |
for row in eachrow(array) |
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 Random | |
# The iterable instance | |
struct Iterable | |
_ids::Vector{Int64} | |
_other::Vector{String} | |
Iterable() = new(rand(Int64, 10), [Random.randstring(3) for i in 1:10]) | |
end | |
# Iterator, holds reference to instance |
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
# Basic mechanism for how to implement GLSL-like swizzling in Julia | |
mutable struct Vec2 | |
_private_00::Float32 | |
_private_01::Float32 | |
Vec2(x, y) = new(x, y) | |
end | |
function Base.getproperty(instance::Vec2, sym::Symbol) | |
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 <thread> | |
#include <chrono> | |
#include <jluna.hpp> | |
// references https://github.com/Clemapfel/jluna/issues/33 | |
int main() | |
{ | |
using namespace jluna; | |
initialize(2); |
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 <jluna.hpp> | |
#include <.benchmark/benchmark.hpp> | |
#include <.benchmark/benchmark_aux.hpp> | |
#include <thread> | |
#include <future> | |
#include <queue> | |
using namespace jluna; | |
int main() |
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
// | |
// Copyright 2022 Clemens Cords | |
// Created on 14.03.22 by clem ([email protected]) | |
// | |
#include <jluna.hpp> | |
using namespace jluna; | |
// this code are examples given as a response to https://github.com/Clemapfel/jluna/issues/12 |
NewerOlder