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 linspace_mod | |
use iso_fortran_env, only: dp => real64 | |
implicit none | |
contains | |
!> | |
! Return evenly spaced numbers over a specified interval. | |
! | |
! Returns `num` evenly spaced samples, calculated over the interval `[start, stop]`. |
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
!LINK="${MKLROOT}/lib/intel64/libmkl_lapack95_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl" | |
!INC="-I${MKLROOT}/include/intel64/lp64/ -I${MKLROOT}/include/" | |
!ifort -O3 -warn all -o test_banded $INC test_banded.f90 $LINK | |
program test_banded | |
use lapack95, only: gbtrf, gbtrs, gbsv | |
use f95_precision, only: wp => dp | |
implicit none | |
integer, parameter :: kl = 2, ku = 1 |
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
module quadtree | |
! Adapted from the tutorial at https://scipython.com/blog/quadtrees-2-implementation-in-python/ | |
implicit none | |
integer, parameter :: wp = kind(1.0d0) | |
type :: qtnode | |
real(wp) :: c(2) |
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
// 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
program boyd_bvp | |
dimension xi(20),aphi(20),g(20),h(20,20),ugraph(101) | |
common/pbasis/phi(20),phix(20),phixx(20) | |
common/thiele/th | |
pi = 4.*atan(1.0) | |
! specify parameters |
NewerOlder