Skip to content

Commit

Permalink
Use broadcast for xsimd>=8 (#148)
Browse files Browse the repository at this point in the history
* Use broadcast for xsimd>=8.

* Use jemalloc-local.

* Fix preprocessor statement.

* Add changelog entry.
  • Loading branch information
jtilly authored Oct 15, 2021
1 parent 3c069e4 commit 1eb4cc1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
Changelog
=========

3.0.3 - 2021-10-15
------------------

**Bug fix**

- We now support ``xsimd>=8`` and support alternative jemalloc installations.


3.0.2 - 2021-10-14
------------------

**Bug fix**

- Allow to link to alternatively suffixed jemalloc installation to workaround `#113 <https://github.com/Quantco/tabmat/issues/113>`_ .
- Allow to link to alternatively suffixed jemalloc installation to work around `#113 <https://github.com/Quantco/tabmat/issues/113>`_ .

3.0.1 - 2021-10-07
------------------
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- c-compiler
- cxx-compiler
- cython
- jemalloc
- jemalloc-local
- make
- mako
- mkl-include
Expand Down
2 changes: 1 addition & 1 deletion src/tabmat/ext/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef _WIN32
#define JEMALLOC_NO_DEMANGLE
#if __APPLE__
#if !(!JEMALLOC_INSTALL_SUFFIX)
#if not defined(JEMALLOC_INSTALL_SUFFIX)
#define JEMALLOC_NO_RENAME
#endif
#endif
Expand Down
8 changes: 7 additions & 1 deletion src/tabmat/ext/dense_helpers-tmpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

#include "alloc.h"

#if XSIMD_VERSION_MAJOR >= 8
#define XSIMD_BROADCAST broadcast
#else
#define XSIMD_BROADCAST set_simd
#endif

namespace xs = xsimd;

<%def name="middle_j(kparallel, IBLOCK, JBLOCK)">
Expand All @@ -33,7 +39,7 @@ namespace xs = xsimd;
// setup simd accumulators
% for ir in range(IBLOCK):
% for jr in range(JBLOCK):
auto accumsimd${ir}_${jr} = xs::set_simd(((F)0.0));
auto accumsimd${ir}_${jr} = xs::XSIMD_BROADCAST(((F)0.0));
% endfor
% endfor

Expand Down
8 changes: 7 additions & 1 deletion src/tabmat/ext/sparse_helpers-tmpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

#include "alloc.h"

#if XSIMD_VERSION_MAJOR >= 8
#define XSIMD_BROADCAST broadcast
#else
#define XSIMD_BROADCAST set_simd
#endif

namespace xs = xsimd;

<%def name="csr_dense_sandwich_tmpl(order)">
Expand Down Expand Up @@ -84,7 +90,7 @@ void _csr_dense${order}_sandwich(
}

F Q = Adata[A_idx];
auto Qsimd = xs::set_simd(Q);
auto Qsimd = xs::XSIMD_BROADCAST(Q);

Int Cj = Cjj;
Int Cjmax2 = Cjj + ((Cjmax - Cjj) / simd_size) * simd_size;
Expand Down

0 comments on commit 1eb4cc1

Please sign in to comment.