Skip to content

Instantly share code, notes, and snippets.

View greenbagels's full-sized avatar
🙂

Sameed Pervaiz greenbagels

🙂
View GitHub Profile
function calculate_sfs(cf::T) where {R <: Real, T <: Matrix{Measurement{R}}}
# cf is an nxn matrix of correlation function values indexed by site offset
# so first make a matrix with the same shape...
n = size(cf, 1)
sf = similar(cf)
coeff = 2. * pi / n
for iqx in 1:n, iqy in 1:n
qy = iqy * coeff
qx = iqx * coeff
sf[iqy, iqx] = calculate_single_sf(cf, qx, qy, n)
@greenbagels
greenbagels / clpeak.log
Created January 31, 2021 08:04
clpeak benchmark using intel uhd 630 gpu
spervaiz@roche ~/clpeak/build (git)-[master] % ./clpeak
Platform: Intel(R) OpenCL HD Graphics
Device: Intel(R) Graphics [0x9bc8]
Driver version : 21.04.18912 (Linux x64)
Compute units : 23
Clock frequency : 1100 MHz
Global memory bandwidth (GBPS)
float : 13.65
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include <CL/cl.h>
const char* kern_src =
"kernel void para_transply(global double *input, global double *output)\n"
"{\n"
" int i = get_global_id(0);\n"

Keybase proof

I hereby claim:

  • I am greenbagels on github.
  • I am greenbagels (https://keybase.io/greenbagels) on keybase.
  • I have a public key ASD5spdm1QHIaKqvs1d1ddBoKP1FHlgdKtec-lZfEpQTFwo

To claim this, I am signing this object:

Advocacy
Empowering
Spreading awareness on campus
Empowering the survivors
Staunch defenders of liberty
Casting a light on modern day slavery by spreading awareness on campus, empowering survivors through legal advocacy and story-telling,
story-telling
diseminating stories
@greenbagels
greenbagels / .config.diff
Last active July 3, 2017 19:29
linux 4.11.8 -> 4.12.0 differences (from `make silentoldconfig`) (note, unselected parent options may cause some changes to not show, this is NOT a definitive changelog.)
+ Kyber I/O scheduler (MQ_IOSCHED_KYBER) [Y/n/m/?] (NEW)
+ BFQ I/O scheduler (IOSCHED_BFQ) [N/m/y/?] (NEW)
Intel SoC IOSF Sideband support for SoC platforms (IOSF_MBI) [M/y/?] m
+ Enable IOSF sideband access through debugfs (IOSF_MBI_DEBUG) [N/y/?] (NEW)
Machine Check / overheating reporting (X86_MCE) [Y/n/?] y
+ Support for deprecated /dev/mcelog character device (X86_MCELOG_LEGACY) [N/y/?] (NEW)
@greenbagels
greenbagels / roll.rb
Last active June 29, 2017 21:14
simulates dice rolling
#!/usr/bin/env ruby
puts "Enter a dice roll in the form 'PdQ'"
input = /(\d+)d(\d+)/.match(gets).values_at(1,2).map!{&:to_i}
total = (1..input[0]).map{|idx| rand(input[1]) + 1}.each{|num| puts "You rolled #{num}"}.reduce(:+)
puts "You totaled #{total}"
Dependency Tree for CSE 5441 (Approved): Introduction to Parallel Computing:
[CSE 5441: Introduction to Parallel Computing]
[CSE 2421: Systems I: Introduction to Low-Level Programming and Computer Organization]
[CSE 2321: Foundations I: Discrete Structures] (Coreq with 2231)
[CSE 2231: Software II: Software Development and Design] (Coreq with 2321)
[CSE 2221: Software I: Software Components]
#include <cctype>
#include <iostream>
#include <type_traits>
#include <typeinfo>
namespace ascii
{
template <typename T, T operand, typename std::enable_if<std::is_same<T,char>::value, int>::type = 0>
class get_lower
{
#ifndef XORSHIFT_H
#define XORSHIFT_H
#include <cstddef> //std::size_type
#include <limits> //std::numeric_limits
namespace xor
{
namespace detail
{