Skip to content

Instantly share code, notes, and snippets.

@mrkwjc
mrkwjc / npbench.py
Last active Jan 19, 2019
Numpy performance tests...
View npbench.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Roughly based on: http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration
from __future__ import print_function
import numpy as np
from time import time
@mrkwjc
mrkwjc / cuspsolve32.py
Last active Dec 6, 2019
CUDA vs. CPU sparse solver in Python - single precision
View cuspsolve32.py
# ### Interface cuSOLVER PyCUDA
from __future__ import print_function
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
import scipy.sparse as sp
import ctypes
@mrkwjc
mrkwjc / cuspsolve.py
Last active Feb 24, 2021
CUDA vs. CPU sparse solver in Python
View cuspsolve.py
# ### Interface cuSOLVER PyCUDA
from __future__ import print_function
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
import scipy.sparse as sp
import ctypes
@mrkwjc
mrkwjc / gmsh_time_example.msh
Created Apr 15, 2021
Example of Gmsh .msh file with time data (MSH 2.2)
View gmsh_time_example.msh
This file has been truncated, but you can view the full file.
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
3789
1 -0.15 -0.05 0.0
2 0.15 -0.05 0.0
3 0.15 0.05 0.0
4 -0.15 0.05 0.0