Skip to content

Instantly share code, notes, and snippets.

@libbkmz
Last active January 18, 2019 13:09
Show Gist options
  • Save libbkmz/8571f206ac276d3803dfe10c97e52add to your computer and use it in GitHub Desktop.
Save libbkmz/8571f206ac276d3803dfe10c97e52add to your computer and use it in GitHub Desktop.
%%cython -a -f -c=-O3
# -c=-DCYTHON_TRACE=1
# -c=-std=c++11
# -c=-DCYTHON_TRACE=1
# -c=-DCYTHON_TRACE=1 -c=-g --link-args=-g
# %%cython -a -c=-DCYTHON_TRACE=1
# -c=-O3
# -c=-g --link-args=-g
# --cplus
#-c=-march=native -c=-mtune=native
#-c=-flto
#-c=-mavx
#-c=-funroll-loops
# -c=-ftree-vectorize
import numpy as np
# import pandas as pd
cimport numpy as cnp
cimport cython
from libc.string cimport memset, memcpy
# from libcpp.set cimport set as cpp_set
# from libcpp.unordered_set cimport unordered_set as cpp_set
cdef cnp.uint32_t BLK_TC_SHIFT = 16
BLK_TC_ACT = lambda x: x << BLK_TC_SHIFT
####################################################################################
cimport cython
# USE cmdline below to build extension
# python setup.py build_ext --inplace --force
import numpy as np
cimport numpy as cnp
from libc.stdlib cimport rand, srand, RAND_MAX
cdef extern from "<Windows.h>":
void DebugBreak()
# @cython.profile(True)
# @cython.linetrace(True)
# @cython.embedsignature (True)
# @cython.binding(True)
@cython.boundscheck (False)
@cython.wraparound (False)
@cython.cdivision(True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment