Skip to content

Commit

Permalink
move language_level:3 and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
perlinm committed Jan 30, 2025
1 parent 9f4ebc2 commit 032e8bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build-cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def build_cython() -> None:
include_dirs=[numpy.get_include()],
extra_compile_args=["-O3", "-march=native", "-Wall"],
)
ext_modules = cythonize(extension)
ext_modules = cythonize(extension, compiler_directives={"language_level": "3"})
distribution = Distribution(dict(ext_modules=ext_modules))

cmd = build_ext(distribution)
Expand Down
6 changes: 2 additions & 4 deletions qldpc/codes/_distance.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# cython: language_level=3

# C imports
from libc.stdint cimport uint64_t

Expand All @@ -24,8 +22,8 @@ cimport numpy as cnp
# utility functions


cdef uint64_t ODD_BITS_MASK = 0x5555555555555555
cdef uint64_t EVEN_BITS_MASK = 0xAAAAAAAAAAAAAAAA
cdef uint64_t ODD_BITS_MASK = 0x5555555555555555 # 1 on the odd bits of a 64-bit integer
cdef uint64_t EVEN_BITS_MASK = 0xAAAAAAAAAAAAAAAA # 1 on the even bits of a 64-bit integer


cdef uint64_t hamming_weight(uint64_t num):
Expand Down

0 comments on commit 032e8bb

Please sign in to comment.