Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Working ...

Anjan Roy itzmeanjan

😎
Working ...
View GitHub Profile
@itzmeanjan
itzmeanjan / test_montgomery_arithmetic.py
Last active Jun 28, 2022
Montgomery Modular Arithmetic for 256 -bit `secp256k1` Prime Field
View test_montgomery_arithmetic.py
#!/usr/bin/python3
from math import ceil
from typing import List, Tuple
from random import randint
def bit_count(num: int) -> int:
'''
Same as len(bin(num)[2:])
@itzmeanjan
itzmeanjan / recovery.rs
Last active Feb 25, 2022
Reed Solomon Erasure Coded Data Recovery with (I)FFT
View recovery.rs
use dusk_plonk::fft::EvaluationDomain;
use dusk_plonk::prelude::BlsScalar;
mod utils {
use dusk_plonk::fft::EvaluationDomain;
use dusk_plonk::prelude::BlsScalar;
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
use std::time::{SystemTime, UNIX_EPOCH};
@itzmeanjan
itzmeanjan / dft.cpp
Last active Nov 17, 2021
⭐️ Parallel DFT on GPGPU, using SYCL DPC++ 🔥
View dft.cpp
#include <CL/sycl.hpp>
#include <chrono>
#include <complex>
#include <iostream>
using namespace sycl;
typedef std::complex<double> cmplx;
constexpr uint N = 1 << 10;
constexpr uint B = 1 << 5;
@itzmeanjan
itzmeanjan / cholesky_factorization.cpp
Created Oct 18, 2021
👽 Parallel Cholesky Factorization targeting Accelerators, using SYCL DPC++ 🔥
View cholesky_factorization.cpp
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <random>
using namespace sycl;
const uint N = 1 << 10;
const uint B = 1 << 5;
const float MULT_FACTOR = .5f;
@itzmeanjan
itzmeanjan / determinant.py
Last active Oct 21, 2021
Computing Determinant of Square Matrix using Condensation Method
View determinant.py
#!/usr/bin/python3
import numpy as np
from copy import deepcopy
from functools import reduce
from time import time
N = 1 << 8
'''
@itzmeanjan
itzmeanjan / improved_lu_decomposition.cpp
Last active Oct 15, 2021
🏃‍♂️ Fast, Parallel LU Factorization, using SYCL DPC++ 🏅
View improved_lu_decomposition.cpp
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <random>
using namespace sycl;
constexpr uint N = 1 << 10;
constexpr uint B = 1 << 6;
@itzmeanjan
itzmeanjan / lu_decomposition.cpp
Last active Oct 11, 2021
Parallel LU Decomposition on GPGPU, using SYCL DPC++ 🔆
View lu_decomposition.cpp
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <random>
using namespace sycl;
constexpr uint N = 1 << 10;
constexpr uint B = 1 << 5;
@itzmeanjan
itzmeanjan / gauss_jordan.cpp
Created Sep 27, 2021
🔥 Solving System of Linear Equations on GPGPU, using SYCL DPC++ ( GAUSS-JORDAN Method ) 👌
View gauss_jordan.cpp
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <random>
using namespace sycl;
constexpr uint N = 1024;
constexpr uint B = 32;
@itzmeanjan
itzmeanjan / fft.cpp
Last active Oct 1, 2021
🤞 Parallel (inv)FFT on GPGPU, using SYCL DPC++ 🚀
View fft.cpp
#include <CL/sycl.hpp>
#include <chrono>
#include <complex>
#include <iostream>
using namespace sycl;
typedef std::complex<double> cmplx;
constexpr uint N = 1024;
constexpr uint B = 32;
@itzmeanjan
itzmeanjan / mat_mul.cpp
Created Sep 23, 2021
Large Scale Parallel Matrix Multiplication, in multiple ways, using SYCL DPC++ 😎
View mat_mul.cpp
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
using namespace sycl;
constexpr uint N = 1024;
constexpr uint B = 32;
int64_t multiply_matrix_matrix_v0(queue &q, const float *matrix_a,