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 / pyzmq_client_server_demo.py
Created April 11, 2012 16:38
Demo of how to extend multiprocessing.Process to communicate with pyzmq
#!/usr/bin/env python
"""
Demo of how to extend multiprocessing.Process to communicate with
pyzmq.
"""
import zmq
from multiprocessing import Process
import time
@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 / pycuda_req_rep_demo.py
Created April 16, 2012 18:41
Interprocess communication with pyzmq and multiprocessing
#!/usr/bin/env python
"""
Pass data between processes started through the multiprocessing module
using pyzmq and process them with PyCUDA
"""
import numpy as np
import zmq
import multiprocessing as mp
@lebedov
lebedov / multi_bidi_pyzmq_demo.py
Created April 17, 2012 21:27
Bidirectional communication between two processes with pyzmq
#!/usr/bin/env python
"""
Bidirectional communication between two processes.
"""
import numpy as np
import zmq
import multiprocessing as mp
@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 / p2p_mem_copy.py
Last active April 29, 2023 21:10
Compare speed of several methods of copying data between two GPU devices
#!/usr/bin/env python
"""
Compare speed of several methods of copying data between two GPU devices.
"""
import atexit, re, time
import numpy as np
import pycuda.driver as drv
import pycuda.gpuarray as gpuarray