- Create this file
sudo touch /etc/apt/sources.list.d/rocm.list
- put this line in there
deb [arch=amd64] https://repo.radeon.com/rocm/apt/3.5.1/ xenial main
sudo apt update
- install ocl
sudo apt install rocm-opencl3.5.0
- this script doesnt write icd path to
/etc/OpenCL/vendors/
so that's on us touch /etc/OpenCL/vendors/amdocl64.icd
echo "/opt/rocm-3.5.1/opencl/lib/libamdocl64.so" > /etc/OpenCL/vendors/amdocl64.icd
- done. run
clinfo
. thing should work at this point
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
// for given number N, this function finds another number K such that | |
// (N * K) mod 2^64 = 1 | |
fn mult_mod_inv(n: u64) -> u64 { | |
assert!(n & 1 == 1, "Doesnt work for even numbers"); | |
assert!(n != 0, "Equation 0 mod N == 1 does not have a solution"); | |
let mut k = 1u64; | |
let mut i = 1u64; | |
for _ in 0 .. 64 { | |
i <<= 1; | |
let c = k.wrapping_mul(n); |
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
// this kernel writes a value only if invoaction index is even *_* | |
// when _flag is true, the store adress gets computed to be beyound (1 << 48) byte location . | |
// apparently stores beyound valid adress space on gpu... just become noops! | |
#define store_if_true(Ty, addr, val, flag) \ | |
*((__global Ty*)(((unsigned long)addr) + (((unsigned long)(flag == 0)) * ((1LU << 48) - ((unsigned long)addr))))) = val; | |
__kernel void kern(__global unsigned int* buffer) { |
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
-- basically this in wolfram alpha terms | |
-- 2*(Integrate[sin\(40)x\(41),{x,0,Divide[pi,4]}]+Integrate[sin\(40)x\(41),{x,Divide[pi,4],Divide[pi,2]}]) | |
-- https://www.desmos.com/calculator/1fokxfyphz | |
-- https://www.wolframalpha.com/input?i2d=true&i=Integrate%5Bsin%5C%2840%29x%5C%2841%29%2C%7Bx%2C0%2Cpi%7D%5D | |
-- https://www.wolframalpha.com/input?i2d=true&i=2*%5C%2840%29Integrate%5Bsin%5C%2840%29x%5C%2841%29%2C%7Bx%2C0%2CDivide%5Bpi%2C4%5D%7D%5D%2BIntegrate%5Bsin%5C%2840%29x%5C%2841%29%2C%7Bx%2CDivide%5Bpi%2C4%5D%2CDivide%5Bpi%2C2%5D%7D%5D%5C%2841%29 | |
import Text.Printf (printf) |
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
const std = @import("std"); | |
pub const @"1KiB of bytes": comptime_int = 1024; | |
pub const @"1MiB of bytes": comptime_int = 1024 * 1024; | |
pub const @"1GiB of bytes": comptime_int = 1 << 30; | |
pub const @"Byte amount fitting within 48 bit address space": comptime_int = (1 << 48) - 1; | |
pub fn Ptr(comptime Pointee: type, comptime is_mutable: bool) type { | |
const Ty = if (is_mutable) *Pointee else *const Pointee; | |
return struct { |
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
pub fn main() !void { | |
const AbstractedObject = Opaque(&.{ | |
.{"f1", fn (*anyopaque) u1}, | |
.{"f2", fn (*anyopaque, u8, u8, u8, u8) L}, | |
.{"ferry", fn (*anyopaque)error{boo}!void}, | |
}); | |
var a = std.heap.ArenaAllocator.init(std.heap.page_allocator); | |
var T = K {}; |
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
{-# OPTIONS --type-in-type #-} | |
open import Agda.Builtin.Equality | |
open import Agda.Builtin.Bool | |
open import Agda.Builtin.Nat | |
open import Agda.Builtin.Sigma | |
open import Agda.Builtin.List | |
data Void : Set where |
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
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE PartialTypeSignatures #-} | |
import Data.Char (isNumber, isSpace) | |
infixl |> | |
v |> f = f v | |
main = do | |
print "Hey! I am ready to accept input :)" |
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
import Data.List | |
infixl /// | |
class LaxDivision a where | |
(///) :: a -> a -> a | |
instance LaxDivision Int where | |
(///) = div |
Somehow, it is not possible to lie. These things are with the definiteviness of a combinatorial object. They are not fractals.
I heard one man once said that homological algebra is the most remarkable thing that has been discovered. In most unlike places I noticed glimpses of its presense.
-
This just does not feel real I really wonder if same technique can be applied in the realm of synthetic biology.
NewerOlder