Skip to content

Instantly share code, notes, and snippets.

@Viranchee
Viranchee / instcombine.cpp
Created March 13, 2024 20:26
MLIR Left pass combine
#include "mlir/IR/Dialect.h"
#include "mlir/InitAllDialects.h"
#include "mlir/InitAllPasses.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassRegistry.h"
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include <cstddef>
#include <stdio.h>
@Viranchee
Viranchee / presentation_urls.txt
Created October 13, 2023 04:27 — forked from matthias-springer/presentation_urls.txt
MLIR Bufferization: From Tensors to MemRefs
Debugging Spurious Copies: Mini Example
https://gist.github.com/matthias-springer/81748fe1e530974dd5ff6b3ad57e3eeb
Debugging Spurious Copies: Matmul, Tiled
https://gist.github.com/matthias-springer/372162baa30e79c49180bb3ace216995
https://gist.github.com/matthias-springer/b664feb23be0159f72726025923bb9ca
Empty Tensor Elimination
https://gist.github.com/matthias-springer/b3f40d1667c977c29a76cc7a469cc1a0
https://gist.github.com/matthias-springer/e531580242d27f14e0a239e0b6fe80ae
@Viranchee
Viranchee / command.sh
Last active September 20, 2023 15:57
LIT script for a test
../llvm-project/llvm/utils/lit/lit.py -sv /Users/viranchee/appleSwift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/test-macosx-arm64/AutoDiff/ --show-xfail --show-unsupported --filter differentiable_protocol_requirements.swift
@Viranchee
Viranchee / toolchain_tester.py
Last active September 6, 2023 19:54
Swift-timeline-test
import urllib.request
import datetime
import os
import subprocess
# path = "/Volumes/vissd/SWIFT_NIGHTLIES/"
path = "/Users/viranchee/SWIFT_NIGHTLIES/"
swift_version = "5.4.1"
start_date = datetime.date(2021, 1,1) # 2021,05,29 : Last swift 5.5 downloaded
end_date = datetime.date(2022, 12, 31)
@Viranchee
Viranchee / zsh-autosuggestions.sh
Created August 23, 2023 16:44
zsh-autosuggestions.sh
# Fish-like fast/unobtrusive autosuggestions for zsh.
# https://github.com/zsh-users/zsh-autosuggestions
# v0.7.0
# Copyright (c) 2013 Thiago de Arruda
# Copyright (c) 2016-2021 Eric Freese
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
on run {input, parameters}
set frontApp to (path to frontmost application as Unicode text)
if (frontApp does not contain "Finder.app") then
-- Finder does not have focus.
return
end if
tell application "Finder"
set sel to selection as alias list
@Viranchee
Viranchee / AProblemStatement.md
Last active February 12, 2021 10:19
University DSA Problem Statement

Sample Input

Problem 1

let student_course_pairs_1 : [[String]] = [ ["58", "Linear Algebra"], ["94", "Art History"], ["94", "Operating Systems"], ["17", "Software Design"], ["58", "Mechanics"], ["58", "Economics"],

@Viranchee
Viranchee / RWAutolayout.swift
Created September 29, 2020 07:30
Autolayout UIKit
///// Copyright (c) 2017 Razeware LLC
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
@Viranchee
Viranchee / Dockerfile.armhf
Created September 20, 2020 14:50
Hera - Working RaspberryPi Armv7 armhf Argo Tunnel Helper
## Builder image
FROM arm32v7/golang:1.14-alpine AS builder
RUN apk add --no-cache ca-certificates git
WORKDIR /src
COPY go.mod .
COPY go.sum .
RUN go mod download
@Viranchee
Viranchee / Dockerfile
Last active September 20, 2020 09:06
Blitz DockerFile
# Install all node_modules and build the project
FROM node:14.11.0-alpine3.11 as builder
USER node
RUN mkdir /home/node/code
WORKDIR /home/node/code
COPY --chown=node:node package.json yarn.lock ./
RUN yarn install --pure-lockfile
COPY --chown=node:node . .
RUN yarn build
# Install node_modules for production