Skip to content

Instantly share code, notes, and snippets.

View pitrou's full-sized avatar

Antoine Pitrou pitrou

View GitHub Profile
#!/bin/bash
LTO_CFLAGS="-g -flto -fuse-linker-plugin -ffat-lto-objects -O3"
./configure --enable-ipv6 --with-ensurepip=upgrade \
CFLAGS="$LTO_CFLAGS" LDFLAGS="$LTO_CFLAGS"
# The following is basically "make profile-opt", but with additional
# flexibility if you want to add e.g. "-j4" when building
======================================================================
FAIL: test_extint128.test_to_128
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pitrou/np/build/testenv/lib/python3.4/site-packages/numpy/core/tests/test_extint128.py", line 61, in exc_iter
yield iterate()
File "/home/pitrou/np/build/testenv/lib/python3.4/site-packages/numpy/core/tests/test_extint128.py", line 97, in test_to_128
assert_equal(b, a)
File "/home/pitrou/np/build/testenv/lib/python3.4/site-packages/numpy/testing/utils.py", line 354, in assert_equal
raise AssertionError(msg)
reading sources... [100%] user/vectorize
/home/antoine/numba/docs/source/cuda-reference/host.rst:107: WARNING: autodoc: failed to import function 'profile_start' from module 'numba.cuda'; the following exception was raised:
Traceback (most recent call last):
File "/home/antoine/34/lib/python3.4/site-packages/sphinx/util/inspect.py", line 108, in safe_getattr
return getattr(obj, name, *defargs)
AttributeError: 'module' object has no attribute 'profile_start'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
// gcc avx.c -mavx -std=c99 -O2
// while true; do ./a.out; done > log
// analyze via np.genfromtxt, e.g. min, 10th percentile, median
#include <stdio.h>
#include <string.h>
#include <x86intrin.h>
#include <avxintrin.h>
#define N 3000
// gcc avx.c -mavx -std=c99 -O2
// while true; do ./a.out; done > log
// analyze via np.genfromtxt, e.g. min, 10th percentile, median
#include <stdio.h>
#include <string.h>
#include <x86intrin.h>
#include <avxintrin.h>
#define N 3000
// gcc avx.c -mavx -std=c99 -O2
// while true; do ./a.out; done > log
// analyze via np.genfromtxt, e.g. min, 10th percentile, median
#include <stdio.h>
#include <string.h>
#include <x86intrin.h>
#include <avxintrin.h>
#define N 5000
>>> print(type(a), a.dtype, a[:10])
<class 'numpy.ndarray'> [('x', '<i4'), ('y', '<f4')] [(0, 0.0) (1, 0.0) (2, 0.0) (3, 0.0) (4, 0.0) (5, 0.0) (6, 0.0) (7, 0.0)
(8, 0.0) (9, 9.171498449005928e-41)]
>>> print(type(aa), aa.dtype, aa[:10])
<class 'numpy.core.records.recarray'> [('x', '<i4'), ('y', '<f4')] [(0, 0.0) (1, 0.0) (2, 0.0) (3, 0.0) (4, 0.0) (5, 0.0) (6, 0.0) (7, 0.0)
(8, 0.0) (9, 9.171498449005928e-41)]
>>> %timeit numba_copy_x_to_y(a, b)
100000 loops, best of 3: 3.51 µs per loop
>>> %timeit numba_copy_x_to_y(aa, bb)
10000 loops, best of 3: 157 µs per loop
Haswell addition main loop:
.LBB0_15:
vmovupd -96(%rsi), %ymm0
vmovupd -64(%rsi), %ymm1
vmovupd -32(%rsi), %ymm2
vmovupd (%rsi), %ymm3
vaddpd -96(%rdx), %ymm0, %ymm0
vaddpd -64(%rdx), %ymm1, %ymm1
vaddpd -32(%rdx), %ymm2, %ymm2
from __future__ import absolute_import, print_function, division
import math
import numpy as np
from numba import jit, vectorize
from numba.utils import benchmark
### Keybase proof
I hereby claim:
* I am pitrou on github.
* I am pitrou (https://keybase.io/pitrou) on keybase.
* I have a public key whose fingerprint is 2CC2 3EF0 90A2 8BAC 5DDC 885F 769B DC21 29C2 658C
To claim this, I am signing this object: