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
CXX=icpx | |
CXXFLAGS=-Wall -g -O2 -march=native | |
.PHONY: all | |
all: example | |
example: example.cpp | |
$(CXX) -o $@ $(CXXFLAGS) -fsycl -fsycl-targets=spir64_x86_64 $< | |
.PHONY: clean |
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
#:block parallel_for(d=1,name="axpy") | |
#:contains args | |
a, x, y | |
#:contains range | |
n | |
#:contains params | |
real, value :: a | |
real, intent(in) :: x(n) | |
real, intent(inout) :: y(n) | |
integer :: i |
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 numpy as np | |
import scipy as sp | |
import matplotlib.pyplot as plt | |
from math import sqrt | |
from scipy.integrate import solve_ivp | |
def l1kw(a,b): | |
"""Lobatto quadrature using 2 knots (trapezoid-like)""" |
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
from easyvvuq.actions import CreateRunDirectory, Encode, Decode | |
from easyvvuq.actions import CleanUp, ExecuteLocal, Actions | |
params = { | |
"max_time": {"type": "float", "default": 1.5 }, | |
"alpha": {"type": "float"}, | |
"outfile": {"type": "string", "default": "output.json"} | |
} |
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
#once | |
; LC3 Instruction Set Assembly for customasm (https://github.com/hlorenzi/customasm) | |
; | |
; References: | |
; Patt, Yale N.; Patel, Sanjay (2003). Introduction to Computing Systems: | |
; From Bits and Gates to C and Beyond. New York, NY: McGraw-Hill Higher | |
; Education. ISBN 0-07-246750-9. | |
#bankdef lc3_bank |
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
FC=gfortran | |
FCFLAGS=-Wall -O2 -fopenmp | |
.phony: all clean | |
all: abcd | |
abcd: abcd.F90 | |
$(FC) $(FCFLAGS) -o $@ $< |
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
#pragma once | |
#include <complex> | |
#include <vector> | |
#include <array> | |
#include <type_traits> | |
#include <span> // C++ 20 | |
#include <iostream> |
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
// compile with: | |
// icpx -fsycl csr_example.cpp | |
// | |
#include <algorithm> | |
#include <oneapi/mkl.hpp> | |
#include <CL/sycl.hpp> | |
int main(int argc, char const *argv[]) | |
{ |
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
module interop | |
use, intrinsic :: iso_c_binding, only: c_int | |
implicit none | |
contains | |
subroutine fillint(arr) bind(c) | |
integer(c_int), intent(inout) :: arr(:) | |
integer :: i | |
arr = [(i**2,i=1,size(arr))] | |
end subroutine | |
end module |
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
! test_mmap.f90 | |
! | |
! compile with: | |
! gfortran -Wall -O2 -o test_mmap test_mmap.f90 | |
! | |
! inspired by the work: | |
! Rojc, B., & Depolli, M. (2021). A Resizable C++ Container using Virtual Memory. In ICSOFT (pp. 481-488). | |
! https://www.scitepress.org/Papers/2021/105571/105571.pdf | |
! | |
! so far I've only tested this on MacOS |
NewerOlder