Skip to content

PERF: Reorder header for philox#34

Merged
mattip merged 3 commits intomattip:randomgenfrom
bashtage:philox-reorder-uint128
May 27, 2019
Merged

PERF: Reorder header for philox#34
mattip merged 3 commits intomattip:randomgenfrom
bashtage:philox-reorder-uint128

Conversation

@bashtage
Copy link

Reorder header so that support uint128 is always used if available, irrespective of platform

Reorder header so that support uint128 is always used if avilable, irrespective of platform
@bashtage
Copy link
Author

This patch improves performance on Win64 if built using ICC or Clang (I think, not verified) since they support uint128.

}

/* Prefer uint128 if available: GCC, clang, ICC */
#if __SIZEOF_INT128__
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be clearer as #ifdef

@bashtage
Copy link
Author

Thanks, fixed 2 places.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one doesn't work _Win64 is defined for 32 bit windows.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I was wrong.

Use ifdef to detec uint128
@bashtage bashtage force-pushed the philox-reorder-uint128 branch from 390ecf4 to 8e0165d Compare May 27, 2019 06:57
#include <intrin.h>
/* TODO: This isn't correct for many platforms */
#ifdef _WIN64
#ifdef _WIN64 && _M_AMD64
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have been more explicit: #if defined(_WIN64) && defined(_M_AMD64) which will work even if they have values that will fail for && like 2 and 1: 2 && 1 -> 0

@mattip mattip merged this pull request into mattip:randomgen May 27, 2019
@mattip
Copy link
Owner

mattip commented May 27, 2019

thanks

mattip pushed a commit that referenced this pull request May 27, 2019
* PERF: Reorder header for philox

Reorder header so that support uint128 is always used if avilable, irrespective of platform
@bashtage bashtage deleted the philox-reorder-uint128 branch May 12, 2020 21:38
mattip pushed a commit that referenced this pull request Nov 15, 2023
Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from fa/fix_universal_crashes to labs-hpy-port

* commit '3e21b1a35e92fa196650a9a4cf6c438337b5342f':
  Migrate is_known_scalar_type_function
  Correctly convert to/from HPyArrayMethod_Context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants