Skip to content

Instantly share code, notes, and snippets.

View certik's full-sized avatar

Ondřej Čertík certik

View GitHub Profile
$ ./chess
Choose your color (White/Black):
White
You play as White.
+---+---+---+---+---+---+---+---+
8 | r | n | b | q | k | b | n | r |
+---+---+---+---+---+---+---+---+
7 | p | p | p | p | p | p | p | p |
+---+---+---+---+---+---+---+---+
6 | | | | | | | | |
2025-04-27T09:19:55.5398220Z ##[group]Run case "$OSTYPE" in darwin*) export MACOS=1;; *) export MACOS=0;; esac
2025-04-27T09:19:55.5398600Z case "$OSTYPE" in darwin*) export MACOS=1;; *) export MACOS=0;; esac
2025-04-27T09:19:55.5398870Z export LFORTRAN_TEST_ENV_VAR='STATUS OK!'
2025-04-27T09:19:55.5399060Z shell ci/test_lsp.sh
2025-04-27T09:19:55.5491660Z shell: /bin/bash -e -l {0}
2025-04-27T09:19:55.5491810Z env:
2025-04-27T09:19:55.5491950Z MACOSX_DEPLOYMENT_TARGET: 14
2025-04-27T09:19:55.5492120Z MAMBA_ROOT_PREFIX: /Users/runner/micromamba
2025-04-27T09:19:55.5492350Z MAMBA_EXE: /Users/runner/micromamba-bin/micromamba
2025-04-27T09:19:55.5492590Z CONDARC: /Users/runner/work/_temp/setup-micromamba/.condarc
This file has been truncated, but you can view the full file.
subroutine g0
integer :: x, i
x = 1
do i = 1, 10
x = x*i
end do
end subroutine
subroutine g1
integer :: x, i
@certik
certik / a.f90
Created December 29, 2024 19:30
! Code from:
! https://fortran-lang.discourse.group/t/nvfortran-comparison-of-do-concurrent-vs-openmp-code/8552/18
!
! Adapted version with OpenMP and DO CONCURRENT in the same program file
! and removed disk write in the end.
!
MODULE all_data
USE iso_fortran_env, ONLY: int64, i4 => int32, r8 => real64
IMPLICIT NONE
@certik
certik / a.f90
Created January 23, 2012 21:32
transfer() example
program a
use types, only: dp
use compute, only: init, register_func, run, eq, destroy, get_context
use my_data_type, only: my_data, type2data, data2type
type(eq), pointer :: d
type(my_data), target :: data1, data2
data1%a11 = 0
data1%a12 = -1
@certik
certik / a.f90
Created January 18, 2024 17:20
module semigroup_m
!! A semigroup is a type with a sensible operation for combining two objects
!! of that type to produce another object of the same type.
!! A sensible operation has the associative property (i.e. (a + b) + c == a + (b + c))
!! Given this property, it also makes sense to combine a list of objects of
!! that type into a single object, or to repeatedly combine an object with
!! itself. These operations can be derived in terms of combine.
!! Examples include integer (i.e. +), and character (i.e. //)
implicit none
private
This file has been truncated, but you can view the full file.
program bench3
implicit none
integer :: c
c = 0
call g1(c)
call g2(c)
call g3(c)
call g4(c)
call g5(c)
call g6(c)
@certik
certik / mydelta.cpp
Created November 12, 2024 17:43
mydelta prototype implementation of `delta`
// Compile with:
// g++ -O3 -march=native -o mydelta mydelta.cpp
// Use it like:
// git diff | ./mydelta
#include <iostream>
#include <string>
#include <regex>
// ANSI escape codes for colors
#!/usr/bin/perl
no warnings 'utf8';
use strict;
use Image::Magick;
use Term::Size;
use Getopt::Long;
use Time::HiRes qw(gettimeofday tv_interval);
our ($cachehit,$cachemiss,$nocache,$filter);
@certik
certik / mnist-cnn.dot.png
Last active February 27, 2024 15:06
Computational Graph
Image