Skip to content

Instantly share code, notes, and snippets.

View lebedov's full-sized avatar

Lev E. Givon lebedov

View GitHub Profile
@lebedov
lebedov / ipy_profile_pycuda.py
Created April 1, 2011 15:04
IPython profile to automatically initialize PyCUDA on a specified device
#!/usr/bin/env python
"""
IPython 0.10 profile to automatically initialize PyCUDA on a specified
device.
"""
import sys
import atexit
import IPython.ipapi
@lebedov
lebedov / cula.spec
Created January 3, 2012 19:56
RPM SPEC file for packaging CULA Dense
# RPM SPEC file for packaging CULA Dense for Mandriva Linux.
%bcond_with full
%if %{with full}
%define name cula_dense
%else
%define name cula_dense_free
%endif
@lebedov
lebedov / .tmux.conf
Last active September 29, 2015 21:48
A nice configuration for tmux 1.5 and later.
# Use backtick as control character:
set -g prefix `
unbind C-b
bind ` send-prefix
# Config reload key:
bind r source-file ~/.tmux.conf
set -g history-limit 7500
set -g default-terminal "screen-256color"
@lebedov
lebedov / multi_pyzmq_interactive_demo.py
Created April 11, 2012 18:07
Pass interactively entered data to a server process using pyzmq
#!/usr/bin/env python
"""
Pass interactively entered data to a server process using pyzmq.
"""
import zmq
import multiprocessing as mp
def server_func():
@lebedov
lebedov / logging_demo.py
Created June 1, 2012 21:38
Demo of how to use the logging module with pyzmq
#!/usr/bin/env python
"""
Demo of how to use the logging module with pyzmq.
"""
import logging
import zmq
import multiprocessing as mp
@lebedov
lebedov / eventloop_demo.py
Created June 11, 2012 20:22
Use eventloops to send and receive data
#!/usr/bin/env python
"""
Use eventloops to send and receive data.
"""
import logging
import zmq
from zmq.eventloop.ioloop import IOLoop, PeriodicCallback
from zmq.eventloop.zmqstream import ZMQStream
@lebedov
lebedov / change_imshow_ticks.py
Created October 24, 2012 03:35
How to replace tick labels for an image displayed with matplotlib
#!/usr/bin/env python
"""
Demonstrate how to replace tick labels for a displayed image.
"""
import numpy as np
import pylab as pl
im = np.random.rand(100, 200)
@lebedov
lebedov / test_pinned_register.py
Created November 8, 2012 02:47
Compare performance of using host-registered pinned and unpinned host memory
#!/usr/bin/env python
"""
Compare performance of using host-registered pinned and unpinned host memory.
"""
import numpy as np
import pycuda.autoinit
import pycuda.driver as drv
@lebedov
lebedov / test_pinned_prealloc.py
Created November 8, 2012 02:48
Compare performance of using preallocated pinned and unpinned host memory
#!/usr/bin/env python
"""
Compare performance of using pinned and unpinned host memory.
"""
import numpy as np
import pycuda.autoinit
import pycuda.driver as drv
@lebedov
lebedov / multiprocessing_skcuda_demo.py
Last active December 3, 2015 16:34
Simple demo of how to use scikit-cuda with multiprocessing.
#!/usr/bin/env python
"""
Simple demo of how to use scikit-cuda with multiprocessing.
"""
import atexit
import multiprocessing as mp
import numpy as np